NotificationService class
A service class to handle local notifications using flutter_local_notifications
.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isInitialized → bool
-
Indicates whether the notification service has been initialized.
no setter
- notificationPlugin → dynamic
-
The instance of
FlutterLocalNotificationsPlugin
used for notification operations.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancellAllNotifications(
) → Future< void> - Cancels all scheduled and shown notifications.
-
cancelNotificationIfExists(
int id) → Future< void> -
Cancels a notification with the given
id
if it exists among the pending requests. -
changeNotificationDate(
int id, dynamic scheduledDate) → Future< void> -
Changes the schedule of a notification with the given
id
toscheduledDate
. -
initNotification(
) → Future< void> - Initializes the local notification plugin with platform-specific settings.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notificationDetails(
) → dynamic - Returns the default platform-specific notification details.
-
scheduleNotification(
{int id = 0, String? title, String? body, required dynamic scheduledDate}) → Future< void> -
Schedules a notification to be shown at the specified
scheduledDate
. -
showNotification(
{int id = 0, String? title, String? body}) → Future< void> -
Displays an immediate notification with the given
id
,title
, andbody
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited