For anyone interested in the where the answer to this question came from, please refer to the pull request in
https://github.com/MaikuB/flutter_local_notifications/pull/1459.
In order to change the background color of a notification using flutter_local_notifications, you need to utilize the Android's foreground service which is not included in the FlutterLocalNotification plugins manifest.
Open android->app->main->AndroidManifest.xml and make sure you add the service and permission as follows:
<application
<service
android:name="com.dexterous.flutterlocalnotifications.ForegroundService"
android:exported="false"
android:stopWithTask="false"/>
</application>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
With that added you can call the service to customize the background color of your notification.
Future<void> _startForegroundServiceWithBlueBackgroundNotification() async{
const AndroidNotificationDetails androidPlatformChannelSpecifics =
AndroidNotificationDetails(
'your channel id',
'your channel name',
channelDescription: 'color background channel description',
importance: Importance.max,
priority: Priority.high,
color: Colors.blue,
colorized: true,
);
/// only using foreground service can color the background
await flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()
?.startForegroundService(
1, 'colored background text title', 'colored background text body',
notificationDetails: androidPlatformChannelSpecifics,
payload: 'item x');
}