HydratedNotifier<State> class
abstract
Base class for hydrated notifiers with Notifier
- Mixed-in types
-
- HydratedMixinBase<
State> - HydratedMixin<
State>
- HydratedMixinBase<
Constructors
Properties
- baseStorageKey → String
-
Base part of the storage key. Override if you want something other than runtimeType.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- ref → Ref
-
The
Refassociated with this notifier.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state ↔ State
-
The value currently exposed by this notifier.
getter/setter pairinherited
- stateOrNull → State?
-
The value currently exposed by this
Notifier.no setterinherited - storageKey → String
-
Storage key for this notifier.
Customize via storageKeySuffix or override this getter entirely.
no setterinherited
- storageKeySeparator → String
-
Separator used between base key and suffix.
no setterinherited
- storageKeySuffix → String?
-
Optional suffix to differentiate multiple instances of the same notifier.
no setterinherited
- writeDebounce → Duration
-
Debounce duration for persistence. Defaults to immediate write.
no setterinherited
Methods
-
build(
) → State -
Initialize a
Notifier.inherited -
clear(
) → Future< void> -
Clears the persisted state
inherited
-
fromJson(
Map< String, dynamic> json) → State? -
Converts JSON to state
inherited
-
hydrate(
) → State? -
Attempts to restore persisted state and ensures pending writes flush on dispose.
Returns null when there is no saved state.
inherited
-
listenSelf(
void listener(State? previous, State next), {void onError(Object error, StackTrace stackTrace)?}) → RemoveListener -
Listens to changes on the value exposed by this provider.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onError(
Object error, StackTrace stackTrace) → void -
Called when an error occurs during serialization/deserialization
inherited
-
onPersist(
Map< String, dynamic> json) → void -
Hook invoked after a successful persist; override to log/trace.
inherited
-
runBuild(
) → void -
Executes
Notifier.build.inherited -
toJson(
State state) → Map< String, dynamic> ? -
Converts state to JSON
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateShouldNotify(
State previous, State next) → bool -
A method invoked when the state exposed by this
Notifierchanges. It compares the previous and new value, and return whether listeners should be notified.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited