updateShouldNotifyDependent method
bool
updateShouldNotifyDependent(
- covariant SharedValueInheritedModel oldWidget,
- Set<
int> dependencies
override
Return true if the changes between this model and oldWidget
match any
of the dependencies
.
Implementation
@override
bool updateShouldNotifyDependent(
SharedValueInheritedModel oldWidget,
Set<int> dependencies,
) {
// Compare the nonce value of this SharedValue,
// with an older nonce value of the same SharedValue object.
//
// If the nonce values are not same,
// rebuild the widget
return dependencies.any(
(sharedValueHash) =>
stateNonceMap[sharedValueHash] !=
oldWidget.stateNonceMap[sharedValueHash],
);
}