SnapshotHelper<T> class

AsyncSnapshot wrapper

Constructors

SnapshotHelper(AsyncSnapshot<T> snapshot, {SnapshotPredicate<T> loadingPredicate, SnapshotPredicate<T> dataPredicate, SnapshotPredicate<T> errorPredicate, Widget defaultWidget})
SnapshotHelper.of(AsyncSnapshot<T> snapshot, {SnapshotPredicate<T> loadingPredicate, SnapshotPredicate<T> dataPredicate, SnapshotPredicate<T> errorPredicate})
Creates an instance of the helper for the given snapshot. Supply additional predicates in case of needing more complex rules.
factory

Properties

hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
snapshot AsyncSnapshot<T>
snapshot is the original snapshot to process
final

Methods

defaultDataPredicate(AsyncSnapshot<T> snapshot) bool
defaultDataPredicate is the default predicate to determine the onData status
defaultErrorPredicate(AsyncSnapshot<T> snapshot) bool
defaultErrorPredicate is the default predicate to determine the onError status
defaultLoadingPredicate(AsyncSnapshot<T> snapshot) bool
defaultLoadingPredicate is the default predicate to determine the loading status
getWidget({SnapshotBuilder<T> onData, SnapshotBuilder<T> onError, SnapshotBuilder<T> onLoading, Widget defaultWidget}) Widget
Call this to build the widget in the cases of onData, onError or onLoading Supply a defaultWidget in case any state is matched
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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