getZoomScale method
- @SupportedPlatforms.new(platforms: [AndroidPlatform(), IOSPlatform(apiName: 'UIScrollView.zoomScale', apiUrl: 'https://developer.apple.com/documentation/uikit/uiscrollview/1619419-zoomscale'), LinuxPlatform(apiName: 'webkit_web_view_get_zoom_level', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/method.WebView.get_zoom_level.html'), WindowsPlatform(apiName: 'ICoreWebView2Controller.get_ZoomFactor', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2controller?view=webview2-1.0.2849.39#get_zoomfactor')])
Gets the current zoom scale of the WebView.
Officially Supported Platforms/Implementations:
- Android WebView
- iOS WKWebView (Official API - UIScrollView.zoomScale)
- Linux WPE WebKit (Official API - webkit_web_view_get_zoom_level)
- Windows WebView2 (Official API - ICoreWebView2Controller.get_ZoomFactor)
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(),
IOSPlatform(
apiName: 'UIScrollView.zoomScale',
apiUrl:
'https://developer.apple.com/documentation/uikit/uiscrollview/1619419-zoomscale',
),
LinuxPlatform(
apiName: 'webkit_web_view_get_zoom_level',
apiUrl:
'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/method.WebView.get_zoom_level.html',
),
WindowsPlatform(
apiName: 'ICoreWebView2Controller.get_ZoomFactor',
apiUrl:
'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2controller?view=webview2-1.0.2849.39#get_zoomfactor',
),
],
)
Future<double?> getZoomScale() {
throw UnimplementedError(
'${PlatformInAppWebViewControllerMethod.getZoomScale.name} is not implemented on the current platform',
);
}