map<R> method
- {required R data(
- AsyncData<
T> data
- AsyncData<
- required R error(
- AsyncError<
T> error
- AsyncError<
- required R loading(
- AsyncLoading<
T> loading
- AsyncLoading<
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
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 _map(data: data, error: error, loading: loading);
}