Change Flutter local notification icon background color

Viewed 3363

Hey guys i was wondering how i could change the background color/accent color of the local notification icon. i know for changing firebase messaging icon background we use this

<meta-data android:name="com.google.firebase.messaging.default_notification_color"
              android:resource="@color/background_color" />

but i couldn't find any thing for flutter local notifications, it's always grey. any ideas?

2 Answers

You can change icon color by specifying color in the NotificationDetails. But make sure the icon is monochrome and has a transparent background.

NotificationDetails(
      android: AndroidNotificationDetails('id', 'name', 'des',
          // Specify the color
          color: const Color.fromARGB(255, 255, 0, 0),

          importance: Importance.max),
      iOS: IOSNotificationDetails(),
    );

Convert all parts of the image that you don’t want to show to transparent pixels. All colors and non transparent pixels are displayed in white

Related