Skip to content

WidgetTester.dragUntilVisible() docs to say "use negative offset to swipe up" #89332

Description

@mleonhard

Use case

I need to use WidgetTester.dragUntilVisible() (inherited from WidgetController.dragUntilVisible). The method takes a moveStep parameter of type Offset. I need to know what numerical dx and dy values to pass to the Offset constructor.

I discovered the information by trial-and-error. That took some time because of #88756, #88763 , #88759, and #88762. dragUntilVisible() uses a negative offset to scroll down, while scrollUntilVisible() uses a positive one.

Proposal

Update the docs to say:

moveStep is the movement of the virtual finger on the virtual screen. To swipe up (scroll down), use negative dy and dx=0. To swipe right, use positive dx and dy=0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: tests"flutter test", flutter_test, or one of our testsc: proposalA detailed proposal for a change to Flutterd: api docsIssues with https://api.flutter.dev/frameworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions