JsNotificationsPlatform class abstract

Inheritance
  • Object
  • PlatformInterface
  • JsNotificationsPlatform
Implementers

Constructors

JsNotificationsPlatform()
Constructs a JsNotificationsPlatform.

Properties

actionStream → Stream<NotificationActionResult>
Stream broadcasting notification click events with associated data & action
no setter
dismissStream → Stream<NotificationActionResult>
Stream broadcasting notification close events with associated data
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasPermissions → bool
Convenience method checking browser notification support, wrapper for Dart's native JS notification Notification.permission
no setter
isInitialized → bool
Whether the service worker is registered and ready. See initialize.
no setter
isSupported → bool
Convenience method checking browser notification support, wrapper for dart's native JS notification Notification.supported
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scopeUrl ← String
Updates the scope the plugin's service worker is registered under by re-registering the currently registered worker script (bundled or custom) with value as its scope. Fire-and-forget — prefer registerServiceWorker to await completion, register a custom worker script, or both.
no getter
tapStream → Stream<NotificationActionResult>
Stream broadcasting notification tap events with associated data
no setter

Methods

addNotification(JSNotification notification) → Future<void>
Send notification with interop.JSNotification to service worker
clearNotifications() → Future<void>
Clear all notifications
dismissNotification({required String id}) → Future<void>
Dismiss notification with ID
dispose() → Future<void>
getAllNotifications() → Future<List<JSNotification>>
Get all notifications
getNotification(String tag) → Future<JSNotification?>
Get notification by tag
getNotificationTags() → Future<List<String>>
Get all notification tags
getPlatformVersion() → Future<String?>
initialize() → Future<bool>
Completes when the plugin's service worker has been registered and its event listeners attached.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerServiceWorker({String? url, String? scope}) → Future<void>
Re-registers the plugin's service worker with a custom url and/or scope, replacing the automatically registered bundled worker.
requestPermissions() → Future<bool>
Convenience method checking browser notification support, wrapper for Dart's native JS notification Notification.requestPermission(). Returns true if response matches 'granted'.
sendAction(Map<String, dynamic> data, {String? id}) → Future<void>
Send action to service worker
showNotification(String title, {List<JSNotificationAction>? actions, String? badge, String? body, Map<String, dynamic>? data, JSNotificationDirection? dir, String? icon, String? image, String? lang, bool? renotify, bool? requireInteraction, bool? silent, String? tag, int? timestamp, List<int>? vibrate}) → Future<void>
Send notification with customizable parameters to service worker
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

instance ↔ JsNotificationsPlatform
The default instance of JsNotificationsPlatform to use.
getter/setter pair