Skip to content

Instantly share code, notes, and snippets.

@tailorvj
Created March 25, 2020 11:26
Show Gist options
  • Save tailorvj/5acbfec10400b03bec787fb00a3e1ce4 to your computer and use it in GitHub Desktop.
Save tailorvj/5acbfec10400b03bec787fb00a3e1ce4 to your computer and use it in GitHub Desktop.
Dart runtimeType inferred from value assigned to variable
main() {
var theNumber = 42;
const PI = 3.14159;
var theText = 'Hello World!';
var learningDart = true;
print('theNumber is type ${theNumber.runtimeType}');
print('PI is type ${PI.runtimeType}');
print('theText is type ${theText.runtimeType}');
print('learningDart is type ${learningDart.runtimeType}');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment