foldNotNull<R> abstract method
Similar to fold, but ensures that the value is not null before calling onSuccess
.
onSuccess
is the function that transforms the value if the result is a success and not null.
onNullOrFailure
is the function that transforms the error message or provides a default value if the result is null or a failure.
Implementation
R? foldNotNull<R>(
R Function(T value) onSuccess, {
required R Function(ErrorMessage errorMessage) onFailure,
});