index property
int get index => _index;
is a getter method that returns the value of the
private _index
variable. It allows other classes to access the value of
_index
without being able to modify it directly.
Implementation
int get index => _index;