JsNotificationsPlatform class abstract

Inheritance
  • Object
  • PlatformInterface
  • JsNotificationsPlatform
Implementers

Constructors

JsNotificationsPlatform.new()
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
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
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?>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
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, int? 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, VibratePattern? 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