Dart has If Else:
if (year >= 2001) {
print('21st century');
} else if (year >= 1901) {
print('20th century');
} else {
print('We Must Go Back!');
}
Dart also has a ternary if
operator:
var foo = true;
print(foo ? 'Foo' : 'Bar'); // Displays "Foo".