AsyncSnapshotExtension<T> extension
Extension on AsyncSnapshot to handle its various states
- on
Properties
- errorMessage → String?
-
Available on AsyncSnapshot<
Returns the error message if the error is an Exception with a message, otherwise returns the string representation of the error.T> , provided by the AsyncSnapshotExtension extensionno setter - hasNone → bool
-
Available on AsyncSnapshot<
Returns whether this snapshot has neither data/error.T> , provided by the AsyncSnapshotExtension extensionno setter - isLoading → bool
-
Available on AsyncSnapshot<
Returns whether this snapshot is computing.T> , provided by the AsyncSnapshotExtension extensionno setter - isReloading → bool
-
Available on AsyncSnapshot<
Returns whether this snapshot is computing and has data/error.T> , provided by the AsyncSnapshotExtension extensionno setter
Methods
-
maybeWhen<
R> ({bool skipLoading = false, R data(T data)?, R error(Object error, StackTrace stackTrace)?, R loading()?, R none()?, required R orElse()}) → R -
Available on AsyncSnapshot<
Allows you to define custom behavior for different states of an AsyncSnapshot by providing callbacks forT> , provided by the AsyncSnapshotExtension extensiondata,error,loading, andnone. -
when<
R> ({bool skipLoading = false, required R data(T data), required R error(Object error, StackTrace stackTrace), required R loading(), R none()?}) → R -
Available on AsyncSnapshot<
Allows you to define custom behavior for different states of an AsyncSnapshot by providing callbacks forT> , provided by the AsyncSnapshotExtension extensiondata,error,loading, andnone. -
whenData<
R> (R map(T data)) → AsyncSnapshot< R> -
Available on AsyncSnapshot<
AppliesT> , provided by the AsyncSnapshotExtension extensionmapwhen this snapshot hasData. -
whenError(
Object map(Object error)) → AsyncSnapshot< T> -
Available on AsyncSnapshot<
AppliesT> , provided by the AsyncSnapshotExtension extensionmapwhen this snapshot hasError. -
whenOrNull<
R> ({bool skipLoading = false, R data(T data)?, R error(Object error, StackTrace stackTrace)?, R loading()?, R none()?}) → R? -
Available on AsyncSnapshot<
Allows you to define custom behavior for different states of an AsyncSnapshot by providing callbacks forT> , provided by the AsyncSnapshotExtension extensiondata,error,loading, andnone.