displayNotification method

Future<void> displayNotification({
  1. required String channelID,
  2. required String channelName,
  3. String? channelDescription,
  4. required String title,
  5. required String body,
  6. String? ext,
})

Implementation

Future<void> displayNotification(
    {required String channelID,
    required String channelName,
    String? channelDescription,
    required String title,
    required String body,

    /// External information
    String? ext}) async {
  final AndroidNotificationDetails androidPlatformChannelSpecifics =
      AndroidNotificationDetails(channelID, channelName,
          channelDescription: channelDescription,
          importance: Importance.max,
          priority: Priority.high);
  final NotificationDetails platformChannelSpecifics =
      NotificationDetails(android: androidPlatformChannelSpecifics);
  return await flutterLocalNotificationsPlugin.show(
      Random().nextInt(100000), title, body, platformChannelSpecifics,
      payload: ext);
}