-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Fix precision error in NestedScrollView #87801
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
Conversation
|
Can you add more info to your PR description that explains why it fixes the linked bug? |
| @protected | ||
| bool applyMoveTo(double value) { | ||
| return delegate.setPixels(value) == 0.0; | ||
| return delegate.setPixels(value).abs() < precisionErrorTolerance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add more info to your PR description that explains why it fixes the linked bug?
Without this change the test I added fails with the error from the linked issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I've checked out this change and I see this, but now I wonder, why? And What are all of the other changes for in the other files? Those do not appear to be covered by the test here.
It would be really helpful as a code reviewer if the PR description explained what the changes are for and why. A comment inline here will be [hard to find/disappear when resolved] and unhelpful for people who may come across this change later.
|
Done |
packages/flutter/lib/src/rendering/sliver_fixed_extent_list.dart
Outdated
Show resolved
Hide resolved
|
Those are refactorings without any semantic change, I believe they don't need tests. Do I need to submit them as a different PR and get a test-exemption from Hixie? |
Changing |
|
In case with such a small number I believe it's not. I'm removing these changes from the current PR |
Piinks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Thank you for the review ! |
* Migrate to 2.5 * Merge code from flutter/flutter#87801 * Fix exception that findRenderObject throw exception even
## Description This PR fixes a precision error in ~~`ClampingScrollPhysics`~~ `ScrollPosition` that leads to `StretchingOverscrollIndicator` stretching its content unexpectedly in some devices (see #126561 where this is visible in `TabBarView` and the test added in this PR where it reproduces with a `PageView`). ~~This PR also contains a change to `nested_scroll_view.dart` because the first change (the one in `ClampingScrollPhysics`) breaks the precision error test added by #87801 ## Related Issue Fixes #126561 ## Tests Adds 1 test.

Fixes #63825
flutter/packages/flutter/lib/src/widgets/nested_scroll_view.dart
Lines 1719 to 1720 in 81fac68
The root of the error was here, because
metrics.correctionOffsetsometimes came a little bit bigger than it needed to be, because of the precision error caused by calculations hereflutter/packages/flutter/lib/src/widgets/nested_scroll_view.dart
Lines 979 to 984 in 81fac68
So because of that the
applyMoveToreturned false, as it was overflowing by a small numberAlso a small refactorings in
lsq_solver.dartandsliver_fixed_extent_list.dart:<=to<in few places whereprecisionErrorTolerancewas used, because that's the way it is in the rest of the codebasePre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.