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

Fix ListWheelScrollView gestures and paint coordinates in tests #121342

Merged

Conversation

nt4f04uNd
Copy link
Member

@nt4f04uNd nt4f04uNd commented Feb 23, 2023

Fixes #38803
Fixes #121343

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@nt4f04uNd nt4f04uNd added framework flutter/packages/flutter repository. See also f: labels. f: scrolling Viewports, list views, slivers, etc. f: gestures flutter/packages/flutter/gestures repository. labels Feb 23, 2023
@nt4f04uNd nt4f04uNd force-pushed the 38803/fix-list-wheel-scroll-view-gestures branch from f000764 to e060330 Compare February 23, 2023 17:07
@nt4f04uNd nt4f04uNd requested a review from xster February 24, 2023 12:18
tester.getTopLeft(find.widgetWithText(SizedBox, '0')),
const Offset(0.0, 250.0),
tester.getTopLeft(find.widgetWithText(SizedBox, '0')),
offsetMoreOrLessEquals(const Offset(200.0, 250.0)),
Copy link
Member Author

@nt4f04uNd nt4f04uNd Feb 24, 2023

Choose a reason for hiding this comment

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

These changes are to be expected. Previously the position didn't account for transform applied to children.

200.0 = (800.0 (screen width) - 400.0 (item width in this test) ) / 2 (since the scroll view centers its children on screen)

@nt4f04uNd nt4f04uNd marked this pull request as draft February 24, 2023 13:44
@flutter-dashboard

This comment was marked as resolved.

@nt4f04uNd nt4f04uNd force-pushed the 38803/fix-list-wheel-scroll-view-gestures branch from c2935fb to b9e3155 Compare February 24, 2023 14:32
@nt4f04uNd nt4f04uNd marked this pull request as ready for review February 24, 2023 14:59
@Piinks Piinks self-requested a review February 24, 2023 22:41
///
/// Can be used to find the local bounds of this child in the viewport,
/// and then use it, for example, in hit testing.
Matrix4? transform;
Copy link
Contributor

Choose a reason for hiding this comment

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

For the docs, when would this be null?

Copy link
Member Author

Choose a reason for hiding this comment

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

From what it seems, never. Added docs and assertions to ensure that.

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

Wow! This is awesome, thank you for fixing such a highly requested feature!

@goderbauer
Copy link
Member

(triage) @nt4f04uNd Do you still have plans to follow up on the feedback given above?

@nt4f04uNd nt4f04uNd force-pushed the 38803/fix-list-wheel-scroll-view-gestures branch 2 times, most recently from 5a1009d to 177e4d4 Compare March 26, 2023 17:47
@nt4f04uNd
Copy link
Member Author

Updated. I'm sorry this took a while.

@nt4f04uNd nt4f04uNd requested a review from Piinks March 26, 2023 17:49
@@ -592,14 +592,26 @@ void main() {
);
});

testWidgets('width of wheel in background does not increase at large widths', (WidgetTester tester) async {
testWidgets('wheel does not bend outwards', (WidgetTester tester) async {
Copy link
Member Author

@nt4f04uNd nt4f04uNd Mar 26, 2023

Choose a reason for hiding this comment

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

This test also didn't work properly because of the bug #121343

I rewrote it to actually verify the shape of the list wheel

Values were: 1 decemberX = 250 octoberX = 250

2
decemberX = 218.5
octoberX = 218.5

So the distance in both cases was zero

In actuality, after the fix, these values were

262.6779112246874
250.75842555233146
distance 11.919485672355961

232.8608197943362
219.35910151060554
distance = 13.501718283730668

@nt4f04uNd nt4f04uNd changed the title Fix ListWheelScrollView gestures Fix ListWheelScrollView gestures and paint coordinates in tests Mar 26, 2023
@flutter-dashboard flutter-dashboard bot added the f: cupertino flutter/packages/flutter/cupertino repository label Mar 26, 2023
'$RenderListWheelViewport normally paints all of the children it has laid out. \n'
'Did you forget to update the $ListWheelParentData.transform during the paint() call?. \n'
'Did you forget to update the $ListWheelParentData.transform during the paint() call? \n'
Copy link
Contributor

Choose a reason for hiding this comment

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

At first I thought, what an interesting error message, but TIL we have a couple of error messages like this. Nice!

@Piinks Piinks added the a: quality A truly polished experience label Mar 29, 2023
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

Flutter_LGTM
Thank you!

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 29, 2023
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 29, 2023
@auto-submit
Copy link
Contributor

auto-submit bot commented Mar 29, 2023

auto label is removed for flutter/flutter, pr: 121342, due to - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 30, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 30, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 30, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2023
exaby73 pushed a commit to NevercodeHQ/flutter that referenced this pull request Apr 17, 2023
…ter#121342)

Fix ListWheelScrollView gestures and paint coordinates in tests
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: quality A truly polished experience autosubmit Merge PR when tree becomes green via auto submit App f: cupertino flutter/packages/flutter/cupertino repository f: gestures flutter/packages/flutter/gestures repository. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
3 participants