flatMapThrowable<B> method
FutureOr<B>
flatMapThrowable<B>(
- FutureOr<
B> f(- A a
- B onError(
- dynamic error,
- StackTrace stackTrace
Implementation
FutureOr<B> flatMapThrowable<B>(
FutureOr<B> Function(A a) f,
B Function(dynamic error, StackTrace stackTrace) onError,
) {
if (this is Future) {
return (this as Future<A>).then(f, onError: onError);
} else {
try {
return f(this as A);
} catch (err, stack) {
return onError(err, stack);
}
}
}