whenResolved<R> method
Future<R>
whenResolved<R>(
- FutureOr<
R> onResolve(- V? value,
- Object? error,
- StackTrace? stackTrace
Invokes a callback when this value resolves, either successfully or with an error, and maps the outcome to a new result.
The onResolve callback is always executed:
- On success, it receives the resolved value and
nullerror/stackTrace - On failure, it receives
nullvalue along with the error and stackTrace
Errors are not automatically rethrown. The onResolve callback
determines how failures are handled by choosing to return a value,
throw a new error, or rethrow the received error.
This method delegates to resolveAsync and then applies
Future.whenResolved on the resulting Future.
Implementation
Future<R> whenResolved<R>(
FutureOr<R> Function(V? value, Object? error, StackTrace? stackTrace)
onResolve) =>
resolveAsync().whenResolved(onResolve);