chunhtai 2391bdb566
Introduce ScrollCacheExtent and also fixes unbound shrinkwrap cache ex… (#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
2026-02-09 22:10:20 +00:00

263 lines
8.6 KiB
YAML

# Copyright 2014 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# For details regarding the *Flutter Fix* feature, see
# https://flutter.dev/to/flutter-fix
# Please add new fixes to the top of the file, separated by one blank line
# from other fixes. In a comment, include a link to the PR where the change
# requiring the fix was made.
# Every fix must be tested. See the flutter/packages/flutter/test_fixes/README.md
# file for instructions on testing these data driven fixes.
# For documentation about this file format, see
# https://dart.dev/go/data-driven-fixes.
# * Fixes in this file are from the Rendering library. *
version: 1
transforms:
# Change made in https://github.com/flutter/flutter/pull/135218
- title: "Migrate to 'scrollCacheExtent'"
date: 2026-02-09
element:
uris: [ 'rendering.dart' ]
constructor: ''
inClass: 'RenderViewport'
oneOf:
- if: "cacheExtent != '' && cacheExtentStyle == 'CacheExtentStyle.viewport'"
changes:
- kind: 'addParameter'
index: 0
name: 'scrollCacheExtent'
style: optional_named
argumentValue:
expression: 'ScrollCacheExtent.viewport({% cacheExtent %})'
requiredIf: "cacheExtent != '' && cacheExtentStyle == 'CacheExtentStyle.viewport'"
- kind: 'removeParameter'
name: 'cacheExtent'
- kind: 'removeParameter'
name: 'cacheExtentStyle'
- if: "cacheExtent != '' && cacheExtentStyle == 'CacheExtentStyle.pixel'"
changes:
- kind: 'addParameter'
index: 0
name: 'scrollCacheExtent'
style: optional_named
argumentValue:
expression: 'ScrollCacheExtent.pixels({% cacheExtent %})'
requiredIf: "cacheExtent != '' && cacheExtentStyle == 'CacheExtentStyle.pixel'"
- kind: 'removeParameter'
name: 'cacheExtent'
- kind: 'removeParameter'
name: 'cacheExtentStyle'
- if: "cacheExtent != '' && cacheExtentStyle == ''"
changes:
- kind: 'addParameter'
index: 0
name: 'scrollCacheExtent'
style: optional_named
argumentValue:
expression: 'ScrollCacheExtent.pixels({% cacheExtent %})'
requiredIf: "cacheExtent != '' && cacheExtentStyle == ''"
- kind: 'removeParameter'
name: 'cacheExtent'
variables:
cacheExtent:
kind: 'fragment'
value: 'arguments[cacheExtent]'
cacheExtentStyle:
kind: 'fragment'
value: 'arguments[cacheExtentStyle]'
#
# Change made in https://github.com/flutter/flutter/pull/135218
- title: "Migrate to 'scrollCacheExtent'"
date: 2026-02-09
element:
uris: [ 'rendering.dart' ]
constructor: ''
inClass: 'RenderShrinkWrappingViewport'
oneOf:
- if: "cacheExtent != '' && cacheExtentStyle == 'CacheExtentStyle.viewport'"
changes:
- kind: 'addParameter'
index: 0
name: 'scrollCacheExtent'
style: optional_named
argumentValue:
expression: 'ScrollCacheExtent.viewport({% cacheExtent %})'
requiredIf: "cacheExtent != '' && cacheExtentStyle == 'CacheExtentStyle.viewport'"
- kind: 'removeParameter'
name: 'cacheExtent'
- kind: 'removeParameter'
name: 'cacheExtentStyle'
- if: "cacheExtent != '' && cacheExtentStyle == 'CacheExtentStyle.pixel'"
changes:
- kind: 'addParameter'
index: 0
name: 'scrollCacheExtent'
style: optional_named
argumentValue:
expression: 'ScrollCacheExtent.pixels({% cacheExtent %})'
requiredIf: "cacheExtent != '' && cacheExtentStyle == 'CacheExtentStyle.pixel'"
- kind: 'removeParameter'
name: 'cacheExtent'
- kind: 'removeParameter'
name: 'cacheExtentStyle'
- if: "cacheExtent != '' && cacheExtentStyle == ''"
changes:
- kind: 'addParameter'
index: 0
name: 'scrollCacheExtent'
style: optional_named
argumentValue:
expression: 'ScrollCacheExtent.pixels({% cacheExtent %})'
requiredIf: "cacheExtent != '' && cacheExtentStyle == ''"
- kind: 'removeParameter'
name: 'cacheExtent'
variables:
cacheExtent:
kind: 'fragment'
value: 'arguments[cacheExtent]'
cacheExtentStyle:
kind: 'fragment'
value: 'arguments[cacheExtentStyle]'
# Change made in https://github.com/flutter/flutter/pull/128522
- title: "Migrate to 'textScaler'"
date: 2023-06-09
element:
uris: [ 'rendering.dart' ]
constructor: ''
inClass: 'RenderParagraph'
changes:
- kind: 'addParameter'
index: 5
name: 'textScaler'
style: optional_named
argumentValue:
expression: 'TextScaler.linear({% textScaleFactor %})'
requiredIf: "textScaleFactor != ''"
- kind: 'removeParameter'
name: 'textScaleFactor'
variables:
textScaleFactor:
kind: 'fragment'
value: 'arguments[textScaleFactor]'
# Change made in https://github.com/flutter/flutter/pull/128522
- title: "Migrate to 'textScaler'"
date: 2023-06-09
element:
uris: [ 'rendering.dart' ]
constructor: ''
inClass: 'RenderEditable'
changes:
- kind: 'addParameter'
index: 15
name: 'textScaler'
style: optional_named
argumentValue:
expression: 'TextScaler.linear({% textScaleFactor %})'
requiredIf: "textScaleFactor != ''"
- kind: 'removeParameter'
name: 'textScaleFactor'
variables:
textScaleFactor:
kind: 'fragment'
value: 'arguments[textScaleFactor]'
# Changes made in https://github.com/flutter/flutter/pull/66305
- title: "Migrate to 'clipBehavior'"
date: 2020-09-22
element:
uris: [ 'rendering.dart' ]
field: 'overflow'
inClass: 'RenderStack'
changes:
- kind: 'rename'
newName: 'clipBehavior'
# Changes made in https://github.com/flutter/flutter/pull/66305
- title: "Migrate to 'clipBehavior'"
date: 2020-09-22
element:
uris: [ 'rendering.dart' ]
constructor: ''
inClass: 'RenderStack'
oneOf:
- if: "overflow == 'Overflow.clip'"
changes:
- kind: 'addParameter'
index: 0
name: 'clipBehavior'
style: optional_named
argumentValue:
expression: 'Clip.hardEdge'
requiredIf: "overflow == 'Overflow.clip'"
- kind: 'removeParameter'
name: 'overflow'
- if: "overflow == 'Overflow.visible'"
changes:
- kind: 'addParameter'
index: 0
name: 'clipBehavior'
style: optional_named
argumentValue:
expression: 'Clip.none'
requiredIf: "overflow == 'Overflow.visible'"
- kind: 'removeParameter'
name: 'overflow'
variables:
overflow:
kind: 'fragment'
value: 'arguments[overflow]'
# Changes made in https://docs.flutter.dev/release/breaking-changes/clip-behavior
- title: "Migrate to 'clipBehavior'"
date: 2020-08-20
element:
uris: [ 'rendering.dart' ]
field: 'clipToSize'
inClass: 'RenderListWheelViewport'
changes:
- kind: 'rename'
newName: 'clipBehavior'
# Changes made in https://docs.flutter.dev/release/breaking-changes/clip-behavior
- title: "Migrate to 'clipBehavior'"
date: 2020-08-20
element:
uris: [ 'rendering.dart' ]
constructor: ''
inClass: 'RenderListWheelViewport'
oneOf:
- if: "clipToSize == 'true'"
changes:
- kind: 'addParameter'
index: 13
name: 'clipBehavior'
style: optional_named
argumentValue:
expression: 'Clip.hardEdge'
requiredIf: "clipToSize == 'true'"
- kind: 'removeParameter'
name: 'clipToSize'
- if: "clipToSize == 'false'"
changes:
- kind: 'addParameter'
index: 13
name: 'clipBehavior'
style: optional_named
argumentValue:
expression: 'Clip.none'
requiredIf: "clipToSize == 'false'"
- kind: 'removeParameter'
name: 'clipToSize'
variables:
clipToSize:
kind: 'fragment'
value: 'arguments[clipToSize]'
# Before adding a new fix: read instructions at the top of this file.