Unverified Commit 91de4bd3 authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Add onLongPressDown, onLongPressCancel (#81260)

This adds support for GestureDetector.onLongPressDown and
GestureDetector.onLongPressCancel, allowing callers to register
interest in the initial pointer contact that might turn into
a long-press (and the associated cancel event if the gesture
loses).
parent 99f19d05
......@@ -394,6 +394,7 @@ class TapGestureRecognizer extends BaseTapGestureRecognizer {
/// See also:
///
/// * [kPrimaryButton], the button this callback responds to.
/// * [onSecondaryTap], a similar callback but for a secondary button.
/// * [onTapUp], which has the same timing but with details.
/// * [GestureDetector.onTap], which exposes this callback.
GestureTapCallback? onTap;
......
......@@ -41,6 +41,7 @@ void main() {
editable.attach(owner);
// This should register pointer into GestureBinding.instance.pointerRouter.
editable.handleEvent(const PointerDownEvent(), BoxHitTestEntry(editable, const Offset(10,10)));
GestureBinding.instance!.pointerRouter.route(const PointerDownEvent());
expect(spy.routeCount, greaterThan(0));
editable.detach();
expect(spy.routeCount, 0);
......
......@@ -922,6 +922,7 @@ void main() {
// Move back to reset.
await dragScrollbarGesture.moveBy(const Offset(0.0, -scrollAmount));
await tester.pumpAndSettle();
await dragScrollbarGesture.up();
expect(scrollController.offset, 0.0);
expect(
find.byType(RawScrollbar),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment