dragFrom method

Future<void> dragFrom(
  1. Offset from,
  2. Offset by, {
  3. Duration? duration,
  4. Shot? shot,
  5. Settle? settle,
})

Drags from a point rather than from a widget — the same gesture as drag, aimed where no finder can reach.

A canvas, a chart, a map, a signature pad: the thing to grab is a painted region inside one widget, so naming the widget grabs its centre and naming nothing was the only other option. Target.at does not close this — it resolves the widget under the point and the drag still starts from that widget's centre, which on a full-bleed canvas is somewhere else entirely.

The coordinates are the ones every box in a report is in: the view's logical pixels, top-left origin — what a step's aim rectangle reads back in, so a point can be lifted straight off one.

duration means what it means on drag.

Implementation

Future<void> dragFrom(
  Offset from,
  Offset by, {
  Duration? duration,
  Shot? shot,
  Settle? settle,
}) => _step(
  shot,
  settle,
  () async {
    // No ladder to climb: there is no target to prove reachable, only a
    // point the author named. That is the trade this verb makes — it goes
    // where it is told, and a point over nothing drags nothing silently,
    // where every finder verb would have refused.
    _aimAtPoint(from, by: by);
    await _approach('dragFrom');
    await _dragFrom(from, by, duration);
  },
  verb: 'dragFrom',
  target: '${from.dx.round()},${from.dy.round()}',
);