late Variables
late delays initialisation until first use and can make expensive values lazy.
Example
late final String name;
void main() {
name = "Ada";
print(name);
late var big = compute();
print(big);
}
int compute() => 42;Exercise
Lazy init.
final String s;Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.