services/notifications_service library

Classes

NotificationAction
An inline action button that can appear on a notification.
NotificationChannel
Defines an Android notification channel used to group and style notifications.
NotificationMessage
Represents a notification to be displayed to the user.
NotificationService
Holds the result state of initializeLocalNotifications.

Properties

didReceiveLocalNotificationStream StreamController<NotificationMessage>
Stream of NotificationMessage objects broadcast when a local notification is received while the app is in the foreground. Since the plugin is initialised in main, streams are the recommended way to propagate notification events to the UI.
final
flutterLocalNotificationsPlugin ↔ FlutterLocalNotificationsPlugin
getter/setter pair
id int
getter/setter pair
selectNotificationStream StreamController<String?>
Stream of notification payload strings broadcast when the user taps a notification to open the app.
final

Functions

initializeLocalNotifications(String? icon, {List<NotificationAction>? actionCategories, bool requestPermissions = false, void onDidReceiveNotificationResponse(NotificationResponse)?, void onDidReceiveBackgroundNotificationResponse(NotificationResponse)?}) Future<NotificationService>
Initialises the local notifications plugin for all supported platforms.
showLocalNotification(NotificationChannel channel, NotificationMessage message, {int? notificationId}) Future<void>
Displays a local notification using the provided channel and message.