updateShouldNotifyDependent method

  1. @override
bool updateShouldNotifyDependent(
  1. covariant MediaQuery oldWidget,
  2. Set<Object> dependencies
)
override

Return true if the changes between this model and oldWidget match any of the dependencies.

Implementation

@override
bool updateShouldNotifyDependent(MediaQuery oldWidget, Set<Object> dependencies) {
  return dependencies.any((Object dependency) => dependency is _MediaQueryAspect && switch (dependency) {
    _MediaQueryAspect.size               => data.size != oldWidget.data.size,
    _MediaQueryAspect.orientation        => data.orientation != oldWidget.data.orientation,
    _MediaQueryAspect.devicePixelRatio   => data.devicePixelRatio != oldWidget.data.devicePixelRatio,
    _MediaQueryAspect.textScaleFactor    => data.textScaleFactor != oldWidget.data.textScaleFactor,
    _MediaQueryAspect.textScaler         => data.textScaler != oldWidget.data.textScaler,
    _MediaQueryAspect.platformBrightness => data.platformBrightness != oldWidget.data.platformBrightness,
    _MediaQueryAspect.padding            => data.padding != oldWidget.data.padding,
    _MediaQueryAspect.viewInsets         => data.viewInsets != oldWidget.data.viewInsets,
    _MediaQueryAspect.viewPadding        => data.viewPadding != oldWidget.data.viewPadding,
    _MediaQueryAspect.invertColors       => data.invertColors != oldWidget.data.invertColors,
    _MediaQueryAspect.highContrast       => data.highContrast != oldWidget.data.highContrast,
    _MediaQueryAspect.onOffSwitchLabels  => data.onOffSwitchLabels != oldWidget.data.onOffSwitchLabels,
    _MediaQueryAspect.disableAnimations  => data.disableAnimations != oldWidget.data.disableAnimations,
    _MediaQueryAspect.boldText           => data.boldText != oldWidget.data.boldText,
    _MediaQueryAspect.navigationMode     => data.navigationMode != oldWidget.data.navigationMode,
    _MediaQueryAspect.gestureSettings    => data.gestureSettings != oldWidget.data.gestureSettings,
    _MediaQueryAspect.displayFeatures    => data.displayFeatures != oldWidget.data.displayFeatures,
    _MediaQueryAspect.systemGestureInsets => data.systemGestureInsets != oldWidget.data.systemGestureInsets,
    _MediaQueryAspect.accessibleNavigation => data.accessibleNavigation != oldWidget.data.accessibleNavigation,
    _MediaQueryAspect.alwaysUse24HourFormat => data.alwaysUse24HourFormat != oldWidget.data.alwaysUse24HourFormat,
    _MediaQueryAspect.supportsShowingSystemContextMenu => data.supportsShowingSystemContextMenu != oldWidget.data.supportsShowingSystemContextMenu,
  });
}