setCacheMode static method

Future<void> setCacheMode(
  1. AndroidCacheMode mode
)

Overrides the way the cache is used. This method should only be called if AndroidWebViewFeature.isFeatureSupported returns true for AndroidWebViewFeature.SERVICE_WORKER_CACHE_MODE.

NOTE: available on Android 24+.

Official Android API: https://developer.android.com/reference/androidx/webkit/ServiceWorkerWebSettingsCompat#setCacheMode(int)

Implementation

static Future<void> setCacheMode(AndroidCacheMode mode) async {
  await ServiceWorkerController.setCacheMode(
      CacheMode.fromNativeValue(mode.toNativeValue())!);
}