showNotification static method

Future<void> showNotification(
  1. String tittle,
  2. String desc
)

Implementation

static Future<void> showNotification(String tittle, String desc) async {
  const AndroidNotificationDetails androidPlatformChannelSpecifics =
      AndroidNotificationDetails(
        'channel_id',
        'channel_name',
        channelDescription: 'channel description',
        importance: Importance.max,
        priority: Priority.high,
        ticker: 'ticker',
      );

  const NotificationDetails platformChannelSpecifics = NotificationDetails(
    android: androidPlatformChannelSpecifics,
  );

  await flutterLocalNotificationsPlugin.show(
    0, // Notification ID
    tittle,
    desc,
    platformChannelSpecifics,
  );
}