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 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(
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, AndroidScheduleMode? androidScheduleMode}) → 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 -
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.
-
toString(
) → String -
A string representation of this object.
inherited
-
zonedSchedule(
int id, String? title, String? body, TZDateTime scheduledDate, NotificationDetails notificationDetails, {required UILocalNotificationDateInterpretation uiLocalNotificationDateInterpretation, bool androidAllowWhileIdle = false, AndroidScheduleMode? androidScheduleMode, 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