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({required int id, String? tag}) Future<void>
Cancel/remove the notification with the specified id.
cancelAll() Future<void>
Cancels/removes all notifications.
cancelAllPendingNotifications() Future<void>
Cancels/removes all pending notifications.
getActiveNotifications() Future<List<ActiveNotification>>
Returns the list of active notifications shown by the application that haven't been dismissed/removed.
getNotificationAppLaunchDetails() Future<NotificationAppLaunchDetails?>
Returns info on if a notification created from this plugin had been used to launch the application.
initialize({required InitializationSettings settings, 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({required int id, required RepeatInterval repeatInterval, required NotificationDetails notificationDetails, required AndroidScheduleMode androidScheduleMode, String? title, String? body, String? payload}) Future<void>
Periodically show a notification using the specified interval.
periodicallyShowWithDuration({required int id, required Duration repeatDurationInterval, required NotificationDetails notificationDetails, String? title, String? body, AndroidScheduleMode androidScheduleMode = AndroidScheduleMode.exact, String? payload}) Future<void>
Periodically show a notification using the specified custom duration interval.
resolvePlatformSpecificImplementation<T extends FlutterLocalNotificationsPlatform>() → T?
Returns the underlying platform-specific implementation of given type T, which must be a concrete subclass of FlutterLocalNotificationsPlatform
show({required 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.
toString() String
A string representation of this object.
inherited
zonedSchedule({required int id, required TZDateTime scheduledDate, required NotificationDetails notificationDetails, required AndroidScheduleMode androidScheduleMode, String? title, String? body, 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