IAwesomeNotifications class abstract

Implementers

Constructors

IAwesomeNotifications()

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.
cancelAll() Future<void>
Cancels all active notifications and schedules.
cancelAllSchedules() Future<void>
Cancels all active schedules, without dismissing the respective notifications.
cancelNotificationsByChannelKey(String channelKey) Future<void>
Cancels all active notifications and schedules with the specified channelKey.
cancelNotificationsByGroupKey(String groupKey) Future<void>
Cancels all active notifications and schedules with the specified groupKey.
cancelSchedule(int id) Future<void>
Cancels a single scheduled notification, without dismissing the active notification.
cancelSchedulesByChannelKey(String channelKey) Future<void>
Cancels all active schedules with the specified channelKey, without dismissing the respective notifications.
cancelSchedulesByGroupKey(String groupKey) Future<void>
Cancels all active schedules with the specified groupKey, without dismissing the respective notifications.
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.
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.
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.
decrementGlobalBadgeCounter() Future<int>
Decrements the global badge counter by 1.
dismiss(int id) Future<void>
Dismisses a single notification without canceling its respective schedule.
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.
dismissNotificationsByChannelKey(String channelKey) Future<void>
Dismisses all active notifications with the specified channelKey, without cancelling their respective schedules.
dismissNotificationsByGroupKey(String groupKey) Future<void>
Dismisses all active notifications with the specified groupKey, without cancelling their respective schedules.
dispose() → dynamic
DISPOSE METHODS *********************************************
getAllActiveNotificationIdsOnStatusBar() Future<List<int>>
getAppLifeCycle() Future<NotificationLifeCycle>
Returns the current state of the app lifecycle in regards to notifications.
getDrawableData(String drawablePath) Future<Uint8List?>
NATIVE MEDIA METHODS ********************************************* Decodes a native drawable resource into a Uint8List that can be used by Flutter widgets.
getGlobalBadgeCounter() Future<int>
Gets the global badge counter, which represents the number of unread notifications that are currently pending for the app.
getInitialNotificationAction({bool removeFromActionEvents = false}) Future<ReceivedAction?>
Gets the notification action that launched the app, if any.
getLocalization() Future<String>
Gets the current localization code used by the plugin for notification content.
getLocalTimeZoneIdentifier() Future<String>
Returns the identifier for the device's local time zone.
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.
getUtcTimeZoneIdentifier() Future<String>
Returns the identifier for the UTC time zone.
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.
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.
isNotificationActiveOnStatusBar({required int id}) Future<bool>
Checks whether a notification with the specified ID is currently active on the device's status bar.
isNotificationAllowed() Future<bool>
Checks whether notifications are currently allowed globally on the device.
listScheduledNotifications() Future<List<NotificationModel>>
Lists all active scheduled notifications.
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.
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.
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.
setChannel(NotificationChannel notificationChannel, {bool forceUpdate = false}) Future<void>
Sets a new notification channel or updates an existing channel.
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.
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")
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.
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.
showAlarmPage() Future<void>
Opens the system's notifications settings page for the app's alarms.
showGlobalDndOverridePage() Future<void>
Opens the system settings page for overriding device Do Not Disturb mode.
showNotificationConfigPage({String? channelKey}) Future<void>
Opens the notification configuration page for the app.
toString() String
A string representation of this object.
inherited

Operators

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