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
void main() {
var name = "Dart";
int number = 7;
number = 10;
print(name);
print(number);
}Expected output
Dart 10
When to use?
General-purpose variable definition.