OS-notification primitive. Domain-agnostic — the caller decides when
to emit and how to format the payload. Backed natively on macOS
(UNUserNotificationCenter), Android (NotificationManagerCompat) and
Windows (toasts under the process's AppUserModelID); see the platform
NotificationsPlugin. No handler on iOS, where calls no-op. Window-focus
state lives in XWindow, not here.
- Implementers
Properties
-
null= OS hasn't been asked;true/falseafter the user has answered an authorization prompt.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
-
onTap
→ Stream<
Map< String, String> > -
Tap events. Payload is the
dataMap supplied to show.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancelAll(
) → Future< void> - Withdraws every notification this app has posted.
-
cancelByThread(
String threadId) → Future< void> -
Withdraws every posted notification sharing
threadId. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
requestPermission(
) → Future< bool> - Prompts for notification authorization and reports whether it was granted.
-
show(
XNotification n) → Future< void> - Posts (or replaces) a system notification. Same XNotification.id replaces any prior notification with that id. XNotification.threadId groups multiple notifications in the OS's notification UI.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → XNotifications
-
Production singleton — talks to the native plugin via MethodChannel
final