showNotification static method

dynamic showNotification({
  1. required RemoteNotification notification,
  2. Map<String, dynamic>? payload,
  3. String? icon,
})

Implementation

static showNotification(
    {required RemoteNotification notification,
    Map<String, dynamic>? payload,
    String? icon}) {
  flutterLocalNotificationsPlugin.show(
      notification.hashCode,
      notification.title,
      notification.body,
      NotificationDetails(
        android: AndroidNotificationDetails(
          channel.id,
          channel.name,
          // channel.description,
          // TODO add a proper drawable resource to android, for now using
          //      one that already exists in example app.
          icon: icon,
        ),
      ),
      payload: jsonEncode(payload));
}