updateShouldNotifyDependent method

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

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

Implementation

@override
bool updateShouldNotifyDependent(
  CalcTheme oldWidget,
  Set<CalcThemeAspect> dependencies,
) {
  if (live != oldWidget.live) return true;
  // Without a live listenable, painters hold a fixed snapshot: every
  // change must rebuild them.
  if (live == null && data != oldWidget.data) return true;
  if (settled && data != oldWidget.data) return true;
  return dependencies.contains(CalcThemeAspect.layout) &&
      !data.sameLayout(oldWidget.data);
}