restoreState method
- @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()])
- 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:
- Android WebView (Official API - WebView.restoreState):
- This method doesn't restore the display data for this WebView.
- iOS WKWebView 15.0+ (Official API - WKWebView.interactionState)
- macOS WKWebView 12.0+ (Official API - WKWebView.interactionState)
- Linux WPE WebKit
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',
);
}