getScrollY method

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'View.getScrollY', apiUrl: 'https://developer.android.com/reference/android/view/View#getScrollY()'), IOSPlatform(apiName: 'UIScrollView.contentOffset', apiUrl: 'https://developer.apple.com/documentation/uikit/uiscrollview/1619404-contentoffset'), MacOSPlatform(note: 'This method is implemented using JavaScript.'), LinuxPlatform(), WebPlatform(apiName: 'Window.scrollY', apiUrl: 'https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY'), WindowsPlatform(note: 'This method is implemented using JavaScript.')])
Future<int?> getScrollY()

Returns the scrolled top position of the current WebView.

Officially Supported Platforms/Implementations:

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

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(
      apiName: 'View.getScrollY',
      apiUrl:
          'https://developer.android.com/reference/android/view/View#getScrollY()',
    ),
    IOSPlatform(
      apiName: 'UIScrollView.contentOffset',
      apiUrl:
          'https://developer.apple.com/documentation/uikit/uiscrollview/1619404-contentoffset',
    ),
    MacOSPlatform(note: 'This method is implemented using JavaScript.'),
    LinuxPlatform(),
    WebPlatform(
      apiName: 'Window.scrollY',
      apiUrl:
          'https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY',
    ),
    WindowsPlatform(note: 'This method is implemented using JavaScript.'),
  ],
)
Future<int?> getScrollY() {
  throw UnimplementedError(
    '${PlatformInAppWebViewControllerMethod.getScrollY.name} is not implemented on the current platform',
  );
}