fromServer<R> method

  1. @protected
Future<R> fromServer<R>(
  1. Future<R> body()
)

Runs body with every watch it makes forced to CacheStrategy.serverOnly, after cancelWatches. For a refresh the person asked for, or one after an action: neither wants a copy.

Future<void> refresh() async {
  loading();
  await fromServer(initState);
  idle();
}

Implementation

@protected
Future<R> fromServer<R>(Future<R> Function() body) async {
  cancelWatches();
  final was = _serverOnly;
  _serverOnly = true;
  try {
    return await body();
  } finally {
    _serverOnly = was;
  }
}