Skip to content

Instantly share code, notes, and snippets.

@dariogabriel113
Created June 13, 2019 00:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dariogabriel113/2fe3fc7840d69a3fa5d8be89403898b1 to your computer and use it in GitHub Desktop.
Save dariogabriel113/2fe3fc7840d69a3fa5d8be89403898b1 to your computer and use it in GitHub Desktop.
Dart | Language samples - Control flow statements
var name = 'Voyager I';
var year = 1977;
var antennaDiameter = 3.7;
var flybyObjects = ['Jupiter', 'Saturn', 'Uranus', 'Neptune'];
var image = {
'tags': ['saturn'],
'url': '//path/to/saturn.jpg'
};
if(year >= 2001) {
print('21st century');
} else if (year >= 1901) {
print('20th century');
}
for(var object in flybyObjects) {
print(object);
}
for(int month = 1; month <= 12; month++) {
print(month);
}
while(year < 2016) {
year += 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment