dismissById method

void dismissById(
  1. String id, {
  2. bool showRemoveAnimation = true,
})

dismisses a notification by its id

if there is no notification with the given id nothing will happen

Implementation

void dismissById(
  String id, {
  bool showRemoveAnimation = true,
}) {
  final notification = findToastificationItem(id);

  if (notification != null) {
    dismiss(notification, showRemoveAnimation: true);
  }
}