getScrollX method
Returns the scrolled left position of the current WebView.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - View.getScrollX)
- iOS WKWebView (Official API - UIScrollView.contentOffset)
- macOS WKWebView:
- This method is implemented using JavaScript.
- Linux WPE WebKit
- Web <iframe> but requires same origin (Official API - Window.scrollX)
- Windows WebView2:
- This method is implemented using JavaScript.
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
Future<int?> getScrollX() => platform.getScrollX();