invalidate method

  1. @override
void invalidate(
  1. ProviderOrFamily provider
)
override

Invalidates the state of the provider, causing it to refresh.

As opposed to refresh, the refresh is not immediate and is instead delayed to the next read or next frame.

Calling invalidate multiple times will refresh the provider only once.

Calling invalidate will cause the provider to be disposed immediately.

If used on a provider which is not initialized, this method will have no effect.

Implementation

@override
void invalidate(ProviderOrFamily provider) {
  assert(_debugAssertCanDependOn(provider), '');
  _container.invalidate(provider);
}