@@ -740,6 +740,8 @@ class _RenderDecoration extends RenderBox with SlottedContainerRenderObjectMixin
740740 // TODO(bleroux): consider defining this value as a Material token and making it
741741 // configurable by InputDecorationTheme.
742742 double get subtextGap => material3 ? 4.0 : 8.0 ;
743+ double get prefixToInputGap => material3 ? 4.0 : 0.0 ;
744+ double get inputToSuffixGap => material3 ? 4.0 : 0.0 ;
743745
744746 RenderBox ? get icon => childForSlot (_DecorationSlot .icon);
745747 RenderBox ? get input => childForSlot (_DecorationSlot .input);
@@ -997,8 +999,8 @@ class _RenderDecoration extends RenderBox with SlottedContainerRenderObjectMixin
997999 final Size suffixSize = suffix == null ? Size .zero : layoutChild (suffix, contentConstraints);
9981000
9991001 final EdgeInsetsDirectional accessoryHorizontalInsets = EdgeInsetsDirectional .only (
1000- start: iconWidth + prefixSize.width + (prefixIcon == null ? contentPadding.start : prefixIconSize.width),
1001- end: suffixSize.width + (suffixIcon == null ? contentPadding.end : suffixIconSize.width),
1002+ start: iconWidth + prefixSize.width + (prefixIcon == null ? contentPadding.start : prefixIconSize.width + prefixToInputGap ),
1003+ end: suffixSize.width + (suffixIcon == null ? contentPadding.end : suffixIconSize.width + inputToSuffixGap ),
10021004 );
10031005
10041006 final double inputWidth = math.max (0.0 , constraints.maxWidth - accessoryHorizontalInsets.horizontal);
@@ -1165,25 +1167,25 @@ class _RenderDecoration extends RenderBox with SlottedContainerRenderObjectMixin
11651167 @override
11661168 double computeMinIntrinsicWidth (double height) {
11671169 return _minWidth (icon, height)
1168- + (prefixIcon != null ? 0.0 : contentPadding.start)
1170+ + (prefixIcon != null ? prefixToInputGap : contentPadding.start)
11691171 + _minWidth (prefixIcon, height)
11701172 + _minWidth (prefix, height)
11711173 + math.max (_minWidth (input, height), _minWidth (hint, height))
11721174 + _minWidth (suffix, height)
11731175 + _minWidth (suffixIcon, height)
1174- + (suffixIcon != null ? 0.0 : contentPadding.end);
1176+ + (suffixIcon != null ? inputToSuffixGap : contentPadding.end);
11751177 }
11761178
11771179 @override
11781180 double computeMaxIntrinsicWidth (double height) {
11791181 return _maxWidth (icon, height)
1180- + (prefixIcon != null ? 0.0 : contentPadding.start)
1182+ + (prefixIcon != null ? prefixToInputGap : contentPadding.start)
11811183 + _maxWidth (prefixIcon, height)
11821184 + _maxWidth (prefix, height)
11831185 + math.max (_maxWidth (input, height), _maxWidth (hint, height))
11841186 + _maxWidth (suffix, height)
11851187 + _maxWidth (suffixIcon, height)
1186- + (suffixIcon != null ? 0.0 : contentPadding.end);
1188+ + (suffixIcon != null ? inputToSuffixGap : contentPadding.end);
11871189 }
11881190
11891191 double _lineHeight (double width, List <RenderBox ?> boxes) {
@@ -1371,6 +1373,7 @@ class _RenderDecoration extends RenderBox with SlottedContainerRenderObjectMixin
13711373 if (prefixIcon != null ) {
13721374 start += contentPadding.start;
13731375 start -= centerLayout (prefixIcon! , start - prefixIcon! .size.width);
1376+ start -= prefixToInputGap;
13741377 }
13751378 if (label != null ) {
13761379 if (decoration.alignLabelWithHint) {
@@ -1391,6 +1394,7 @@ class _RenderDecoration extends RenderBox with SlottedContainerRenderObjectMixin
13911394 if (suffixIcon != null ) {
13921395 end -= contentPadding.end;
13931396 end += centerLayout (suffixIcon! , end);
1397+ end += inputToSuffixGap;
13941398 }
13951399 if (suffix != null ) {
13961400 end += baselineLayout (suffix! , end);
@@ -1401,6 +1405,7 @@ class _RenderDecoration extends RenderBox with SlottedContainerRenderObjectMixin
14011405 if (prefixIcon != null ) {
14021406 start -= contentPadding.start;
14031407 start += centerLayout (prefixIcon! , start);
1408+ start += prefixToInputGap;
14041409 }
14051410 if (label != null ) {
14061411 if (decoration.alignLabelWithHint) {
@@ -1421,6 +1426,7 @@ class _RenderDecoration extends RenderBox with SlottedContainerRenderObjectMixin
14211426 if (suffixIcon != null ) {
14221427 end += contentPadding.end;
14231428 end -= centerLayout (suffixIcon! , end - suffixIcon! .size.width);
1429+ end -= inputToSuffixGap;
14241430 }
14251431 if (suffix != null ) {
14261432 end -= baselineLayout (suffix! , end - suffix! .size.width);
0 commit comments