updateShouldNotify method

  1. @visibleForOverriding
bool updateShouldNotify(
  1. String previous,
  2. String next
)
inherited

A method invoked when the state exposed by this Notifier changes. It compares the previous and new value, and return whether listeners should be notified.

By default, the previous and new value are compared using ==.

You can override this method to provide a custom comparison logic, such as using identical to use a more efficient comparison.

Implementation

@visibleForOverriding
bool updateShouldNotify(StateT previous, StateT next) {
  return ProviderElement.defaultUpdateShouldNotify(previous, next);
}