getScrollPos method

Future<Map?> getScrollPos()

Gets the horizontal and vertical scroll position in the current document viewer.

The scroll position is returned as a Map<String, int> with the keys "horizontal" and "vertical".

Implementation

Future<Map?> getScrollPos() async {
  String jsonString = await _channel.invokeMethod(Functions.getScrollPos);
  dynamic json = jsonDecode(jsonString);
  Map scrollPos = {
    'horizontal': json['horizontal'],
    'vertical': json['vertical']
  };
  return scrollPos;
}