getContentHeight method
Gets the height of the HTML content.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebView.getContentHeight)
- iOS WKWebView (Official API - UIScrollView.contentSize)
- macOS WKWebView:
- This method is implemented using JavaScript.
- Web <iframe> but requires same origin (Official API - Document.documentElement.scrollHeight)
- Linux WPE WebKit
- 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?> getContentHeight() => platform.getContentHeight();