getContentHeight method

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebView.getContentHeight', apiUrl: 'https://developer.android.com/reference/android/webkit/WebView#getContentHeight()'), IOSPlatform(apiName: 'UIScrollView.contentSize', apiUrl: 'https://developer.apple.com/documentation/uikit/uiscrollview/1619399-contentsize'), MacOSPlatform(note: 'This method is implemented using JavaScript.'), WebPlatform(apiName: 'Document.documentElement.scrollHeight', apiUrl: 'https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight'), LinuxPlatform(), WindowsPlatform(note: 'This method is implemented using JavaScript.')])
Future<int?> getContentHeight()

Gets the height of the HTML content.

Officially Supported Platforms/Implementations:

Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(
      apiName: 'WebView.getContentHeight',
      apiUrl:
          'https://developer.android.com/reference/android/webkit/WebView#getContentHeight()',
    ),
    IOSPlatform(
      apiName: 'UIScrollView.contentSize',
      apiUrl:
          'https://developer.apple.com/documentation/uikit/uiscrollview/1619399-contentsize',
    ),
    MacOSPlatform(note: 'This method is implemented using JavaScript.'),
    WebPlatform(
      apiName: 'Document.documentElement.scrollHeight',
      apiUrl:
          'https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight',
    ),
    LinuxPlatform(),
    WindowsPlatform(note: 'This method is implemented using JavaScript.'),
  ],
)
Future<int?> getContentHeight() {
  throw UnimplementedError(
    '${PlatformInAppWebViewControllerMethod.getContentHeight.name} is not implemented on the current platform',
  );
}