Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Add documentation for drag/fling offset in WidgetController. (#118288)
Browse files Browse the repository at this point in the history
* Documentation for drag/fling offset

* Fix typo

* Fix typo 2

* Fix the docs_test

* Fix the grammar
  • Loading branch information
peixinli committed Jan 12, 2023
1 parent db8d1a4 commit c905a09
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/flutter_test/lib/src/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`.
Expand Down

0 comments on commit c905a09

Please sign in to comment.