updateShouldNotify method
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.
Note:
This also affects whether AsyncNotifier.future notifies.
If updateShouldNotify returns false, then AsyncNotifier.future will not notify
when the state changes. However, the future will still resolve with the new state.
Implementation
@override
bool updateShouldNotify(
Tree previous,
Tree next,
) {
return true;
}