initializationSettings top-level property
final
The settings used for initializing the flutterLocalNotificationsPlugin.
This is used in the main function to initialize the plugin. This is also the reason why this is not a provider/class/mixin, as it is not possible to access the ProviderContainer in the main function.
Implementation
final InitializationSettings initializationSettings = InitializationSettings(
android: const AndroidInitializationSettings('notification_icon'),
iOS: DarwinInitializationSettings(
onDidReceiveLocalNotification: (id, title, body, payload) {
// TODO: handle iOS notifications while app is in the foreground
debugPrint("Received a notification while the app is in the foreground");
},
),
);