saveState method

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebView.saveState', apiUrl: 'https://developer.android.com/reference/android/webkit/WebView#saveState(android.os.Bundle)', note: 'This method doesn\'t store the display data for this WebView.'), IOSPlatform(apiName: 'WKWebView.interactionState', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/3752236-interactionstate', available: '15.0'), MacOSPlatform(apiName: 'WKWebView.interactionState', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/3752236-interactionstate', available: '12.0'), LinuxPlatform()])
Future<Uint8List?> saveState()

Returns the current state of interaction in a web view so that you can restore that state later to another web view using the restoreState method.

Officially Supported Platforms/Implementations:

Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(
      apiName: 'WebView.saveState',
      apiUrl:
          'https://developer.android.com/reference/android/webkit/WebView#saveState(android.os.Bundle)',
      note: 'This method doesn\'t store the display data for this WebView.',
    ),
    IOSPlatform(
      apiName: 'WKWebView.interactionState',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wkwebview/3752236-interactionstate',
      available: '15.0',
    ),
    MacOSPlatform(
      apiName: 'WKWebView.interactionState',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wkwebview/3752236-interactionstate',
      available: '12.0',
    ),
    LinuxPlatform(),
  ],
)
Future<Uint8List?> saveState() {
  throw UnimplementedError(
    '${PlatformInAppWebViewControllerMethod.saveState.name} is not implemented on the current platform',
  );
}