var
A variable whose type is inferred from its value.
Syntax
var name = value;
Description
If you define it with var, Dart infers the type from the initial value. You can change the value later (to the same type). You can also explicitly state the type: int, double, String, bool.
Example
Loading editor…
Expected output
Dart 10
When to use?
General-purpose variable definition.