Commit 3412fd7
Fix InputDecorator label padding (flutter#173344)
## Description
This PR fixes the label padding for an InputDecorator with prefixIcon
and/or suffixIcon.
# Before
The label was shorter than the available space because
`InputDecoration.contentPadding.horizontal` was applied even when
`prefixIcon` and `suffixIcon` were defined. The icons width replaces the
corresponding `contentPadding`, so both should not be used at the same
time to compute the available space.
<img width="269" height="61" alt="image"
src="https://github.com/user-attachments/assets/e1433ffb-8f17-46fe-9a65-6b9a504ef043"
/>
# After
The label takes all the available space.
<img width="269" height="61" alt="image"
src="https://github.com/user-attachments/assets/12e8d087-c75b-48c9-8df4-1b11207c0e73"
/>
## Related Issue
Fixes [Label padding is wrong for InputDecorator with prefixIcon and/or
suffixIcon ](flutter#173341)
## Tests
Adds 1 test.1 parent 70861ec commit 3412fd7
File tree
3 files changed
+85
-17
lines changed- packages/flutter
- lib/src/material
- test/material
3 files changed
+85
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1404 | 1404 | | |
1405 | 1405 | | |
1406 | 1406 | | |
1407 | | - | |
| 1407 | + | |
1408 | 1408 | | |
1409 | 1409 | | |
1410 | | - | |
| 1410 | + | |
1411 | 1411 | | |
1412 | 1412 | | |
1413 | 1413 | | |
1414 | | - | |
| 1414 | + | |
1415 | 1415 | | |
1416 | | - | |
| 1416 | + | |
1417 | 1417 | | |
1418 | 1418 | | |
1419 | 1419 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1012 | 1012 | | |
1013 | 1013 | | |
1014 | 1014 | | |
1015 | | - | |
| 1015 | + | |
1016 | 1016 | | |
1017 | 1017 | | |
1018 | 1018 | | |
1019 | 1019 | | |
1020 | 1020 | | |
1021 | 1021 | | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
| 1022 | + | |
| 1023 | + | |
1025 | 1024 | | |
1026 | 1025 | | |
1027 | 1026 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2951 | 2951 | | |
2952 | 2952 | | |
2953 | 2953 | | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
2954 | 3019 | | |
2955 | 3020 | | |
2956 | 3021 | | |
| |||
8770 | 8835 | | |
8771 | 8836 | | |
8772 | 8837 | | |
8773 | | - | |
8774 | | - | |
8775 | | - | |
8776 | | - | |
8777 | | - | |
8778 | | - | |
8779 | | - | |
8780 | | - | |
8781 | | - | |
| 8838 | + | |
| 8839 | + | |
| 8840 | + | |
| 8841 | + | |
| 8842 | + | |
| 8843 | + | |
| 8844 | + | |
| 8845 | + | |
| 8846 | + | |
| 8847 | + | |
| 8848 | + | |
| 8849 | + | |
| 8850 | + | |
8782 | 8851 | | |
8783 | 8852 | | |
8784 | 8853 | | |
| |||
0 commit comments