saveState method
- @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()])
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:
- Android WebView (Official API - WebView.saveState):
- This method doesn't store 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
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',
);
}