onZoomScaleChanged property

  1. @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')])
void Function(T controller, double oldScale, double newScale)? onZoomScaleChanged
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:

Parameters - Officially Supported Platforms/Implementations:

  • oldScale: all platforms
  • newScale: 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;