restoreState method

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebView.restoreState', apiUrl: 'https://developer.android.com/reference/android/webkit/WebView#restoreState(android.os.Bundle)', note: 'This method doesn\'t restore 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<bool> restoreState(
  1. Uint8List state
)

Restores the state of this WebView from the given state returned by the saveState method. If it is called after this WebView has had a chance to build state (load pages, create a back/forward list, etc.), there may be undesirable side-effects.

Returns true if the state was restored successfully, otherwise false.

Officially Supported Platforms/Implementations:

Parameters - Officially Supported Platforms/Implementations:

  • state: all platforms

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

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(
      apiName: 'WebView.restoreState',
      apiUrl:
          'https://developer.android.com/reference/android/webkit/WebView#restoreState(android.os.Bundle)',
      note: 'This method doesn\'t restore 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<bool> restoreState(Uint8List state) {
  throw UnimplementedError(
    '${PlatformInAppWebViewControllerMethod.restoreState.name} is not implemented on the current platform',
  );
}