LocalNotificationsPlatform class
abstract
Inheritance
Object
PlatformInterface
LocalNotificationsPlatform
Implemented types
Implementers
Properties
hashCode
→ int
The hash code for this object.
no setter inherited
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
Methods
cancel (int id )
→ Future <void >
Cancel a single notification and its respective schedule
inherited
cancelAll ()
→ Future <void >
Cancel and dismiss all notifications and the active schedules
inherited
cancelAllSchedules ()
→ Future <void >
Cancel all active notification schedules without dismiss the respective notifications
inherited
cancelNotificationsByChannelKey (String channelKey )
→ Future <void >
Cancel and dismiss all notifications and schedules with the same channel key
inherited
cancelNotificationsByGroupKey (String groupKey )
→ Future <void >
Cancel and dismiss all notifications and schedules with the same group key
inherited
cancelSchedule (int id )
→ Future <void >
Cancel a single scheduled notification, without dismiss the active notification
inherited
cancelSchedulesByChannelKey (String channelKey )
→ Future <void >
Cancel all active schedules with the same channel key,
without dismiss the respective notifications on status bar
inherited
cancelSchedulesByGroupKey (String groupKey )
→ Future <void >
Cancel all active schedules with the same group key,
without dismiss the respective notifications on status bar
inherited
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
inherited
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
inherited
createNotificationFromJsonData (Map <String , dynamic > mapData )
→ Future <bool >
Creates a new notification based on a map similar to the map produced by
toMap method
inherited
decrementGlobalBadgeCounter ()
→ Future <int >
Decrement the badge counter
inherited
dismiss (int id )
→ Future <void >
Dismiss a single notification, without cancel its schedule
inherited
dismissAllNotifications ()
→ Future <void >
Dismiss all active notifications, without cancel the active respective schedules
inherited
dismissNotificationsByChannelKey (String channelKey )
→ Future <void >
Dismiss all active notifications with the same channel key on status bar,
without cancel the active respective schedules
inherited
dismissNotificationsByGroupKey (String groupKey )
→ Future <void >
Dismiss all active notifications with the same group key on status bar,
without cancel the active respective schedules
inherited
dispose ()
→ dynamic
DISPOSE METHODS *********************************************
inherited
getAppLifeCycle ()
→ Future <NotificationLifeCycle >
Get the current Local time zone identifier
inherited
getDrawableData (String drawablePath )
→ Future <Uint8List ? >
NATIVE MEDIA METHODS *********************************************
Decode a native drawable resource into a Uint8List to be used by Flutter widgets
inherited
getGlobalBadgeCounter ()
→ Future <int >
Get badge counter
inherited
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
inherited
getLocalTimeZoneIdentifier ()
→ Future <String >
Get the current Local time zone identifier
inherited
getNextDate (NotificationSchedule schedule , {DateTime ? fixedDate })
→ Future <DateTime ? >
Get the next valid date for a notification schedule
inherited
getUtcTimeZoneIdentifier ()
→ Future <String >
Get the current UTC time zone identifier
inherited
incrementGlobalBadgeCounter ()
→ Future <int >
Increment the badge counter
inherited
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
inherited
isNotificationAllowed ()
→ Future <bool >
Check if the notifications are globally permitted
inherited
listScheduledNotifications ()
→ Future <List <NotificationModel > >
List all active scheduled notifications.
inherited
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeChannel (String channelKey )
→ Future <bool >
Remove a notification channel
inherited
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
inherited
resetGlobalBadge ()
→ Future <void >
Resets the badge counter
inherited
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.
inherited
setGlobalBadgeCounter (int ? amount )
→ Future <void >
Set the badge counter to any value
inherited
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.
inherited
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.
inherited
showAlarmPage ()
→ Future <void >
Opens the app notifications page
inherited
showGlobalDndOverridePage ()
→ Future <void >
Opens the app page to allows to override device DnD
inherited
showNotificationConfigPage ({String ? channelKey })
→ Future <void >
Opens the app notifications page
inherited
toString ()
→ String
A string representation of this object.
inherited
local_push_notifications 0.0.2