ILocalNotifications class abstract

Implementers

Constructors

ILocalNotifications()

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>
Cancel a single notification and its respective schedule
cancelAll() Future<void>
Cancel and dismiss all notifications and the active schedules
cancelAllSchedules() Future<void>
Cancel all active notification schedules without dismiss the respective notifications
cancelNotificationsByChannelKey(String channelKey) Future<void>
Cancel and dismiss all notifications and schedules with the same channel key
cancelNotificationsByGroupKey(String groupKey) Future<void>
Cancel and dismiss all notifications and schedules with the same group key
cancelSchedule(int id) Future<void>
Cancel a single scheduled notification, without dismiss the active notification
cancelSchedulesByChannelKey(String channelKey) Future<void>
Cancel all active schedules with the same channel key, without dismiss the respective notifications on status bar
cancelSchedulesByGroupKey(String groupKey) Future<void>
Cancel all active schedules with the same group key, without dismiss the respective notifications on status bar
checkPermissionList({String? channelKey, List<NotificationPermission> permissions = const [NotificationPermission.Badge, NotificationPermission.Alert, NotificationPermission.Sound, NotificationPermission.Vibration, NotificationPermission.Light]}) Future<List<NotificationPermission>>
Check each individual permission to send notifications and returns only the allowed permissions
createNotification({required NotificationContent content, NotificationSchedule? schedule, List<NotificationActionButton>? actionButtons}) Future<bool>
LOCAL NOTIFICATION METHODS ********************************************* Creates a new notification. If notification has no body or title, it will only be created, but never displayed. (background notification) schedule and actionButtons are optional
createNotificationFromJsonData(Map<String, dynamic> mapData) Future<bool>
Creates a new notification based on a map similar to the map produced by toMap method
decrementGlobalBadgeCounter() Future<int>
Decrement the badge counter
dismiss(int id) Future<void>
Dismiss a single notification, without cancel its schedule
dismissAllNotifications() Future<void>
Dismiss all active notifications, without cancel the active respective schedules
dismissNotificationsByChannelKey(String channelKey) Future<void>
Dismiss all active notifications with the same channel key on status bar, without cancel the active respective schedules
dismissNotificationsByGroupKey(String groupKey) Future<void>
Dismiss all active notifications with the same group key on status bar, without cancel the active respective schedules
dispose() → dynamic
DISPOSE METHODS *********************************************
getAppLifeCycle() Future<NotificationLifeCycle>
Get the current Local time zone identifier
getDrawableData(String drawablePath) Future<Uint8List?>
NATIVE MEDIA METHODS ********************************************* Decode a native drawable resource into a Uint8List to be used by Flutter widgets
getGlobalBadgeCounter() Future<int>
Get badge counter
getInitialNotificationAction({bool removeFromActionEvents = false}) Future<ReceivedAction?>
Gets the notification action that launched the app. If the app wasn't launched by a notification, so it returns null. This method does not depend on setListeners being called first. removeFromActionEvents when set to true, prevents the same action from being delivered in the method onActionMethod, in case it hasn't already happened
getLocalTimeZoneIdentifier() Future<String>
Get the current Local time zone identifier
getNextDate(NotificationSchedule schedule, {DateTime? fixedDate}) Future<DateTime?>
Get the next valid date for a notification schedule
getUtcTimeZoneIdentifier() Future<String>
Get the current UTC time zone identifier
incrementGlobalBadgeCounter() Future<int>
Increment the badge counter
initialize(String? defaultIcon, List<NotificationChannel> channels, {List<NotificationChannelGroup>? channelGroups, bool debug = false}) Future<bool>
INITIALIZING METHODS ********************************************* Initializes the plugin, creating a default icon and the initial channels. Only needs to be called at main.dart once. OBS: defaultIcon needs to be a Resource media type OBS 2: channels are updated if they already exists
isNotificationAllowed() Future<bool>
Check if the notifications are globally permitted
listScheduledNotifications() Future<List<NotificationModel>>
List all active scheduled notifications.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeChannel(String channelKey) Future<bool>
Remove a notification channel
requestPermissionToSendNotifications({String? channelKey, List<NotificationPermission> permissions = const [NotificationPermission.Alert, NotificationPermission.Sound, NotificationPermission.Badge, NotificationPermission.Vibration, NotificationPermission.Light]}) Future<bool>
Prompts the user to enabled notifications
resetGlobalBadge() Future<void>
Resets the badge counter
setChannel(NotificationChannel notificationChannel, {bool forceUpdate = false}) Future<void>
Set a new notification channel or updates if already exists forceUpdate: completely updates the channel on Android Oreo and above, but cancels all current notifications.
setGlobalBadgeCounter(int? amount) Future<void>
Set the badge counter to any value
setListeners({required ActionHandler onActionReceivedMethod, NotificationHandler? onNotificationCreatedMethod, NotificationHandler? onNotificationDisplayedMethod, ActionHandler? onDismissActionReceivedMethod}) Future<bool>
Defines the global or static methods that gonna receive the notification events. OBS: Only after set at least one method, the notification's events are delivered.
shouldShowRationaleToRequest({String? channelKey, List<NotificationPermission> permissions = const [NotificationPermission.Badge, NotificationPermission.Alert, NotificationPermission.Sound, NotificationPermission.Vibration, NotificationPermission.Light]}) Future<List<NotificationPermission>>
Check if the app must show some rationale before request the user's consent. Returns the list of permissions that can only be changed via user's intervention.
showAlarmPage() Future<void>
Opens the app notifications page
showGlobalDndOverridePage() Future<void>
Opens the app page to allows to override device DnD
showNotificationConfigPage({String? channelKey}) Future<void>
Opens the app notifications page
toString() String
A string representation of this object.
inherited

Operators

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