onScrollChanged property
- @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebView.onScrollChanged', apiUrl: 'https://developer.android.com/reference/android/webkit/WebView#onScrollChanged(int,%20int,%20int,%20int)'), IOSPlatform(apiName: 'UIScrollViewDelegate.scrollViewDidScroll', apiUrl: 'https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619392-scrollviewdidscroll'), MacOSPlatform(note: 'This event is implemented using JavaScript.'), WebPlatform(apiName: 'Window.onscroll', apiUrl: 'https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onscroll'), LinuxPlatform(note: 'This event is implemented using JavaScript.')])
final
Event fired when the WebView scrolls.
x represents the current horizontal scroll origin in pixels.
y represents the current vertical scroll origin in pixels.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebView.onScrollChanged)
- iOS WKWebView (Official API - UIScrollViewDelegate.scrollViewDidScroll)
- macOS WKWebView:
- This event is implemented using JavaScript.
- Web <iframe> but requires same origin (Official API - Window.onscroll)
- Linux WPE WebKit:
- This event is implemented using JavaScript.
Parameters - Officially Supported Platforms/Implementations:
x: all platformsy: all platforms
Use the PlatformWebViewCreationParams.isPropertySupported method to check if this property is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(
apiName: 'WebView.onScrollChanged',
apiUrl:
'https://developer.android.com/reference/android/webkit/WebView#onScrollChanged(int,%20int,%20int,%20int)',
),
IOSPlatform(
apiName: 'UIScrollViewDelegate.scrollViewDidScroll',
apiUrl:
'https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619392-scrollviewdidscroll',
),
MacOSPlatform(note: 'This event is implemented using JavaScript.'),
WebPlatform(
apiName: 'Window.onscroll',
apiUrl:
'https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onscroll',
),
LinuxPlatform(note: 'This event is implemented using JavaScript.'),
],
)
final void Function(T controller, int x, int y)? onScrollChanged;