From 776a15c57b985509e52cb96ae38fc495696e29a5 Mon Sep 17 00:00:00 2001 From: Bruno Leroux Date: Thu, 30 Jun 2022 15:02:07 +0200 Subject: [PATCH] Documentation update to advertize timedDrag (#106489) --- packages/flutter_test/lib/src/controller.dart | 6 ++++++ packages/flutter_test/lib/src/test_pointer.dart | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/packages/flutter_test/lib/src/controller.dart b/packages/flutter_test/lib/src/controller.dart index 8227a52bba4c..b48b0143e8c3 100644 --- a/packages/flutter_test/lib/src/controller.dart +++ b/packages/flutter_test/lib/src/controller.dart @@ -781,6 +781,12 @@ abstract class WidgetController { /// /// You can use [createGesture] if your gesture doesn't begin with an initial /// down gesture. + /// + /// See also: + /// * [WidgetController.drag], a method to simulate a drag. + /// * [WidgetController.timedDrag], a method to simulate the drag of a given widget in a given duration. + /// It sends move events at a given frequency and it is useful when there are listeners involved. + /// * [WidgetController.fling], a method to simulate a fling. Future startGesture( Offset downLocation, { int? pointer, diff --git a/packages/flutter_test/lib/src/test_pointer.dart b/packages/flutter_test/lib/src/test_pointer.dart index c6d2afedd540..bcd019512f18 100644 --- a/packages/flutter_test/lib/src/test_pointer.dart +++ b/packages/flutter_test/lib/src/test_pointer.dart @@ -463,6 +463,12 @@ class TestGesture { /// /// If the pointer is down, then a move event is dispatched. If the pointer is /// up, then a hover event is dispatched. + /// + /// See also: + /// * [WidgetController.drag], a method to simulate a drag. + /// * [WidgetController.timedDrag], a method to simulate the drag of a given widget in a given duration. + /// It sends move events at a given frequency and it is useful when there are listeners involved. + /// * [WidgetController.fling], a method to simulate a fling. Future moveBy(Offset offset, { Duration timeStamp = Duration.zero }) { assert(_pointer.location != null); return moveTo(_pointer.location! + offset, timeStamp: timeStamp); @@ -472,6 +478,12 @@ class TestGesture { /// /// If the pointer is down, then a move event is dispatched. If the pointer is /// up, then a hover event is dispatched. + /// + /// See also: + /// * [WidgetController.drag], a method to simulate a drag. + /// * [WidgetController.timedDrag], a method to simulate the drag of a given widget in a given duration. + /// It sends move events at a given frequency and it is useful when there are listeners involved. + /// * [WidgetController.fling], a method to simulate a fling. Future moveTo(Offset location, { Duration timeStamp = Duration.zero }) { return TestAsyncUtils.guard(() { if (_pointer._isDown) {