Getters and Setters
Expose computed and guarded properties.
Beyond Plain Fields
Sometimes you want a property that is computed or guarded. Dart offers getters and setters to control how a value is read and written.
What a Getter Is
A getter looks like a field from outside but runs code to produce its value. Use the get keyword to define one.
int get area => width * height;