FlutterLocalNotificationsPlugin class

Provides cross-platform functionality for displaying local notifications.

The plugin will check the platform that is running on to use the appropriate platform-specific implementation of the plugin. The plugin methods will be a no-op when the platform can't be detected.

Use resolvePlatformSpecificImplementation and pass the platform-specific type of the plugin to get the underlying platform-specific implementation if access to platform-specific APIs are needed.

Constructors

FlutterLocalNotificationsPlugin()
Factory for create an instance of FlutterLocalNotificationsPlugin.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancel(int id, {String? tag}) Future<void>
Cancel/remove the notification with the specified id.
cancelAll() Future<void>
Cancels/removes all notifications.
getActiveNotifications() Future<List<ActiveNotification>>
Returns a list of notifications that are already delivered/shown.
getNotificationAppLaunchDetails() Future<NotificationAppLaunchDetails?>
Returns info on if a notification created from this plugin had been used to launch the application.
initialize(InitializationSettings initializationSettings, {DidReceiveNotificationResponseCallback? onDidReceiveNotificationResponse, DidReceiveBackgroundNotificationResponseCallback? onDidReceiveBackgroundNotificationResponse}) Future<bool?>
Initializes the plugin.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pendingNotificationRequests() Future<List<PendingNotificationRequest>>
Returns a list of notifications pending to be delivered/shown.
periodicallyShow(int id, String? title, String? body, RepeatInterval repeatInterval, NotificationDetails notificationDetails, {String? payload, bool androidAllowWhileIdle = false}) Future<void>
Periodically show a notification using the specified interval.
resolvePlatformSpecificImplementation<T extends FlutterLocalNotificationsPlatform>() → T?
Returns the underlying platform-specific implementation of given type T, which must be a concrete subclass of FlutterLocalNotificationsPlatform
schedule(int id, String? title, String? body, DateTime scheduledDate, NotificationDetails notificationDetails, {String? payload, bool androidAllowWhileIdle = false}) Future<void>
Schedules a notification to be shown at the specified date and time.
show(int id, String? title, String? body, NotificationDetails? notificationDetails, {String? payload}) Future<void>
Show a notification with an optional payload that will be passed back to the app when a notification is tapped.
showDailyAtTime(int id, String? title, String? body, Time notificationTime, NotificationDetails notificationDetails, {String? payload}) Future<void>
Shows a notification on a daily interval at the specified time.
showWeeklyAtDayAndTime(int id, String? title, String? body, Day day, Time notificationTime, NotificationDetails notificationDetails, {String? payload}) Future<void>
Shows a notification on weekly interval at the specified day and time.
toString() String
A string representation of this object.
inherited
zonedSchedule(int id, String? title, String? body, TZDateTime scheduledDate, NotificationDetails notificationDetails, {required UILocalNotificationDateInterpretation uiLocalNotificationDateInterpretation, required bool androidAllowWhileIdle, String? payload, DateTimeComponents? matchDateTimeComponents}) Future<void>
Schedules a notification to be shown at the specified date and time relative to a specific time zone.

Operators

operator ==(Object other) bool
The equality operator.
inherited