otherwise method

void otherwise(
  1. void buildError(
    1. TransitionHandlerBuilder<D, AsyncError> builder
    ), {
  2. String? label,
})

Adds a transition behavior that will take place when Result.isError is true.

The buildError callback is used to define the behavior that should take place.

Implementation

void otherwise(
  void Function(TransitionHandlerBuilder<D, AsyncError> builder) buildError, {
  String? label,
}) {
  var errorBuilder = _makeErrorBuilder();
  buildError(errorBuilder);
  _failureDescrRef.value = errorBuilder._descriptor;
}