scrollTo method
Scrolls the WebView to the position.
x
represents the x position to scroll to.
y
represents the y position to scroll to.
animated
true
to animate the scroll transition, false
to make the scoll transition immediate.
NOTE for Web: this method will have effect only if the iframe has the same origin.
NOTE for MacOS: this method is implemented using JavaScript.
Officially Supported Platforms/Implementations:
- Android native WebView (Official API - View.scrollTo)
- iOS (Official API - UIScrollView.setContentOffset)
- MacOS
- Web (Official API - Window.scrollTo)
Implementation
Future<void> scrollTo(
{required int x, required int y, bool animated = false}) =>
platform.scrollTo(x: x, y: y, animated: animated);