ReduxNotifier<T> class abstract

A notifier where the state can be updated by dispatching actions by calling dispatch.

You do not have access to Ref in this notifier, so you need to pass the required dependencies via constructor.

From outside, you can should dispatch actions with ref.redux(provider).dispatch(action).

Dispatching from the notifier itself is also possible but you will lose the implicit debugOrigin stored in a Ref.

Implementers

Constructors

ReduxNotifier.new({String? debugLabel})

Properties

customDebugLabel String?
finalinherited
debugLabel String
A label to be used in debug messages and by the RiverpieTracingPage.
no setterinherited
dependencies Set<BaseNotifier>
A collection of notifiers that this notifier depends on.
finalinherited
dependents Set<BaseNotifier>
A collection of notifiers that depend on this notifier. They will be disposed when this notifier is disposed.
finalinherited
disposeAction → SynchronousReduxAction<BaseReduxNotifier<T>, T, dynamic>?
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
initialAction BaseReduxAction<BaseReduxNotifier<T>, T, dynamic>?
Override this to provide a custom action that will be dispatched when the notifier is initialized.
no setterinherited
provider → BaseProvider<BaseNotifier, dynamic>?
The provider that created this notifier. This is only available after the initialization.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state → T
Gets the current state.
no setterinherited

Methods

compareIdentity(LabeledReference other) bool
Compares the identity of two LabeledReferences.
inherited
dispose() → void
This is called on Ref.dispose. You can override this method to dispose resources.
inherited
init() → T
Initializes the state of the notifier. This method is called only once and as soon as the notifier is accessed the first time.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postInit() → void
Override this to provide a custom post initialization. The initial state is already set at this point.
inherited
toString() String
A string representation of this object.
inherited
updateShouldNotify(T prev, T next) bool
Override this if you want to a different kind of equality.
inherited

Operators

operator ==(Object other) bool
Subclasses should not override this method. It is used internally by dependencies and dependents.
inherited

Static Methods

test<T, E extends Object>({required BaseReduxNotifier<T> redux, bool runInitialAction = false, T? initialState}) TestableReduxNotifier<T>
Returns a debug version of the notifier where you can set the state directly and dispatch actions