Skip to content
Justice Tech School

Dart Variables

Declare with var (type inferred) or a type such as int and String. final is set once at runtime and const is a compile time constant.

Example
var name = "Ada";
int age = 21;
final pi = 3.14;
const max = 100;
print("$name $age $pi $max");

Exercise

Compile time constant.

 max = 10;

Quiz Test

Which keyword makes a compile time constant?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.