patrol icon indicating copy to clipboard operation
patrol copied to clipboard

Implement native drag from Selector to a given offset

Open fylyppo opened this issue 2 years ago • 1 comments

Use case

  • Dragging native sliders
  • Choosing date in iOS system date picker

Proposal

await $.native.dragFrom(Selector selector, Offset offset);

fylyppo avatar Nov 22 '23 07:11 fylyppo

you can use widget tester to drag to the offset.

WidgetTester tester = $.tester;
final centerOfTheSignatureView = $(SignatureView).hitTestable();

await tester.timedDrag(
  centerOfTheSignatureView,
  const Offset(100, 100),
  const Duration(milliseconds: 500),
);

kodega2016 avatar Dec 15 '23 05:12 kodega2016