handle method
void
handle({
- OnSuccess<
T> ? onSuccess, - OnError? onError,
- OnException? onException,
- OnFailure? onFailure,
Implementation
void handle({
OnSuccess<T>? onSuccess,
OnError? onError,
OnException? onException,
OnFailure? onFailure,
}) {
if (success) {
onSuccess?.call(data, response);
} else if (error && (onError != null)) {
onError(response);
} else if (hasException && (onException != null)) {
onException(_exception);
} else {
onFailure?.call(response, _exception);
}
}