Show us a basic Dart program?

The following code uses many of Dart’s most basic features:

// Define a function.
void printInteger(int aNumber) {
print(‘The number is $aNumber.’); // Print to console.
}

// This is where the app starts executing.
void main() {
var number = 42; // Declare and initialize a variable.
printInteger(number); // Call a function.
}

Here’s what this program uses that applies to all (or almost all) Dart apps:

// This is a comment.
A single-line comment. Dart also supports multi-line and document comments. For details, see Comments.
void
A special type that indicates a value that’s never used. Functions like printInteger() and main() that don’t explicitly return a value have the void return type.
int
Another type, indicating an integer. Some additional built-in types are StringList, and bool.
42
A number literal. Number literals are a kind of compile-time constant.
print()
A handy way to display output.
'...' (or "...")
A string literal.
$variableName (or ${expression})
String interpolation: including a variable or expression’s string equivalent inside of a string literal. For more information, see Strings.
main()
The special, required, top-level function where app execution starts. For more information, see The main() function.
var
A way to declare a variable without specifying its type. The type of this variable (int) is determined by its initial value (42).