updateShouldNotifyDependent method

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

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

Implementation

@override
bool updateShouldNotifyDependent(
  covariant RouteScopeProvider oldWidget,
  Set<RouteScope> dependencies,
) {
  return (dependencies.contains(RouteScope.meta) &&
          !mapEquals(oldWidget.route.meta, route.meta)) ||
      (dependencies.contains(RouteScope.params) &&
          !mapEquals(oldWidget.params, params)) ||
      (dependencies.contains(RouteScope.query) &&
          oldWidget.query.toString() != query.toString()) ||
      (dependencies.contains(RouteScope.uri) &&
          oldWidget.location.uri != location.uri) ||
      (dependencies.contains(RouteScope.state) &&
          oldWidget.location.state != location.state) ||
      (dependencies.contains(RouteScope.location) &&
          (oldWidget.location.uri != location.uri ||
              oldWidget.location.state != location.state)) ||
      (dependencies.contains(RouteScope.from) &&
          oldWidget.fromLocation != fromLocation);
}