onZoomScaleChanged property
- @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebViewClient.onScaleChanged', apiUrl: 'https://developer.android.com/reference/android/webkit/WebViewClient#onScaleChanged(android.webkit.WebView,%20float,%20float)'), IOSPlatform(apiName: 'UIScrollViewDelegate.scrollViewDidZoom', apiUrl: 'https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619409-scrollviewdidzoom'), WebPlatform(), WindowsPlatform(apiName: 'ICoreWebView2Controller.add_ZoomFactorChanged', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2controller?view=webview2-1.0.2849.39#add_zoomfactorchanged'), LinuxPlatform(apiName: 'WebKitWebView::notify::zoom-level', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/property.WebView.zoom-level.html')])
final
Event fired when the zoom scale of the WebView has changed.
oldScale The old zoom scale factor.
newScale The new zoom scale factor.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebViewClient.onScaleChanged)
- iOS WKWebView (Official API - UIScrollViewDelegate.scrollViewDidZoom)
- Web <iframe> but requires same origin
- Windows WebView2 (Official API - ICoreWebView2Controller.add_ZoomFactorChanged)
- Linux WPE WebKit (Official API - WebKitWebView::notify::zoom-level)
Parameters - Officially Supported Platforms/Implementations:
oldScale: all platformsnewScale: all platforms
Use the PlatformWebViewCreationParams.isPropertySupported method to check if this property is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(
apiName: 'WebViewClient.onScaleChanged',
apiUrl:
'https://developer.android.com/reference/android/webkit/WebViewClient#onScaleChanged(android.webkit.WebView,%20float,%20float)',
),
IOSPlatform(
apiName: 'UIScrollViewDelegate.scrollViewDidZoom',
apiUrl:
'https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619409-scrollviewdidzoom',
),
WebPlatform(),
WindowsPlatform(
apiName: 'ICoreWebView2Controller.add_ZoomFactorChanged',
apiUrl:
'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2controller?view=webview2-1.0.2849.39#add_zoomfactorchanged',
),
LinuxPlatform(
apiName: 'WebKitWebView::notify::zoom-level',
apiUrl:
'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/property.WebView.zoom-level.html',
),
],
)
final void Function(T controller, double oldScale, double newScale)?
onZoomScaleChanged;