canGoBack method
- @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebView.canGoBack', apiUrl: 'https://developer.android.com/reference/android/webkit/WebView#canGoBack()'), IOSPlatform(apiName: 'WKWebView.canGoBack', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/1414966-cangoback'), MacOSPlatform(apiName: 'WKWebView.canGoBack', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/1414966-cangoback'), WindowsPlatform(apiName: 'ICoreWebView2.get_CanGoBack', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.2210.55#get_cangoback'), LinuxPlatform(apiName: 'webkit_web_view_can_go_back', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/method.WebView.can_go_back.html')])
Returns a boolean value indicating whether the WebView can move backward.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebView.canGoBack)
- iOS WKWebView (Official API - WKWebView.canGoBack)
- macOS WKWebView (Official API - WKWebView.canGoBack)
- Windows WebView2 (Official API - ICoreWebView2.get_CanGoBack)
- Linux WPE WebKit (Official API - webkit_web_view_can_go_back)
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(
apiName: 'WebView.canGoBack',
apiUrl:
'https://developer.android.com/reference/android/webkit/WebView#canGoBack()',
),
IOSPlatform(
apiName: 'WKWebView.canGoBack',
apiUrl:
'https://developer.apple.com/documentation/webkit/wkwebview/1414966-cangoback',
),
MacOSPlatform(
apiName: 'WKWebView.canGoBack',
apiUrl:
'https://developer.apple.com/documentation/webkit/wkwebview/1414966-cangoback',
),
WindowsPlatform(
apiName: 'ICoreWebView2.get_CanGoBack',
apiUrl:
'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.2210.55#get_cangoback',
),
LinuxPlatform(
apiName: 'webkit_web_view_can_go_back',
apiUrl:
'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/method.WebView.can_go_back.html',
),
],
)
Future<bool> canGoBack() {
throw UnimplementedError(
'${PlatformInAppWebViewControllerMethod.canGoBack.name} is not implemented on the current platform',
);
}