capture<T> static method
- Future<
T> future
Captures the result of a future into a Result
future.
The resulting future will never have an error. Errors have been converted to an ErrorResult value.
Implementation
static Future<Result<T>> capture<T>(Future<T> future) {
return future.then(ValueResult.new, onError: ErrorResult.new);
}