whenError method

AsyncSnapshot<T> whenError(
  1. Object map(
    1. Object error
    )
)

Applies map when this snapshot hasError.

Implementation

AsyncSnapshot<T> whenError(
  Object Function(Object error) map,
) {
  if (hasError) {
    return AsyncSnapshot.withError(connectionState, map(error!), stackTrace!);
  }
  return this;
}