dispatch method

void dispatch(
  1. T notification
)

Dispatches the notification to the closest SlidableGroupBehavior with the given type.

assertParentExists is only used internally to not throws an assertion error if there are no SlidableGroupBehaviors in the tree.

Implementation

void dispatch(T notification) {
  final notifier = _inheritedSlidableNotification.notifier;
  final onNotification = _inheritedSlidableNotification.onNotification;
  final effectiveNotification = onNotification != null ? onNotification(notification) : notification;

  if (effectiveNotification != null) {
    notifier.value = effectiveNotification;
  }
}