Unverified Commit 776a15c5 authored by Bruno Leroux's avatar Bruno Leroux Committed by GitHub

Documentation update to advertize timedDrag (#106489)

parent a74c4813
...@@ -781,6 +781,12 @@ abstract class WidgetController { ...@@ -781,6 +781,12 @@ abstract class WidgetController {
/// ///
/// You can use [createGesture] if your gesture doesn't begin with an initial /// You can use [createGesture] if your gesture doesn't begin with an initial
/// down gesture. /// 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<TestGesture> startGesture( Future<TestGesture> startGesture(
Offset downLocation, { Offset downLocation, {
int? pointer, int? pointer,
......
...@@ -463,6 +463,12 @@ class TestGesture { ...@@ -463,6 +463,12 @@ class TestGesture {
/// ///
/// If the pointer is down, then a move event is dispatched. If the pointer is /// If the pointer is down, then a move event is dispatched. If the pointer is
/// up, then a hover event is dispatched. /// 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<void> moveBy(Offset offset, { Duration timeStamp = Duration.zero }) { Future<void> moveBy(Offset offset, { Duration timeStamp = Duration.zero }) {
assert(_pointer.location != null); assert(_pointer.location != null);
return moveTo(_pointer.location! + offset, timeStamp: timeStamp); return moveTo(_pointer.location! + offset, timeStamp: timeStamp);
...@@ -472,6 +478,12 @@ class TestGesture { ...@@ -472,6 +478,12 @@ class TestGesture {
/// ///
/// If the pointer is down, then a move event is dispatched. If the pointer is /// If the pointer is down, then a move event is dispatched. If the pointer is
/// up, then a hover event is dispatched. /// 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<void> moveTo(Offset location, { Duration timeStamp = Duration.zero }) { Future<void> moveTo(Offset location, { Duration timeStamp = Duration.zero }) {
return TestAsyncUtils.guard<void>(() { return TestAsyncUtils.guard<void>(() {
if (_pointer._isDown) { if (_pointer._isDown) {
......
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