map<R> method
R
map<R>({
- required R data(
- AsyncData<
T> data
- AsyncData<
- required R error(
- AsyncError<
T> error
- AsyncError<
- required R loading(
- AsyncLoading<
T> loading
- AsyncLoading<
override
Perform some action based on the current state of the AsyncValue.
This allows reading the content of an AsyncValue in a type-safe way, without potentially ignoring to handle a case.
Implementation
@override
R map<R>({
required R Function(AsyncData<T> data) data,
required R Function(AsyncError<T> error) error,
required R Function(AsyncLoading<T> loading) loading,
}) {
return data(this);
}