dispatch<T> static method

void dispatch<T>(
  1. BuildContext context,
  2. T notification, {
  3. bool assertParentExists = true,
})

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

static void dispatch<T>(
  BuildContext context,
  T notification, {
  bool assertParentExists = true,
}) {
  final dispatcher = createDispatcher<T>(
    context,
    assertParentExists: assertParentExists,
  );
  dispatcher?.dispatch(notification);
}