For example, what’s const
in var title = const Text('Hi!')
?
A const constructor is an optimization! The compiler makes the object immutable, allocating the same portion of memory for all Text('Hi!')
objects.
But not Text(Math.random())
though, as its value can’t be determined at compile time!