Basics
Variables
var, final, const
var allows reassignment, final is assigned once at runtime, and const is a compile-time constant.
Program
Play the program to change count, then capture a final total.
variables.dart
void main() {
var count = 1;
count = count + 2;
final total = count * 10;
const tax = 5;
print(total + tax);
}
var
Reassignable runtime binding.
final
Assigned once; the value can come from any expression.
const
Compile-time constant; value must be known at compile time.