ServiceWorkerRegistration class

Represents a service worker registration.

Implemented types

Properties

active ServiceWorker?
Returns a service worker whose state is either activating or activated. This is initially set to null. An active worker will control a ServiceWorkerClient if the client's URL falls within the scope of the registration (the scope option set when ServiceWorkerContainer.register is first called).
no setter
hashCode int
The hash code for this object.
no setterinherited
installing ServiceWorker?
Returns a service worker whose state is installing. This is initially set to null.
no setter
jsObject → dynamic
The raw JS object reference.
no setter
on Events
This is an ease-of-use accessor for event streams which should only be used when an explicit accessor is not available.
no setteroverride
onUpdateFound Stream
An EventListener property called whenever an event of type updatefound is fired; it is fired any time the ServiceWorkerRegistration.installing property acquires a new service worker.
no setter
pushManager PushManager
Returns an interface to for managing push subscriptions, including subscribing, getting an active subscription, and accessing push permission status.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scope → dynamic
Returns a unique identifier for a service worker registration. This must be on the same origin as the document that registers the ServiceWorker.
no setter
waiting ServiceWorker?
Returns a service worker whose state is installed. This is initially set to null.
no setter

Methods

addEventListener(String type, EventListener? listener, [bool? useCapture]) → void
override
dispatchEvent(Event event) bool
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeEventListener(String type, EventListener? listener, [bool? useCapture]) → void
override
showNotification(String title, [ShowNotificationOptions? options]) Future<NotificationEvent>
Creates a notification on an active service worker.
toString() String
A string representation of this object.
inherited
unregister() Future<bool>
Unregisters the service worker registration and returns a promise (see Promise). The service worker will finish any ongoing operations before it is unregistered.
update() Future<ServiceWorkerRegistration>
Allows you to update a service worker.

Operators

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