From c905a09b0c77c82757df7c752a1c90d16c469e62 Mon Sep 17 00:00:00 2001 From: Peixin Li Date: Thu, 12 Jan 2023 15:00:23 -0800 Subject: [PATCH] Add documentation for drag/fling offset in WidgetController. (#118288) * Documentation for drag/fling offset * Fix typo * Fix typo 2 * Fix the docs_test * Fix the grammar --- packages/flutter_test/lib/src/controller.dart | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/flutter_test/lib/src/controller.dart b/packages/flutter_test/lib/src/controller.dart index f7bf7e2e696a..24eac265d706 100644 --- a/packages/flutter_test/lib/src/controller.dart +++ b/packages/flutter_test/lib/src/controller.dart @@ -562,6 +562,16 @@ abstract class WidgetController { /// /// {@macro flutter.flutter_test.WidgetController.tap.warnIfMissed} /// + /// {@template flutter.flutter_test.WidgetController.fling.offset} + /// The `offset` represents a distance the pointer moves in the global + /// coordinate system of the screen. + /// + /// Positive [Offset.dy] values mean the pointer moves downward. Negative + /// [Offset.dy] values mean the pointer moves upwards. Accordingly, positive + /// [Offset.dx] values mean the pointer moves towards the right. Negative + /// [Offset.dx] values mean the pointer moves towards left. + /// {@endtemplate} + /// /// {@template flutter.flutter_test.WidgetController.fling} /// This can pump frames. /// @@ -817,6 +827,8 @@ abstract class WidgetController { /// The operation happens at once. If you want the drag to last for a period /// of time, consider using [timedDrag]. /// + /// {@macro flutter.flutter_test.WidgetController.fling.offset} + /// /// {@template flutter.flutter_test.WidgetController.drag} /// By default, if the x or y component of offset is greater than /// [kDragSlopDefault], the gesture is broken up into two separate moves @@ -953,6 +965,8 @@ abstract class WidgetController { /// /// {@macro flutter.flutter_test.WidgetController.tap.warnIfMissed} /// + /// {@macro flutter.flutter_test.WidgetController.fling.offset} + /// /// This is the timed version of [drag]. This may or may not result in a /// [fling] or ballistic animation, depending on the speed from /// `offset/duration`.