StateFulInstanceSettings class
Settings for stateful instance. Contain state restore flags and state id
@singleton
class UserDefaultsInteractor extends BaseInteractor<UserDefaultsState> {
@override
void onRestore(Map<String, dynamic> savedStateObject) {
updateState(UserDefaultsState.fromJson(savedStateObject));
}
@override
Map<String, dynamic> get savedStateObject => state.toMap();
@override
StateFulInstanceSettings get stateFulInstanceSettings =>
StateFulInstanceSettings(
stateId: state.runtimeType.toString(),
);
}
Constructors
- StateFulInstanceSettings.new({bool isRestores = false, required String stateId, bool syncRestore = true})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isRestores → bool
-
Flag indicating that this instance needs to save state to user defaults
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stateId → String
-
State id for this instance -
used as key in cache storage
final
- syncRestore → bool
-
Flag indicating that cached state should be awaited
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited