FlutterLocalNotificationsPlugin class Null safety

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
FlutterLocalNotificationsPlugin.private(Platform platform)
Used internally for creating the appropriate platform-specific implementation of the plugin. [...]

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

cancel(int id, {String? tag}) Future<void>
Cancel/remove the notification with the specified id. [...]
cancelAll() Future<void>
Cancels/removes all notifications. [...]
getNotificationAppLaunchDetails() Future<NotificationAppLaunchDetails?>
Returns info on if a notification created from this plugin had been used to launch the application. [...]
initialize(InitializationSettings initializationSettings, {SelectNotificationCallback? onSelectNotification}) Future<bool?>
Initializes the plugin. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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. [...]
@Deprecated('Deprecated due to problems with time zones. Use zonedSchedule ' 'instead.')
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.
@Deprecated('Deprecated due to problems with time zones. Use zonedSchedule instead ' 'by passing a date in the future with the same time and pass ' 'DateTimeComponents.matchTime as the value of the ' 'matchDateTimeComponents parameter.')
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.
@Deprecated('Deprecated due to problems with time zones. Use zonedSchedule instead ' 'by passing a date in the future with the same day of the week and time ' 'as well as passing DateTimeComponents.dayOfWeekAndTime as the value of ' 'the matchDateTimeComponents parameter.')
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