update method
This method is called whenever there is a change in the state of the Subject
.
subject
- A reference to the subject object that triggered the update.state
- The new state information provided by the subject.
Implementations of the Observer
class should provide an implementation of the update()
method to perform actions with the new state information provided.
Implementation
@override
void update(Subject<State> subject, State state) {
super.update(subject, state);
_controller.add(state);
}