updateShouldNotifyDependent method
bool
updateShouldNotifyDependent(
- covariant PressableState oldWidget,
- Set<
PressableStateAspect> dependencies
override
Return true if the changes between this model and oldWidget match any
of the dependencies.
Implementation
@override
bool updateShouldNotifyDependent(
PressableState oldWidget,
Set<PressableStateAspect> dependencies,
) {
return dependencies.contains(PressableStateAspect.enabled) &&
oldWidget.enabled != enabled ||
dependencies.contains(PressableStateAspect.hovered) &&
oldWidget.hovered != hovered ||
dependencies.contains(PressableStateAspect.focused) &&
oldWidget.focused != focused ||
dependencies.contains(PressableStateAspect.pressed) &&
oldWidget.pressed != pressed ||
dependencies.contains(PressableStateAspect.longPressed) &&
oldWidget.longPressed != longPressed ||
dependencies.contains(PressableStateAspect.pointerPosition) &&
oldWidget.pointerPosition != pointerPosition ||
dependencies.contains(PressableStateAspect.currentState) &&
oldWidget.currentState != currentState;
}