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