author avatar

syedsibtain

Tue Oct 24 2023

Dart has three types of variables, var, final and const

  1. var is used for dynamic typing, allowing the type of the variable to be inferred at runtime.
  2. final is used to declare a variable that can only be assigned once. It must be initialised when declared, and its value cannot change.
  3. const is used to declare a compile-time constant. It must be initialised with a constant value, and its value cannot change.