glideTo method

bool glideTo(
  1. Offset globalPosition
)

Drives slide-to-select with a pointer the menu never receives itself.

Use this when your own gesture code owns the finger, for example a long-press recogniser that opened the menu with open. Call it with the pointer's global position on every move: the item under that point highlights, with a selection haptic each time the highlight moves to a new item. As with touch slide-to-select, nothing highlights on a scrollable menu.

Returns whether globalPosition lies over the open menu. A no-op that returns false while the menu is closed or closing.

Implementation

bool glideTo(Offset globalPosition) =>
    _state?._glideTo(globalPosition) ?? false;