fold<R> method
Executes onSuccess if successful, onFailure if failed
Returns the result of whichever callback is executed.
Implementation
R fold<R>({
required R Function(T data) onSuccess,
required R Function(GetVerifiedException error) onFailure,
}) {
if (isSuccess) {
return onSuccess(data as T);
} else {
return onFailure(error!);
}
}