Add a data driven fix for InputDecoration.maintainHintHeight (#162600)

## Description

This PR adds a dart fix to migrate from
InputDecoration.maintainHintHeight to InputDecoration.maintainHintSize.

## Related PR

Follow up to https://github.com/flutter/flutter/pull/161235

## Tests

Adds 1 test.
This commit is contained in:
Bruno Leroux 2025-02-05 21:46:22 +01:00 committed by GitHub
parent 5ce5251e40
commit 65124c5765
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 51 additions and 0 deletions

View File

@ -18,6 +18,41 @@
# * Fixes in this file are for InputDecoration and InputDecorationTheme from the Material library. * # * Fixes in this file are for InputDecoration and InputDecorationTheme from the Material library. *
version: 1 version: 1
transforms: transforms:
# Changes made in https://github.com/flutter/flutter/pull/161235.
- title: "Migrate to 'maintainHintSize'"
date: 2025-01-24
element:
uris: [ 'material.dart' ]
constructor: ''
inClass: 'InputDecoration'
changes:
- kind: 'renameParameter'
oldName: 'maintainHintHeight'
newName: 'maintainHintSize'
# Changes made in https://github.com/flutter/flutter/pull/161235.
- title: "Migrate to 'maintainHintSize'"
date: 2025-01-24
element:
uris: [ 'material.dart' ]
constructor: 'collapsed'
inClass: 'InputDecoration'
changes:
- kind: 'renameParameter'
oldName: 'maintainHintHeight'
newName: 'maintainHintSize'
# Changes made in https://github.com/flutter/flutter/pull/161235.
- title: "Migrate to 'maintainHintSize'"
date: 2025-01-24
element:
uris: [ 'material.dart' ]
field: 'maintainHintHeight'
inClass: 'InputDecoration'
changes:
- kind: 'rename'
newName: 'maintainHintSize'
# Changes made in https://github.com/flutter/flutter/pull/152486. # Changes made in https://github.com/flutter/flutter/pull/152486.
- title: "Remove invalid parameter" - title: "Remove invalid parameter"
date: 2024-07-27 date: 2024-07-27

View File

@ -35,4 +35,12 @@ void main() {
floatingLabelAlignment: FloatingLabelAlignment.center, floatingLabelAlignment: FloatingLabelAlignment.center,
floatingLabelBehavior: FloatingLabelBehavior.always, floatingLabelBehavior: FloatingLabelBehavior.always,
); );
// Changes made in https://github.com/flutter/flutter/pull/161235.
const InputDecoration decoration = InputDecoration(maintainHintHeight: false);
decoration.maintainHintHeight;
const InputDecoration decoration = InputDecoration.collapsed(
maintainHintHeight: false,
);
} }

View File

@ -33,4 +33,12 @@ void main() {
const InputDecoration decoration = InputDecoration.collapsed( const InputDecoration decoration = InputDecoration.collapsed(
hintText: 'Hint', hintText: 'Hint',
); );
// Changes made in https://github.com/flutter/flutter/pull/161235.
const InputDecoration decoration = InputDecoration(maintainHintSize: false);
decoration.maintainHintSize;
const InputDecoration decoration = InputDecoration.collapsed(
maintainHintSize: false,
);
} }