Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
776a15c5
Unverified
Commit
776a15c5
authored
Jun 30, 2022
by
Bruno Leroux
Committed by
GitHub
Jun 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation update to advertize timedDrag (#106489)
parent
a74c4813
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
controller.dart
packages/flutter_test/lib/src/controller.dart
+6
-0
test_pointer.dart
packages/flutter_test/lib/src/test_pointer.dart
+12
-0
No files found.
packages/flutter_test/lib/src/controller.dart
View file @
776a15c5
...
...
@@ -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
<
TestGesture
>
startGesture
(
Offset
downLocation
,
{
int
?
pointer
,
...
...
packages/flutter_test/lib/src/test_pointer.dart
View file @
776a15c5
...
...
@@ -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
<
void
>
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
<
void
>
moveTo
(
Offset
location
,
{
Duration
timeStamp
=
Duration
.
zero
})
{
return
TestAsyncUtils
.
guard
<
void
>(()
{
if
(
_pointer
.
_isDown
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment