capture<T>  static method 
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);
}