AwesomeNotificationsPlatform class abstract

Inheritance
  • Object
  • PlatformInterface
  • AwesomeNotificationsPlatform
Implemented types
Implementers

Constructors

AwesomeNotificationsPlatform()
Constructs a AwesomeNotificationsPlatform.

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) Future<void>
Cancels a single notification and its respective schedule.
inherited
cancelAll() Future<void>
Cancels all active notifications and schedules.
inherited
cancelAllSchedules() Future<void>
Cancels all active schedules, without dismissing the respective notifications.
inherited
cancelNotificationsByChannelKey(String channelKey) Future<void>
Cancels all active notifications and schedules with the specified channelKey.
inherited
cancelNotificationsByGroupKey(String groupKey) Future<void>
Cancels all active notifications and schedules with the specified groupKey.
inherited
cancelSchedule(int id) Future<void>
Cancels a single scheduled notification, without dismissing the active notification.
inherited
cancelSchedulesByChannelKey(String channelKey) Future<void>
Cancels all active schedules with the specified channelKey, without dismissing the respective notifications.
inherited
cancelSchedulesByGroupKey(String groupKey) Future<void>
Cancels all active schedules with the specified groupKey, without dismissing the respective notifications.
inherited
checkPermissionList({String? channelKey, List<NotificationPermission> permissions = const [NotificationPermission.Badge, NotificationPermission.Alert, NotificationPermission.Sound, NotificationPermission.Vibration, NotificationPermission.Light]}) Future<List<NotificationPermission>>
Checks which notification permissions have been granted to the app.
inherited
createNotification({required NotificationContent content, NotificationSchedule? schedule, List<NotificationActionButton>? actionButtons, Map<String, NotificationLocalization>? localizations}) Future<bool>
LOCAL NOTIFICATION METHODS ********************************************* Creates a new notification with the specified content.
inherited
createNotificationFromJsonData(Map<String, dynamic> mapData) Future<bool>
Creates a new notification based on a map that is similar to the map produced by the toMap() method of a NotificationModel object.
inherited
decrementGlobalBadgeCounter() Future<int>
Decrements the global badge counter by 1.
inherited
dismiss(int id) Future<void>
Dismisses a single notification without canceling its respective schedule.
inherited
dismissAllNotifications() Future<void>
Dismisses all active notifications without cancelling their respective schedules. Note that dismissing a notification does not remove it from the notification history.
inherited
dismissNotificationsByChannelKey(String channelKey) Future<void>
Dismisses all active notifications with the specified channelKey, without cancelling their respective schedules.
inherited
dismissNotificationsByGroupKey(String groupKey) Future<void>
Dismisses all active notifications with the specified groupKey, without cancelling their respective schedules.
inherited
dispose() → dynamic
DISPOSE METHODS *********************************************
inherited
getAllActiveNotificationIdsOnStatusBar() Future<List<int>>
inherited
getAppLifeCycle() Future<NotificationLifeCycle>
Returns the current state of the app lifecycle in regards to notifications.
inherited
getDrawableData(String drawablePath) Future<Uint8List?>
NATIVE MEDIA METHODS ********************************************* Decodes a native drawable resource into a Uint8List that can be used by Flutter widgets.
inherited
getGlobalBadgeCounter() Future<int>
Gets the global badge counter, which represents the number of unread notifications that are currently pending for the app.
inherited
getInitialNotificationAction({bool removeFromActionEvents = false}) Future<ReceivedAction?>
Gets the notification action that launched the app, if any.
inherited
getLocalization() Future<String>
Gets the current localization code used by the plugin for notification content.
inherited
getLocalTimeZoneIdentifier() Future<String>
Returns the identifier for the device's local time zone.
inherited
getNextDate(NotificationSchedule schedule, {DateTime? fixedDate}) Future<DateTime?>
Gets the next valid date for a notification schedule. The schedule parameter is a valid NotificationSchedule model that specifies the notification schedule. The optional fixedDate parameter is a DateTime value that represents the reference date to simulate a schedule in a different time. If this parameter is omitted, the reference date will be set to the current date and time.
inherited
getUtcTimeZoneIdentifier() Future<String>
Returns the identifier for the UTC time zone.
inherited
incrementGlobalBadgeCounter() Future<int>
Increments the badge counter by 1 and returns the new value. If there is no current value for the badge counter, it will be set to 1. This method is the most performant way to increment the badge counter by a single unit.
inherited
initialize(String? defaultIcon, List<NotificationChannel> channels, {List<NotificationChannelGroup>? channelGroups, bool debug = false, String? languageCode}) Future<bool>
Initializes the plugin by creating a default icon and setting up the initial notification channels. This method only needs to be called once in the main.dart file of your application.
inherited
isNotificationActiveOnStatusBar({required int id}) Future<bool>
Checks whether a notification with the specified ID is currently active on the device's status bar.
inherited
isNotificationAllowed() Future<bool>
Checks whether notifications are currently allowed globally on the device.
inherited
listScheduledNotifications() Future<List<NotificationModel>>
Lists all active scheduled notifications.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeChannel(String channelKey) Future<bool>
Removes a notification channel with the specified channelKey.
inherited
requestPermissionToSendNotifications({String? channelKey, List<NotificationPermission> permissions = const [NotificationPermission.Alert, NotificationPermission.Sound, NotificationPermission.Badge, NotificationPermission.Vibration, NotificationPermission.Light]}) Future<bool>
Requests permission from the user to send notifications from the app.
inherited
resetGlobalBadge() Future<void>
Resets the global badge counter to zero. This removes any badge icon from the app icon in the launcher. Note that resetting the badge counter does not cancel any scheduled or active notifications.
inherited
setChannel(NotificationChannel notificationChannel, {bool forceUpdate = false}) Future<void>
Sets a new notification channel or updates an existing channel.
inherited
setGlobalBadgeCounter(int amount) Future<void>
Sets the global badge counter to the specified value. This value will be displayed on the app's icon badge (if supported by the device). If the amount is 0, the badge counter will be cleared.
inherited
setListeners({required ActionHandler onActionReceivedMethod, NotificationHandler? onNotificationCreatedMethod, NotificationHandler? onNotificationDisplayedMethod, ActionHandler? onDismissActionReceivedMethod}) Future<bool>
Defines the global or static methods that will receive notification events. Only after set at least one method, the notification's events will be delivered. These methods require to use the notation @pragma("vm:entry-point")
inherited
setLocalization({required String? languageCode}) Future<bool>
The setLocalization method is used to set the desired localization for notifications. It takes a required languageCode parameter, which is an optional, case-insensitive String that represents the language code for the desired localization (e.g. "en" for English, "pt-br" for Brazilian Portuguese, "es" for Spanish, etc.). If the languageCode parameter is null or not provided, the default localization will be loaded from the device system.
inherited
shouldShowRationaleToRequest({String? channelKey, List<NotificationPermission> permissions = const [NotificationPermission.Badge, NotificationPermission.Alert, NotificationPermission.Sound, NotificationPermission.Vibration, NotificationPermission.Light]}) Future<List<NotificationPermission>>
Checks whether the app should show a rationale to the user before requesting notification permissions.
inherited
showAlarmPage() Future<void>
Opens the system's notifications settings page for the app's alarms.
inherited
showGlobalDndOverridePage() Future<void>
Opens the system settings page for overriding device Do Not Disturb mode.
inherited
showNotificationConfigPage({String? channelKey}) Future<void>
Opens the notification configuration page for the app.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance AwesomeNotificationsPlatform
The default instance of AwesomeNotificationsPlatform to use.
getter/setter pair
operatingSystem String
getter/setter pair

Static Methods

resetInstance() → void