goBack method
- @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebView.goBack', apiUrl: 'https://developer.android.com/reference/android/webkit/WebView#goBack()'), IOSPlatform(apiName: 'WKWebView.goBack', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/1414952-goback'), MacOSPlatform(apiName: 'WKWebView.goBack', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/1414952-goback'), WebPlatform(apiName: 'History.back', apiUrl: 'https://developer.mozilla.org/en-US/docs/Web/API/History/back'), WindowsPlatform(apiName: 'ICoreWebView2.GoBack', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.2210.55#goback'), LinuxPlatform(apiName: 'webkit_web_view_go_back', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/method.WebView.go_back.html')])
Goes back in the history of the WebView.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebView.goBack)
- iOS WKWebView (Official API - WKWebView.goBack)
- macOS WKWebView (Official API - WKWebView.goBack)
- Web <iframe> but requires same origin (Official API - History.back)
- Windows WebView2 (Official API - ICoreWebView2.GoBack)
- Linux WPE WebKit (Official API - webkit_web_view_go_back)
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(
apiName: 'WebView.goBack',
apiUrl:
'https://developer.android.com/reference/android/webkit/WebView#goBack()',
),
IOSPlatform(
apiName: 'WKWebView.goBack',
apiUrl:
'https://developer.apple.com/documentation/webkit/wkwebview/1414952-goback',
),
MacOSPlatform(
apiName: 'WKWebView.goBack',
apiUrl:
'https://developer.apple.com/documentation/webkit/wkwebview/1414952-goback',
),
WebPlatform(
apiName: 'History.back',
apiUrl: 'https://developer.mozilla.org/en-US/docs/Web/API/History/back',
),
WindowsPlatform(
apiName: 'ICoreWebView2.GoBack',
apiUrl:
'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.2210.55#goback',
),
LinuxPlatform(
apiName: 'webkit_web_view_go_back',
apiUrl:
'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/method.WebView.go_back.html',
),
],
)
Future<void> goBack() {
throw UnimplementedError(
'${PlatformInAppWebViewControllerMethod.goBack.name} is not implemented on the current platform',
);
}