NotificationServiceFull class
Full-featured notification service with channels, scheduling, grouping, history export, and native platform support.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
notificationStream
→ Stream<
AppNotification> -
Live stream of incoming notifications.
no setter
- preferences → NotificationPreferences
-
Current preferences.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancelScheduled(
String id) → void - Cancels a previously scheduled notification.
-
createChannel(
NotificationChannel channel) → void - Creates or replaces a notification channel.
-
dismiss(
String id) → void - Dismisses a notification by id.
-
dismissAll(
) → void - Dismisses all notifications.
-
dispose(
) → void - Cancels all timers and closes the stream.
-
exportHistory(
{DateTime? since, String format = 'json'}) → String - Exports notification history as JSON or CSV.
-
getNotifications(
{bool unreadOnly = false, NotificationType? type, DateTime? since}) → List< AppNotification> - Returns notifications filtered by the given criteria.
-
getUnreadCount(
) → int - Returns the count of unread, non-dismissed notifications.
-
groupNotifications(
List< AppNotification> notifications) → Map<String, List< AppNotification> > - Groups a list of notifications by their AppNotification.groupKey. Notifications without a groupKey are placed under the empty string key.
-
markAllRead(
) → void - Marks all notifications as read.
-
markRead(
String id) → void - Marks a notification as read.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
scheduleNotification(
AppNotification notification, DateTime scheduledFor) → void - Schedules a notification for future delivery.
-
sendNative(
String title, String body) → Future< void> - Sends a native OS notification.
-
show(
AppNotification notification) → Future< void> - Displays a notification. Respects DND and channel preferences.
-
showPermissionRequest(
String tool, String input) → Future< void> - Shows a permission request notification for a tool invocation.
-
showProgress(
String title, double progress, {double? total}) → Future< void> - Shows or updates a progress notification.
-
showQuick(
String title, {String? body, NotificationType type = NotificationType.info}) → Future< void> - Convenience method — creates and shows a simple notification.
-
toString(
) → String -
A string representation of this object.
inherited
-
updatePreferences(
NotificationPreferences prefs) → void - Replaces the current notification preferences.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited