Entity<T extends Object> class
Generated Riverpod family for a single normalized entity.
- Inheritance
-
- Object
- AnyNotifier<
AsyncValue< EntitySnapshot< , EntitySnapshot<T> >T> > - $AsyncNotifier<
EntitySnapshot< T> > - Entity
- Annotations
-
- @Riverpod(retry: entityProviderRetry)
Constructors
- Entity()
Properties
- enabled → bool
-
no setterinherited
-
fromGraph
→ EntityDecoder<
T> -
no setterinherited
-
future
→ Future<
EntitySnapshot< T> > -
Obtains a Future that resolves with the first
statevalue that is not AsyncLoading.no setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- id → String?
-
no setterinherited
- ref → Ref
-
The Ref associated with this notifier.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
state
↔ AsyncValue<
EntitySnapshot< T> > -
The value currently exposed by this notifier.
getter/setter pairinherited
- subscribe → bool
-
no setterinherited
-
toGraph
→ EntityEncoder<
T> ? -
no setterinherited
- type → String
-
no setterinherited
Methods
-
build(
{required String type, required String? id, required EntityDecoder< T> fromGraph, EntityEncoder<T> ? toGraph, bool enabled = true, bool subscribe = true}) → Future<EntitySnapshot< T> > -
listenSelf(
void listener(AsyncValue< EntitySnapshot< ? previous, AsyncValue<T> >EntitySnapshot< next), {void onError(Object error, StackTrace stackTrace)?}) → RemoveListenerT> > -
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
-
refetch(
) → Future< void> - Explicitly revalidate this entity with bounded transient retries.
-
runBuild(
) → WhenComplete? -
Executes Notifier.build.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
FutureOr< EntitySnapshot< cb(EntitySnapshot<T> >T> previousState), {FutureOr<EntitySnapshot< onError(Object err, StackTrace stackTrace)?}) → Future<T> >EntitySnapshot< T> > -
A function to update
statefrom its previous value, while abstracting loading/error cases forstate.inherited -
updateShouldNotify(
AsyncValue< EntitySnapshot< previous, AsyncValue<T> >EntitySnapshot< next) → boolT> > -
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