updateShouldNotify method

  1. @override
bool updateShouldNotify(
  1. Tree? previous,
  2. Tree? next
)

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

@override
bool updateShouldNotify(Tree? previous, Tree? next) {
  return true;
}