Flutter PUSH Notification icon not showing

652 Views Asked by At

I tried to add flutter app icon by using a package flutter_launcher_icon app icon is correct but icons shows in push notification show as a white box Notification Icon Shows as a white box

enter image description here

Resource File

I added icons by using a package [flutter_launcher_icons] pubspec.yaml file

Expected Output enter image description here

1

There are 1 best solutions below

0
On

same error have happened to me so i have used icon as xml file in android

enter image description here

we have to add that file name here

 void showNotification(int orderCount) async {
    FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
    var initializationSettingsAndroid = AndroidInitializationSettings('fav_icon');
    var initializeSettings = InitializationSettings(android: initializationSettingsAndroid);
    var res = await flutterLocalNotificationsPlugin.initialize(initializeSettings) ?? false;
    Log.d("Notification manager initialized $res");
    if (res) {
      flutterLocalNotificationsPlugin.show(
          1,
          "Order",
          "You have new notifications",
          NotificationDetails(
              android: AndroidNotificationDetails('NOTIFICATION', 'New order notifications',
                  channelDescription: 'Shows notifications when new orders are available',
                  importance: Importance.max,
                  priority: Priority.high,
                  playSound: true,
                  category: AndroidNotificationCategory.event,
                  color: MyColor.kSecondary)));
    }
  }