onStateChanged method
this method is called when the state has been changed
Implementation
@override
void onStateChanged(State oldState, State currentState) {
final json = toJson(currentState);
if (json != null) {
storage
.save(
storageKey,
json,
)
.onError(
onPersistentStateError,
);
}
}