Skip to content

Instantly share code, notes, and snippets.

@AAQ-AND-DEV
Created March 20, 2019 19:32
Show Gist options
  • Save AAQ-AND-DEV/31e2aba92c5f62c4563ef84508a82b54 to your computer and use it in GitHub Desktop.
Save AAQ-AND-DEV/31e2aba92c5f62c4563ef84508a82b54 to your computer and use it in GitHub Desktop.
first Dart var exploration
void main(){
var country = 'United States';
String name;
var dynamo;
var preType = dynamo.runtimeType;
print(preType);
//print(name is dynamic);
//looks like everything is dynamic?!?
dynamo = 47;
var type = dynamo.runtimeType;
print(type);
print(dynamo is String);
dynamo = 'dynamic!';
print(dynamo is String);
name = '1';
print(name);
print('Hello ' + country);
print('7.23');
double fraction = 23;
fraction += 0.00;
fraction = 23.00;
//only upon adding a decimal will it print the tenths/hundredths
print(fraction);
print(fraction.runtimeType);
fraction += .5;
//interesting that a single var has dynamic typing
print(fraction.runtimeType);
print(fraction);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment