AsyncSnapshotExt<T> extension

An extension on AsyncSnapshot providing a when method.

on

Properties

hasData bool
Check if the AsyncSnapshot has data.
no setter
hasError bool
Check if the AsyncSnapshot has an error.
no setter
isLoading bool
Check if the AsyncSnapshot is still waiting for data.
no setter

Methods

maybeWhen<R>({R data(T data, bool isComplete)?, required R error(Object error, StackTrace? stackTrace), required R loading()}) → R
Perform conditional actions based on the state of the AsyncSnapshot.
when<R>({required R data(T data, bool isComplete), required R error(Object error, StackTrace? stackTrace), required R loading()}) → R
Perform actions conditionally based on the state of the AsyncSnapshot.