Skip to content

Commit 2391bdb

Browse files
authored
Introduce ScrollCacheExtent and also fixes unbound shrinkwrap cache ex… (flutter#181092)
…tent NaN problem <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> besides the general piping through parameters and breaking change. Fixing an issue when the shrinkwrap: true the mainAxisExetent will be double.infinity, which cause the cacheExtent to be double.Nan after the calculation and crash the app. ## 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]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. 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](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot 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. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 99c5bd4 commit 2391bdb

16 files changed

Lines changed: 1959 additions & 83 deletions

packages/flutter/lib/fix_data/fix_rendering.yaml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,111 @@
1818
# * Fixes in this file are from the Rendering library. *
1919
version: 1
2020
transforms:
21+
# Change made in https://github.com/flutter/flutter/pull/135218
22+
- title: "Migrate to 'scrollCacheExtent'"
23+
date: 2026-02-09
24+
element:
25+
uris: [ 'rendering.dart' ]
26+
constructor: ''
27+
inClass: 'RenderViewport'
28+
oneOf:
29+
- if: "cacheExtent != '' && cacheExtentStyle == 'CacheExtentStyle.viewport'"
30+
changes:
31+
- kind: 'addParameter'
32+
index: 0
33+
name: 'scrollCacheExtent'
34+
style: optional_named
35+
argumentValue:
36+
expression: 'ScrollCacheExtent.viewport({% cacheExtent %})'
37+
requiredIf: "cacheExtent != '' && cacheExtentStyle == 'CacheExtentStyle.viewport'"
38+
- kind: 'removeParameter'
39+
name: 'cacheExtent'
40+
- kind: 'removeParameter'
41+
name: 'cacheExtentStyle'
42+
- if: "cacheExtent != '' && cacheExtentStyle == 'CacheExtentStyle.pixel'"
43+
changes:
44+
- kind: 'addParameter'
45+
index: 0
46+
name: 'scrollCacheExtent'
47+
style: optional_named
48+
argumentValue:
49+
expression: 'ScrollCacheExtent.pixels({% cacheExtent %})'
50+
requiredIf: "cacheExtent != '' && cacheExtentStyle == 'CacheExtentStyle.pixel'"
51+
- kind: 'removeParameter'
52+
name: 'cacheExtent'
53+
- kind: 'removeParameter'
54+
name: 'cacheExtentStyle'
55+
- if: "cacheExtent != '' && cacheExtentStyle == ''"
56+
changes:
57+
- kind: 'addParameter'
58+
index: 0
59+
name: 'scrollCacheExtent'
60+
style: optional_named
61+
argumentValue:
62+
expression: 'ScrollCacheExtent.pixels({% cacheExtent %})'
63+
requiredIf: "cacheExtent != '' && cacheExtentStyle == ''"
64+
- kind: 'removeParameter'
65+
name: 'cacheExtent'
66+
variables:
67+
cacheExtent:
68+
kind: 'fragment'
69+
value: 'arguments[cacheExtent]'
70+
cacheExtentStyle:
71+
kind: 'fragment'
72+
value: 'arguments[cacheExtentStyle]'
73+
#
74+
# Change made in https://github.com/flutter/flutter/pull/135218
75+
- title: "Migrate to 'scrollCacheExtent'"
76+
date: 2026-02-09
77+
element:
78+
uris: [ 'rendering.dart' ]
79+
constructor: ''
80+
inClass: 'RenderShrinkWrappingViewport'
81+
oneOf:
82+
- if: "cacheExtent != '' && cacheExtentStyle == 'CacheExtentStyle.viewport'"
83+
changes:
84+
- kind: 'addParameter'
85+
index: 0
86+
name: 'scrollCacheExtent'
87+
style: optional_named
88+
argumentValue:
89+
expression: 'ScrollCacheExtent.viewport({% cacheExtent %})'
90+
requiredIf: "cacheExtent != '' && cacheExtentStyle == 'CacheExtentStyle.viewport'"
91+
- kind: 'removeParameter'
92+
name: 'cacheExtent'
93+
- kind: 'removeParameter'
94+
name: 'cacheExtentStyle'
95+
- if: "cacheExtent != '' && cacheExtentStyle == 'CacheExtentStyle.pixel'"
96+
changes:
97+
- kind: 'addParameter'
98+
index: 0
99+
name: 'scrollCacheExtent'
100+
style: optional_named
101+
argumentValue:
102+
expression: 'ScrollCacheExtent.pixels({% cacheExtent %})'
103+
requiredIf: "cacheExtent != '' && cacheExtentStyle == 'CacheExtentStyle.pixel'"
104+
- kind: 'removeParameter'
105+
name: 'cacheExtent'
106+
- kind: 'removeParameter'
107+
name: 'cacheExtentStyle'
108+
- if: "cacheExtent != '' && cacheExtentStyle == ''"
109+
changes:
110+
- kind: 'addParameter'
111+
index: 0
112+
name: 'scrollCacheExtent'
113+
style: optional_named
114+
argumentValue:
115+
expression: 'ScrollCacheExtent.pixels({% cacheExtent %})'
116+
requiredIf: "cacheExtent != '' && cacheExtentStyle == ''"
117+
- kind: 'removeParameter'
118+
name: 'cacheExtent'
119+
variables:
120+
cacheExtent:
121+
kind: 'fragment'
122+
value: 'arguments[cacheExtent]'
123+
cacheExtentStyle:
124+
kind: 'fragment'
125+
value: 'arguments[cacheExtentStyle]'
21126
# Change made in https://github.com/flutter/flutter/pull/128522
22127
- title: "Migrate to 'textScaler'"
23128
date: 2023-06-09

0 commit comments

Comments
 (0)