refreshAwait method

  1. @useResult
Future<T> refreshAwait({
  1. bool force = false,
  2. bool alwaysTouch = false,
})

Refreshes this notifier with fresh Data if it is stale or forced, and awaits data or error.

Note: This implementation will only touch the result if it is stale or forced. If data is available, it will be returned directly, otherwise a Completer will be used to await data or error.

If alwaysTouch if true, the result will be touched (meaning listeners will be notified) even if the data is not stale or refresh is forced.

Returns a Future that completes with the new data or error.

See also:

  • future which returns a Future that completes with the current data or error.

Implementation

@useResult
Future<T> refreshAwait({bool force = false, bool alwaysTouch = false}) {
  refresh(force: force, alwaysTouch: alwaysTouch);
  return future;
}