EasyNotifications class

The main class for handling notifications in the Easy Notifications plugin. Provides methods for initializing the plugin and managing notifications.

Constructors

EasyNotifications()

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

defaultIcon ↔ String?
getter/setter pair

Static Methods

areNotificationsEnabled() → Future<bool>
Checks if notifications are enabled for the application. Returns true if notifications are enabled, false otherwise.
askPermission() → Future<bool>
Asks the user for permission to display notifications. Returns true if permission was granted, false otherwise.
hide({int? id}) → Future<void>
Hides the notification with the specified ID.
init({String? defaultIcon = 'ic_launcher'}) → Future<void>
Initializes the Easy Notifications plugin. Must be called before using any other methods. Returns true if initialization was successful.
initialize({String? defaultNotificationIcon}) → Future<void>
Initialize Easy Notifications with optional default settings
openApp() → Future<void>
Opens the application.
registerWeb() → Future<bool>
Registers the application for web notifications. This method should be called only in web platform. Returns true if registration was successful.
scheduleMessage({required String title, required String body, required DateTime scheduledDate, String? imagePath, List<NotificationAction>? actions, String? icon, int? id}) → Future<void>
Schedules a notification to be shown at the specified date and time.
showMessage({required String title, required String body, String? message, String? imagePath, List<NotificationAction>? actions, String? icon, int? id}) → Future<void>
Shows a notification with the specified title and message id must be a 32-bit integer between -2,147,483,648 and 2,147,483,647
updateMessage({required String title, required String body, String? imagePath, List<NotificationAction>? actions, String? icon, int? id}) → Future<void>
Updates a notification with the specified title, body, and image.