notify method
Notifies all observers that there's a change in the state of the subject.
state
- The new state information provided by the subject.
This method will call the update()
method of all observers attached to the subject.
Implementation
@override
void notify(State state) {
_state = state;
super.notify(state);
}