PlatformServiceWorkerController class abstract
Class that manages Service Workers used by WebView
.
NOTE: available on Android 24+.
Officially Supported Platforms/Implementations:
- Android native WebView (Official API - ServiceWorkerControllerCompat)
- Inheritance
-
- Object
- PlatformInterface
- PlatformServiceWorkerController
Constructors
- PlatformServiceWorkerController(PlatformServiceWorkerControllerCreationParams params)
-
Creates a new PlatformServiceWorkerController
factory
- PlatformServiceWorkerController.implementation(PlatformServiceWorkerControllerCreationParams params)
- Used by the platform implementation to create a new PlatformServiceWorkerController.
- PlatformServiceWorkerController.static()
-
Creates a new PlatformServiceWorkerController
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- params → PlatformServiceWorkerControllerCreationParams
-
The parameters used to initialize the PlatformServiceWorkerController.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serviceWorkerClient → ServiceWorkerClient?
-
Service Worker client.
no setter
Methods
-
getAllowContentAccess(
) → Future< bool> -
Gets whether Service Workers support content URL access.
This method should only be called if WebViewFeature.isFeatureSupported returns
true
for WebViewFeature.SERVICE_WORKER_CONTENT_ACCESS. -
getAllowFileAccess(
) → Future< bool> -
Gets whether Service Workers support file access.
This method should only be called if WebViewFeature.isFeatureSupported returns
true
for WebViewFeature.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 WebViewFeature.isFeatureSupported returns
true
for WebViewFeature.SERVICE_WORKER_BLOCK_NETWORK_LOADS. -
getCacheMode(
) → Future< CacheMode?> -
Gets the current setting for overriding the cache mode.
This method should only be called if WebViewFeature.isFeatureSupported returns
true
for WebViewFeature.SERVICE_WORKER_CACHE_MODE. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setAllowContentAccess(
bool allow) → Future< void> -
Enables or disables content URL access from Service Workers.
This method should only be called if WebViewFeature.isFeatureSupported returns
true
for WebViewFeature.SERVICE_WORKER_CONTENT_ACCESS. -
setAllowFileAccess(
bool allow) → Future< void> -
Enables or disables file access within Service Workers.
This method should only be called if WebViewFeature.isFeatureSupported returns
true
for WebViewFeature.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 WebViewFeature.isFeatureSupported returns
true
for WebViewFeature.SERVICE_WORKER_BLOCK_NETWORK_LOADS. -
setCacheMode(
CacheMode mode) → Future< void> -
Overrides the way the cache is used.
This method should only be called if WebViewFeature.isFeatureSupported returns
true
for WebViewFeature.SERVICE_WORKER_CACHE_MODE. -
setServiceWorkerClient(
ServiceWorkerClient? value) → Future< void> - Sets the client to capture service worker related callbacks. A ServiceWorkerClient should be set before any service workers are active, e.g. a safe place is before any WebView instances are created or pages loaded.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited