mapOrNull<R> method
- {R data(
- AsyncData<
T> data
- AsyncData<
- R error(
- AsyncError<
T> error
- AsyncError<
- R loading(
- AsyncLoading<
T> loading
- AsyncLoading<
Perform some actions based on the state of the AsyncValue, or return null if the current state wasn't tested.
Implementation
R? mapOrNull<R>({
R Function(AsyncData<T> data)? data,
R Function(AsyncError<T> error)? error,
R Function(AsyncLoading<T> loading)? loading,
}) {
return _map(
data: (d) => data?.call(d),
error: (d) => error?.call(d),
loading: (d) => loading?.call(d),
);
}