goBackOrForward method
- @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebView.goBackOrForward', apiUrl: 'https://developer.android.com/reference/android/webkit/WebView#goBackOrForward(int)'), IOSPlatform(apiName: 'WKWebView.go', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/1414991-go'), MacOSPlatform(apiName: 'WKWebView.go', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/1414991-go'), WebPlatform(apiName: 'History.go', apiUrl: 'https://developer.mozilla.org/en-US/docs/Web/API/History/go'), WindowsPlatform(), LinuxPlatform()])
- required int steps,
Goes to the history item that is the number of steps away from the current item. Steps is negative if backward and positive if forward.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebView.goBackOrForward)
- iOS WKWebView (Official API - WKWebView.go)
- macOS WKWebView (Official API - WKWebView.go)
- Web <iframe> but requires same origin (Official API - History.go)
- Windows WebView2
- Linux WPE WebKit
Parameters - Officially Supported Platforms/Implementations:
steps: all platforms
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(
apiName: 'WebView.goBackOrForward',
apiUrl:
'https://developer.android.com/reference/android/webkit/WebView#goBackOrForward(int)',
),
IOSPlatform(
apiName: 'WKWebView.go',
apiUrl:
'https://developer.apple.com/documentation/webkit/wkwebview/1414991-go',
),
MacOSPlatform(
apiName: 'WKWebView.go',
apiUrl:
'https://developer.apple.com/documentation/webkit/wkwebview/1414991-go',
),
WebPlatform(
apiName: 'History.go',
apiUrl: 'https://developer.mozilla.org/en-US/docs/Web/API/History/go',
),
WindowsPlatform(),
LinuxPlatform(),
],
)
Future<void> goBackOrForward({required int steps}) {
throw UnimplementedError(
'${PlatformInAppWebViewControllerMethod.goBackOrForward.name} is not implemented on the current platform',
);
}