onNotification method

  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 ServiceNotification &&
      notification.type == runtimeType) {
    notify();
    return true;
  }
  return false;
}