dismiss static method

FutureOr<void> dismiss({
  1. required BuildContext context,
})

Hides a shown notification.

context is required, this is used to get internally used notification controller class which is subclass of InheritedWidget.

This method will awaits an animation that showing the notification.

Implementation

static FutureOr<void> dismiss({required BuildContext context}) async {
  final controller = _NotificationController.of(context);

  if (controller == null) return;

  await controller.dismissProgramatically();
}