executeWithFuture method

Future<TResult> executeWithFuture([
  1. TParam? param
])

Executes an async Command an returns a Future that completes as soon as the Command completes. This is especially useful if you use a RefreshIndicator

Implementation

Future<TResult> executeWithFuture([TParam? param]) {
  assert(this is CommandAsync,
      'executeWithFuture can\t be used with synchronous Commands');
  _futureCompleter = Completer<TResult>();

  execute(param);
  return _futureCompleter!.future;
}