ifFailure method

void ifFailure(
  1. void action(
    1. String message,
    2. Exception? exception
    )
)

Implementation

void ifFailure(void Function(String message, Exception? exception) action) {
  if (isFailure) {
    final failure = _result as Failure;
    final message = failure.message;
    final exception = failure.exception;
    action(message, exception);
  }
}