scroll method

Future<DriveStep> scroll(
  1. dynamic target,
  2. Offset by, {
  3. Duration? settle,
})

Turns the mouse wheel over target.

Not a nicer drag, and not scrollTo. A wheel turn is a pointer signal: the framework hit-tests it to whatever is under the pointer and hands it to that, so this is the verb that makes "scroll this pane" expressible. scrollTo picks a Scrollable and walks it, which is the right thing when the question is "get X on screen" and the wrong thing when the page has three scrollables and you mean the middle one.

by is a wheel, not a finger, and the sign is the other way round. The delta is added to the scroll offset, so a positive dy moves down the list — where drag's negative dy moves the finger up the screen to achieve the same thing. Both conventions are the platform's; neither is this engine's to change.

The pointer is moved there first, because that is how a wheel reaches anything — so a scroll leaves the target hovered, exactly as a real mouse does, and unhover ends that.

Implementation

Future<DriveStep> scroll(dynamic target, Offset by, {Duration? settle}) {
  return _act('scroll', target, settle, (finder) async {
    await controller.sendEventToBinding(
      _mouse.hover(_contact(target, finder)),
    );
    _hovering = describeTarget(target);
    await controller.sendEventToBinding(_mouse.scroll(by));
  });
}