doFuture<T> method

  1. @Deprecated('Use try/catch instead')
void doFuture<T>(
  1. Future<T> future,
  2. void onValue(
    1. T value
    ), {
  3. void onError(
    1. Object error
    )?,
})

Call a future. Using Rx wrappers with subscribe method is preferable.

Implementation

@Deprecated('Use try/catch instead')
void doFuture<T>(
  Future<T> future,
  void Function(T value) onValue, {
  void Function(Object error)? onError,
}) {
  // ignore: avoid_types_on_closure_parameters
  future.then(onValue).catchError((Object e) {
    onError?.call(e);
  });
}