NoOpNotificationManager
A NotificationManager that does nothing.
Use it, e.g. in tests, where no notifications should be shown. All methods return at once; the create and schedule methods return id 0.
- Implemented types
Constructors
NoOpNotificationManager
Properties
notificationTaps
The payloads of tapped notifications created with createNotification. Taps on task notifications are handled by the AppTaskController.
pendingNotificationRequestsCount
The number of pending notifications.
Note that on iOS there is a limit of 64 pending notifications. See https://pub.dev/packages/flutter_local_notifications#ios-pending-notifications-limit
Methods
cancelNotification
Cancels (i.e., removes) the notification with id.
cancelTaskNotification
Cancels (i.e., removes) the notification for the task.
configure
Configures and sets up the notification manager.
Also tries to get permission to send notifications.
createNotification
Creates an immediate notification with id, title, and body. If the id is not specified, a random id will be generated. When tapped, payload is emitted on notificationTaps.
Returns the id of the notification created.
createTaskNotification
Creates an immediate notification for a task.
scheduleNotification
Schedules a notification with id, title, and body at the schedule time. If the id is not specified, a random id will be generated.
Returns the id of the notification created.
scheduleRecurrentNotifications
- int? id,
- required String title,
- String? body,
- required RecurrentScheduledTrigger schedule,
Schedules recurrent notifications with id, title, and body at the schedule time.
Allows for daily, weekly, and monthly recurrence according to the schedule.
Note that RecurrentScheduledTrigger.separationCount and RecurrentScheduledTrigger.end are not used, i.e. days / weeks / months cannot be skipped in the schedule and the notifications keeps recurring indefinitely. If you want to stop a recurrent notification schedule, use the cancelNotification method.
If the id is not specified, a random id will be generated.
Returns the id of the notification created.
scheduleTaskNotification
Schedules a notification for a task at its UserTask.triggerTime.