I was searching for final vs const differences in flutter which I did understand a bit, but these two sentences (final modifies variable & const modifies value) confused me alot and I think they might be enough to understand the overall difference between these two terms. Can anyone define these?
Asked
Active
Viewed 47 times
0
-
`final` is a qualifier that indicates that variable (an individual reference to an object) cannot be reassigned. `const` is a qualifier that indicates that an *object* cannot be mutated. – jamesdlin Oct 06 '21 at 08:31
-
(And when the `const` qualifer is used to declare a variable, it means *both* that the object cannot be mutated and that the variable cannot be reassigned.) – jamesdlin Oct 06 '21 at 08:54