state property
Implementation
@override
State get state {
try {
if (_state != null) {
return _state!;
}
final cachedStateAsJson = storage.get(storageKey);
final cachedState = cachedStateAsJson != null
? fromJson(
cachedStateAsJson,
)
: null;
if (cachedState != null) {
_state = cachedState;
return _state!;
}
_state = super.state;
return _state!;
} catch (e, s) {
_state = super.state;
onPersistentStateError(e, s);
return _state!;
}
}
- @protected
inherited
Updates the State and notify to listeners and rebuild the widgets
state must be different of the current state
Implementation
@protected
set state(State newState) {
_update(newState);
}