The program shape in Dart
The smallest Dart program: main, print, and a template string.
// main is the entry point; print writes a line.
void main() {
const hide = 'Reedbank Hide';
print('Logbook open at $hide');
print('Species so far: ${3 + 4}');
}
How it works
void main()is the entry point of every Dart program.constbinds a compile-time constant.$hideand${3 + 4}splice values and expressions into strings.
Keywords and builtins used here
constvoid
The run, in numbers
- Lines
- 6
- Characters to type
- 161
- Tokens
- 35
- Three-star pace
- 75 tpm
At the three-star pace of 75 tokens a minute, this run takes about 28 seconds.
Step 1 of 3 in Values, step 1 of 27 in Language basics.