Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a WidgetTester extension to drag scroll bars (Resolves #22) #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

angelosilvestre
Copy link
Collaborator

Create a WidgetTester extension to drag scroll bars. Resolves #22

Dragging a scrollbar requires hovering over the scroll bar, waiting for it to appear, and then dragging and releasing it.

This PR adds a dragScrollbar method yo make it easier to interacting with a scrollbar.

We can't use a finder to locate the scrollbar thumb because the scrollbar widget uses a single painter to paint both the scrollbar track and the thumb.

We have a kTapMinTime constant in super_editor that we use in the tests. I needed to use the value directly here.

/// Simulates the user interacting with a Scrollbar.
extension ScrollbarInteractions on WidgetTester {
/// Press a scrollbar thumb at [thumbLocation] and drag it vertically by [delta] pixels.
Future<void> dragScrollbar(Offset thumbLocation, double delta) async {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does the user know where there scrollbar thumb is located?

Also, we should use this in a test in this package to demonstrate that it works, and show how we expect others to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a WidgetTester extension to drag scroll bars
2 participants