future property

  1. @visibleForTesting
  2. @protected
Future<State> get future
inherited

Obtains a Future that resolves with the first state value that is not AsyncLoading.

This future will not necessarily wait for AsyncNotifier.build to complete. If state is modified before AsyncNotifier.build completes, then future will resolve with that new state value.

The future will fail if state is in error state. In which case the error will be the same as AsyncValue.error and its stacktrace.

Implementation

@visibleForTesting
@protected
Future<State> get future {
  _element.flush();
  return _element.futureNotifier.value;
}