onNotification method Null safety

  1. @override
bool onNotification(
  1. Notification notification
)
override

Called when a notification of the appropriate type arrives at this location in the tree.

Return true to cancel the notification bubbling. Return false to allow the notification to continue to be dispatched to further ancestors.

Implementation

@override
bool onNotification(Notification notification) {
  if (notification is ViewportNotificationMixin) {
    notification._depth += 1;
  }
  return false;
}