getScrollX method

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'View.getScrollX', apiUrl: 'https://developer.android.com/reference/android/view/View#getScrollX()'), 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.scrollX', apiUrl: 'https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX'), WindowsPlatform(note: 'This method is implemented using JavaScript.')])
Future<int?> getScrollX()

Returns the scrolled left 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.getScrollX',
      apiUrl:
          'https://developer.android.com/reference/android/view/View#getScrollX()',
    ),
    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.scrollX',
      apiUrl:
          'https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX',
    ),
    WindowsPlatform(note: 'This method is implemented using JavaScript.'),
  ],
)
Future<int?> getScrollX() {
  throw UnimplementedError(
    '${PlatformInAppWebViewControllerMethod.getScrollX.name} is not implemented on the current platform',
  );
}