FluxValueNotifier<T> class

A simple Notifier for basic value types that works with Flux.

Example:

final counterProvider = NotifierProvider<FluxValueNotifier<int>, int>(
  () => FluxValueNotifier(0),
);
Mixed-in types

Constructors

FluxValueNotifier(T _initialValue)

Properties

hashCode int
The hash code for this object.
no setterinherited
ref → NotifierProviderRef<T>
The Ref from the provider associated with this Notifier.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state ↔ T
The value currently exposed by this Notifier.
getter/setter pairinherited
stateOrNull → T?
The value currently exposed by this Notifier.
no setterinherited

Methods

build() → T
Initialize a Notifier.
listenSelf(void listener(T? previous, T next), {void onError(Object error, StackTrace stackTrace)?}) → void
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
set(T value) → void
Set the state to a new value. Called by Flux setProvider.
override
toString() String
A string representation of this object.
inherited
update(T updater(T current)) → void
Convenience method to update state
updateShouldNotify(T previous, T next) bool
A method invoked when the state exposed by this Notifier changes. It compares the previous and new value, and return whether listeners should be notified.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited