map method

  1. @override
void map({
  1. required void onSuccess(
    1. T value
    ),
  2. required void onFailure(
    1. ErrorMessage errorMessage
    ),
})
override

Calls the appropriate callback based on the result being a success or a failure.

onSuccess is the function to be called with the value if the result is a success. onFailure is the function to be called with the error message if the result is a failure.

Implementation

@override
void map({
  required void Function(T value) onSuccess,
  required void Function(ErrorMessage errorMessage) onFailure,
}) =>
    onFailure.call(_error);