Variables are user-defined symbols that hold a reference to some value. They can range from a single number to large object graphs. It is virtually impossible to write a useful program without at least one variable. You can probably argue that almost every program ever written can be boiled down to taking in some input, storing that data in a variable, manipulating the data in some way, and then returning an output. All of this would be impossible without variables.
Recently, a new trend has appeared in programming that emphasizes immutability. This means that once the values are stored in a variable, that's it – they cannot change. Immutable variables are safer, produce no side effects, and lead to fewer bugs as a consequence.
In this recipe, we will create a small toy program that will declare variables in the three different ways that Dart allows – var, final, and const.