Repository navigation
Change default cache extent - #182905
Change default cache extent#182905chunhtai wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request changes the default cache extent for viewports from a fixed pixel value (250.0) to a fraction of the viewport size (0.8). This is achieved by introducing a new default constant kDefaultScrollCacheExtent and updating viewport-related classes to use it. The old defaultCacheExtent is deprecated. Tests are updated to reflect this change. My review identifies a couple of areas for improvement in the implementation logic.
60814ba to
4189abf
Compare
| // Only items 10~16 are on the screen. | ||
| expect(find.text('item9'), findsNothing); | ||
| expect(find.text('item10'), findsOneWidget); | ||
| // Only items 9~16 are on the screen (or in cache). |
There was a problem hiding this comment.
this is due to children rebuild may produce different scroll offset depends on how many children is built on screen. for example
if children 5,6,7,8 and a rebuild happens, the scroll extent will be at 5 after the rebuild finish.
Since the change increase cache extent, the children becomes like 3,4,5,6,7,8,9,10. so the scroll extent will be at 3 after rebuild finishes
29e0a9b to
29085ce
Compare
Piinks
left a comment
There was a problem hiding this comment.
I think there might be a bug in how this affects the current cacheExtent setter for RenderViewportBase and TwoDimensionalViewport, see test repros here: https://gist.github.com/Piinks/129ce6cf3f6c03d8d6188f292a7325c9 . Let me know what you think.
|
addressed the issue |
c6afea8 to
ac494b2
Compare
|
From offline chat: We discussed a potential bug, test cases in https://gist.github.com/Piinks/403c84180bbb373ebeec630530c01eb4 |
ac494b2 to
833efa6
Compare
|
autosubmit label was removed for flutter/flutter/182905, because The base commit of the PR is older than 7 days and can not be merged. Please merge the latest changes from the main into this branch and resubmit the PR. |
|
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
update: I am still working on this. the internal migration is still ongoing. |
0a68412 to
9fa244b
Compare
|
This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
I've marked this PR as not ready to port to flutter/packages yet. The changes not in the material or cupertino libraries will remain here. |
|
Advice for PR splitting: Since this touches material/cupertino along with other parts of flutter/flutter, it will need to be split up. If the material/cupertino changes are dependent on the other non-material/cupertino changes in this PR, then the material/cupertino changes will need to wait for them to roll to stable before they can be ported over to material_ui/cupertino_ui in flutter/packages (which uses the stable branch).
|
|
Greetings from stale PR triage! 👋 |
|
let me close this for now |
fixes #98572
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.