showNotification static method

void showNotification(
  1. String title,
  2. String message, {
  3. dynamic alertPosition = AlertPosition.rightTopCorner,
  4. dynamic onTap,
  5. dynamic closeOnTap = false,
})

Implementation

static void showNotification(String title, String message, {alertPosition = AlertPosition.rightTopCorner, onTap, closeOnTap = false}) {
  final context = navigatorKey.currentContext;
  final alertState = Provider.of<_AlertState>(context!, listen: false);
  alertState.notify(
    _Alert(title: title, message: message, alertPosition: alertPosition, alertType: AlertType.notification, onTap: onTap, closeOnTap: closeOnTap),
  );
}