map method
void
map({
- required void onSuccess(
- T value
- required void onFailure(
- 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,
}) =>
onSuccess.call(_value);