AndroidServiceWorkerController class

Class that represents an Android-specific class that manages Service Workers used by WebView.

NOTE: available on Android 24+.

Official Android API: https://developer.android.com/reference/androidx/webkit/ServiceWorkerControllerCompat

Use ServiceWorkerController instead.

Annotations
  • @Deprecated("Use ServiceWorkerController instead")

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serviceWorkerClient AndroidServiceWorkerClient?
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setServiceWorkerClient(AndroidServiceWorkerClient? value) → dynamic
Sets the service worker client
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

getAllowContentAccess() Future<bool>
Gets whether Service Workers support content URL access. This method should only be called if AndroidWebViewFeature.isFeatureSupported returns true for AndroidWebViewFeature.SERVICE_WORKER_CONTENT_ACCESS.
getAllowFileAccess() Future<bool>
Gets whether Service Workers support file access. This method should only be called if AndroidWebViewFeature.isFeatureSupported returns true for AndroidWebViewFeature.SERVICE_WORKER_FILE_ACCESS.
getBlockNetworkLoads() Future<bool>
Gets whether Service Workers are prohibited from loading any resources from the network. This method should only be called if AndroidWebViewFeature.isFeatureSupported returns true for AndroidWebViewFeature.SERVICE_WORKER_BLOCK_NETWORK_LOADS.
getCacheMode() Future<AndroidCacheMode?>
Gets the current setting for overriding the cache mode. This method should only be called if AndroidWebViewFeature.isFeatureSupported returns true for AndroidWebViewFeature.SERVICE_WORKER_CACHE_MODE.
instance() AndroidServiceWorkerController
Gets the AndroidServiceWorkerController shared instance.
setAllowContentAccess(bool allow) Future<void>
Enables or disables content URL access from Service Workers. This method should only be called if AndroidWebViewFeature.isFeatureSupported returns true for AndroidWebViewFeature.SERVICE_WORKER_CONTENT_ACCESS.
setAllowFileAccess(bool allow) Future<void>
Enables or disables file access within Service Workers. This method should only be called if AndroidWebViewFeature.isFeatureSupported returns true for AndroidWebViewFeature.SERVICE_WORKER_FILE_ACCESS.
setBlockNetworkLoads(bool flag) Future<void>
Sets whether Service Workers should not load resources from the network. This method should only be called if AndroidWebViewFeature.isFeatureSupported returns true for AndroidWebViewFeature.SERVICE_WORKER_BLOCK_NETWORK_LOADS.
setCacheMode(AndroidCacheMode mode) Future<void>
Overrides the way the cache is used. This method should only be called if AndroidWebViewFeature.isFeatureSupported returns true for AndroidWebViewFeature.SERVICE_WORKER_CACHE_MODE.