flush method

  1. @internal
void flush()

A utility for re-initializing a provider when needed.

Calling flush will only re-initialize the provider if it needs to rerun. This can involve:

  • a previous call to invalidateSelf
  • a dependency of the provider has changed (such as when using watch).

This is not meant for public consumption. Public API should hide flush from users, such that they don't need to care about invoking this function.

Implementation

@internal
void flush() {
  _maybeRebuildDependencies();
  if (_mustRecomputeState) {
    _mustRecomputeState = false;
    _performBuild();
  }
}