final: When you don't want to change a variable's value, usefinal. Once initialized, its value is immutable, but it must be assigned at runtime—meaning it can be initialized in constructors or other methods.
dartfinal String name = 'John Doe';
Or assigned at runtime:
dartfinal DateTime currentTime = DateTime.now();
const: Useconstwhen defining a compile-time constant. Aconstconstant requires all values to be known at compile time.
dartconst double pi = 3.14159;
You can also use const to create immutable collections at compile time:
dartconst List<int> numbers = [1, 2, 3, 4, 5];
In summary, choose between final and const based on whether the variable's value needs to be determined at compile time. If so, use const; if the assignment relies on runtime computation, use final.