Adds migration guide for default cache extent change#13177
Adds migration guide for default cache extent change#13177chunhtai wants to merge 1 commit intoflutter:mainfrom
Conversation
|
Visit the preview URL for this PR (updated for commit b3d0916): https://flutter-docs-prod--pr13177-cache-default-th9gvcrr.web.app |
sfshaza2
left a comment
There was a problem hiding this comment.
I know that this is still in draft form, but lgtm, so it's ready when you are.
|
update: still migrating internal tests and the pr is under code freeze |
There was a problem hiding this comment.
Code Review
This pull request introduces documentation for a breaking change where the default cacheExtent for scrolling widgets is updated from a fixed 250 pixels to 0.8 times the viewport size. The review feedback focuses on ensuring the documentation adheres to the project's style guide by implementing semantic line breaks and maintaining a maximum line length of 80 characters. Additionally, there is a suggestion to explicitly include ScrollView in the list of affected widgets.
|
|
||
| ## Summary | ||
|
|
||
| The default cache extent for scrolling widgets (`ListView`, `GridView`, `CustomScrollView`, and `Scrollable`) changed from a fixed value of `250.0` pixels to `0.8` times the viewport's dimension along the main axis. |
There was a problem hiding this comment.
This line exceeds 80 characters and does not use semantic line breaks as required by the project's style guide. Additionally, consider adding ScrollView to the list of widgets, as it is the base class that defines the property.
| The default cache extent for scrolling widgets (`ListView`, `GridView`, `CustomScrollView`, and `Scrollable`) changed from a fixed value of `250.0` pixels to `0.8` times the viewport's dimension along the main axis. | |
| The default cache extent for scrolling widgets | |
| (`ScrollView`, `ListView`, `GridView`, `CustomScrollView`, and `Scrollable`) | |
| changed from a fixed value of `250.0` pixels | |
| to `0.8` times the viewport's dimension along the main axis. |
References
- The project requires semantic line breaks of 80 characters or fewer for documentation. (link)
| Previously, the default cache extent was `250.0` pixels. A fixed pixel cache extent is too small on large monitors and unnecessarily large on very small screens. Furthermore, the fixed 250-pixel cache extent can be too small to accommodate accessibility scrolling, which is based on the viewport size. This sometimes causes iOS VoiceOver to lose its current focus because the currently focused item scrolls outside of the cache extent. | ||
|
|
||
| The new default cache extent is `0.8` times the viewport extent. The cache region extends 80% of the viewport's main axis dimension both before and after the visible area. This preloads an appropriate amount of content for any screen size. |
There was a problem hiding this comment.
These lines exceed 80 characters and should use semantic line breaks to improve readability and diffing, as specified in the PR checklist.
| Previously, the default cache extent was `250.0` pixels. A fixed pixel cache extent is too small on large monitors and unnecessarily large on very small screens. Furthermore, the fixed 250-pixel cache extent can be too small to accommodate accessibility scrolling, which is based on the viewport size. This sometimes causes iOS VoiceOver to lose its current focus because the currently focused item scrolls outside of the cache extent. | |
| The new default cache extent is `0.8` times the viewport extent. The cache region extends 80% of the viewport's main axis dimension both before and after the visible area. This preloads an appropriate amount of content for any screen size. | |
| Previously, the default cache extent was `250.0` pixels. | |
| A fixed pixel cache extent is too small on large monitors | |
| and unnecessarily large on very small screens. | |
| Furthermore, the fixed 250-pixel cache extent can be too small | |
| to accommodate accessibility scrolling, which is based on the viewport size. | |
| This sometimes causes iOS VoiceOver to lose its current focus | |
| because the currently focused item scrolls outside of the cache extent. | |
| The new default cache extent is `0.8` times the viewport extent. | |
| The cache region extends 80% of the viewport's main axis dimension | |
| both before and after the visible area. | |
| This preloads an appropriate amount of content for any screen size. |
References
- The project requires semantic line breaks of 80 characters or fewer for documentation. (link)
|
|
||
| ## Description of change | ||
|
|
||
| Any scrolling widget that relies on the default cache extent will now have a cache extent relative to its viewport size instead of a fixed `250.0` pixels. |
There was a problem hiding this comment.
This line exceeds 80 characters. Please use semantic line breaks.
| Any scrolling widget that relies on the default cache extent will now have a cache extent relative to its viewport size instead of a fixed `250.0` pixels. | |
| Any scrolling widget that relies on the default cache extent | |
| will now have a cache extent relative to its viewport size | |
| instead of a fixed `250.0` pixels. |
References
- The project requires semantic line breaks of 80 characters or fewer for documentation. (link)
| For example, on a device with a scroll view height of 1000 pixels: | ||
|
|
||
| * Old behavior: The cache area is 250 pixels above and below the visible area. | ||
| * New behavior: The cache area is `1000 * 0.8 = 800` pixels above and below the visible area. |
There was a problem hiding this comment.
This line exceeds 80 characters. Please use semantic line breaks.
| * New behavior: The cache area is `1000 * 0.8 = 800` pixels above and below the visible area. | |
| * New behavior: The cache area is `1000 * 0.8 = 800` pixels | |
| above and below the visible area. |
References
- The project requires semantic line breaks of 80 characters or fewer for documentation. (link)
| * Old behavior: The cache area is 250 pixels above and below the visible area. | ||
| * New behavior: The cache area is `1000 * 0.8 = 800` pixels above and below the visible area. | ||
|
|
||
| This change does not affect widgets where the cache extent is explicitly provided (such as `ListView(cacheExtent: 500)` or `ListView(scrollCacheExtent: ScrollCacheExtent.pixels(500))`). |
There was a problem hiding this comment.
This line exceeds 80 characters. Please use semantic line breaks.
| This change does not affect widgets where the cache extent is explicitly provided (such as `ListView(cacheExtent: 500)` or `ListView(scrollCacheExtent: ScrollCacheExtent.pixels(500))`). | |
| This change does not affect widgets where the cache extent is explicitly | |
| provided (such as `ListView(cacheExtent: 500)` or | |
| `ListView(scrollCacheExtent: ScrollCacheExtent.pixels(500))`). |
References
- The project requires semantic line breaks of 80 characters or fewer for documentation. (link)
|
|
||
| ## Migration guide | ||
|
|
||
| Most applications do not require modifications. If your application relies on the 250-pixel default, you can restore the previous behavior by explicitly setting the cache extent property. |
There was a problem hiding this comment.
This line exceeds 80 characters. Please use semantic line breaks.
| Most applications do not require modifications. If your application relies on the 250-pixel default, you can restore the previous behavior by explicitly setting the cache extent property. | |
| Most applications do not require modifications. | |
| If your application relies on the 250-pixel default, | |
| you can restore the previous behavior by explicitly setting | |
| the cache extent property. |
References
- The project requires semantic line breaks of 80 characters or fewer for documentation. (link)
for flutter/flutter#182905
Presubmit checklist
of 80 characters or fewer.