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