goBackOrForward method

  1. @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()])
Future<void> goBackOrForward({
  1. 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:

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',
  );
}