Fix precision error in NestedScrollView#87801
Fix precision error in NestedScrollView#87801fluttergithubbot merged 5 commits intoflutter:masterfrom
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.
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.
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 |
|
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.