map abstract method
void
map({
- required void onSuccess(
- T value
- required void onFailure(
- ErrorMessage errorMessage
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
void map({
required void Function(T value) onSuccess,
required void Function(ErrorMessage errorMessage) onFailure,
});