Skip to content

Commit 65124c5

Browse files
authored
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 flutter/flutter#161235 ## Tests Adds 1 test.
1 parent 5ce5251 commit 65124c5

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

packages/flutter/lib/fix_data/fix_material/fix_input_decoration.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,41 @@
1818
# * Fixes in this file are for InputDecoration and InputDecorationTheme from the Material library. *
1919
version: 1
2020
transforms:
21+
# Changes made in https://github.com/flutter/flutter/pull/161235.
22+
- title: "Migrate to 'maintainHintSize'"
23+
date: 2025-01-24
24+
element:
25+
uris: [ 'material.dart' ]
26+
constructor: ''
27+
inClass: 'InputDecoration'
28+
changes:
29+
- kind: 'renameParameter'
30+
oldName: 'maintainHintHeight'
31+
newName: 'maintainHintSize'
32+
33+
# Changes made in https://github.com/flutter/flutter/pull/161235.
34+
- title: "Migrate to 'maintainHintSize'"
35+
date: 2025-01-24
36+
element:
37+
uris: [ 'material.dart' ]
38+
constructor: 'collapsed'
39+
inClass: 'InputDecoration'
40+
changes:
41+
- kind: 'renameParameter'
42+
oldName: 'maintainHintHeight'
43+
newName: 'maintainHintSize'
44+
45+
# Changes made in https://github.com/flutter/flutter/pull/161235.
46+
- title: "Migrate to 'maintainHintSize'"
47+
date: 2025-01-24
48+
element:
49+
uris: [ 'material.dart' ]
50+
field: 'maintainHintHeight'
51+
inClass: 'InputDecoration'
52+
changes:
53+
- kind: 'rename'
54+
newName: 'maintainHintSize'
55+
2156
# Changes made in https://github.com/flutter/flutter/pull/152486.
2257
- title: "Remove invalid parameter"
2358
date: 2024-07-27

packages/flutter/test_fixes/material/input_decorator.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,12 @@ void main() {
3535
floatingLabelAlignment: FloatingLabelAlignment.center,
3636
floatingLabelBehavior: FloatingLabelBehavior.always,
3737
);
38+
39+
// Changes made in https://github.com/flutter/flutter/pull/161235.
40+
const InputDecoration decoration = InputDecoration(maintainHintHeight: false);
41+
decoration.maintainHintHeight;
42+
43+
const InputDecoration decoration = InputDecoration.collapsed(
44+
maintainHintHeight: false,
45+
);
3846
}

packages/flutter/test_fixes/material/input_decorator.dart.expect

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,12 @@ void main() {
3333
const InputDecoration decoration = InputDecoration.collapsed(
3434
hintText: 'Hint',
3535
);
36+
37+
// Changes made in https://github.com/flutter/flutter/pull/161235.
38+
const InputDecoration decoration = InputDecoration(maintainHintSize: false);
39+
decoration.maintainHintSize;
40+
41+
const InputDecoration decoration = InputDecoration.collapsed(
42+
maintainHintSize: false,
43+
);
3644
}

0 commit comments

Comments
 (0)