diff --git a/packages/flutter/lib/src/material/dropdown_menu.dart b/packages/flutter/lib/src/material/dropdown_menu.dart index 91ebaa353c..7ae84b4fa0 100644 --- a/packages/flutter/lib/src/material/dropdown_menu.dart +++ b/packages/flutter/lib/src/material/dropdown_menu.dart @@ -47,6 +47,8 @@ const double _kMinimumWidth = 112.0; const double _kDefaultHorizontalPadding = 12.0; +const double _kLeadingIconToInputPadding = 4.0; + /// Defines a [DropdownMenu] menu button that represents one item view in the menu. /// /// See also: @@ -610,7 +612,12 @@ class _DropdownMenuState extends State> { return; } setState(() { - leadingPadding = getWidth(_leadingKey); + final double? leadingWidgetWidth = getWidth(_leadingKey); + if (leadingWidgetWidth != null) { + leadingPadding = leadingWidgetWidth + _kLeadingIconToInputPadding; + } else { + leadingPadding = leadingWidgetWidth; + } }); }, debugLabel: 'DropdownMenu.refreshLeadingPadding'); } @@ -686,7 +693,7 @@ class _DropdownMenuState extends State> { // menu entry have leading icons, the menu entry should remove the extra // paddings so its leading icon will be aligned with the leading icon of // the text field. - final double padding = entry.leadingIcon == null ? (leadingPadding ?? _kDefaultHorizontalPadding) : _kDefaultHorizontalPadding; + final double padding = entry.leadingIcon == null ? (leadingPadding ?? _kDefaultHorizontalPadding) : (_kDefaultHorizontalPadding + _kLeadingIconToInputPadding); ButtonStyle effectiveStyle = entry.style ?? switch (textDirection) { TextDirection.rtl => MenuItemButton.styleFrom(padding: EdgeInsets.only(left: _kDefaultHorizontalPadding, right: padding)), TextDirection.ltr => MenuItemButton.styleFrom(padding: EdgeInsets.only(left: padding, right: _kDefaultHorizontalPadding)), diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart index df07ee4630..9db394dfd2 100644 --- a/packages/flutter/lib/src/material/input_decorator.dart +++ b/packages/flutter/lib/src/material/input_decorator.dart @@ -740,6 +740,8 @@ class _RenderDecoration extends RenderBox with SlottedContainerRenderObjectMixin // TODO(bleroux): consider defining this value as a Material token and making it // configurable by InputDecorationTheme. double get subtextGap => material3 ? 4.0 : 8.0; + double get prefixToInputGap => material3 ? 4.0 : 0.0; + double get inputToSuffixGap => material3 ? 4.0 : 0.0; RenderBox? get icon => childForSlot(_DecorationSlot.icon); RenderBox? get input => childForSlot(_DecorationSlot.input); @@ -997,8 +999,8 @@ class _RenderDecoration extends RenderBox with SlottedContainerRenderObjectMixin final Size suffixSize = suffix == null ? Size.zero : layoutChild(suffix, contentConstraints); final EdgeInsetsDirectional accessoryHorizontalInsets = EdgeInsetsDirectional.only( - start: iconWidth + prefixSize.width + (prefixIcon == null ? contentPadding.start : prefixIconSize.width), - end: suffixSize.width + (suffixIcon == null ? contentPadding.end : suffixIconSize.width), + start: iconWidth + prefixSize.width + (prefixIcon == null ? contentPadding.start : prefixIconSize.width + prefixToInputGap), + end: suffixSize.width + (suffixIcon == null ? contentPadding.end : suffixIconSize.width + inputToSuffixGap), ); final double inputWidth = math.max(0.0, constraints.maxWidth - accessoryHorizontalInsets.horizontal); @@ -1165,25 +1167,25 @@ class _RenderDecoration extends RenderBox with SlottedContainerRenderObjectMixin @override double computeMinIntrinsicWidth(double height) { return _minWidth(icon, height) - + (prefixIcon != null ? 0.0 : contentPadding.start) + + (prefixIcon != null ? prefixToInputGap : contentPadding.start) + _minWidth(prefixIcon, height) + _minWidth(prefix, height) + math.max(_minWidth(input, height), _minWidth(hint, height)) + _minWidth(suffix, height) + _minWidth(suffixIcon, height) - + (suffixIcon != null ? 0.0 : contentPadding.end); + + (suffixIcon != null ? inputToSuffixGap : contentPadding.end); } @override double computeMaxIntrinsicWidth(double height) { return _maxWidth(icon, height) - + (prefixIcon != null ? 0.0 : contentPadding.start) + + (prefixIcon != null ? prefixToInputGap : contentPadding.start) + _maxWidth(prefixIcon, height) + _maxWidth(prefix, height) + math.max(_maxWidth(input, height), _maxWidth(hint, height)) + _maxWidth(suffix, height) + _maxWidth(suffixIcon, height) - + (suffixIcon != null ? 0.0 : contentPadding.end); + + (suffixIcon != null ? inputToSuffixGap : contentPadding.end); } double _lineHeight(double width, List boxes) { @@ -1371,6 +1373,7 @@ class _RenderDecoration extends RenderBox with SlottedContainerRenderObjectMixin if (prefixIcon != null) { start += contentPadding.start; start -= centerLayout(prefixIcon!, start - prefixIcon!.size.width); + start -= prefixToInputGap; } if (label != null) { if (decoration.alignLabelWithHint) { @@ -1391,6 +1394,7 @@ class _RenderDecoration extends RenderBox with SlottedContainerRenderObjectMixin if (suffixIcon != null) { end -= contentPadding.end; end += centerLayout(suffixIcon!, end); + end += inputToSuffixGap; } if (suffix != null) { end += baselineLayout(suffix!, end); @@ -1401,6 +1405,7 @@ class _RenderDecoration extends RenderBox with SlottedContainerRenderObjectMixin if (prefixIcon != null) { start -= contentPadding.start; start += centerLayout(prefixIcon!, start); + start += prefixToInputGap; } if (label != null) { if (decoration.alignLabelWithHint) { @@ -1421,6 +1426,7 @@ class _RenderDecoration extends RenderBox with SlottedContainerRenderObjectMixin if (suffixIcon != null) { end += contentPadding.end; end -= centerLayout(suffixIcon!, end - suffixIcon!.size.width); + end -= inputToSuffixGap; } if (suffix != null) { end -= baselineLayout(suffix!, end - suffix!.size.width); diff --git a/packages/flutter/test/material/dropdown_menu_test.dart b/packages/flutter/test/material/dropdown_menu_test.dart index 4a6a47c143..8aec198fa6 100644 --- a/packages/flutter/test/material/dropdown_menu_test.dart +++ b/packages/flutter/test/material/dropdown_menu_test.dart @@ -14,6 +14,7 @@ void main() { const String longText = 'one two three four five six seven eight nine ten eleven twelve'; final List> menuChildren = >[]; final List> menuChildrenWithIcons = >[]; + const double leadingIconToInputPadding = 4.0; for (final TestMenu value in TestMenu.values) { final DropdownMenuEntry entry = DropdownMenuEntry(value: value, label: value.label); @@ -921,7 +922,7 @@ void main() { final Offset updatedItemTextTopLeft = tester.getTopLeft(updatedItemText); expect(updatedLabelTopLeft.dx, equals(updatedItemTextTopLeft.dx)); - expect(updatedLabelTopLeft.dx, equals(iconWidth)); + expect(updatedLabelTopLeft.dx, equals(iconWidth + leadingIconToInputPadding)); // Test when then leading icon is a widget with a bigger size. await tester.pumpWidget(Container()); @@ -943,7 +944,7 @@ void main() { final Offset updatedItemTextTopLeft1 = tester.getTopLeft(updatedItemText1); expect(updatedLabelTopLeft1.dx, equals(updatedItemTextTopLeft1.dx)); - expect(updatedLabelTopLeft1.dx, equals(largeIconWidth)); + expect(updatedLabelTopLeft1.dx, equals(largeIconWidth + leadingIconToInputPadding)); }); testWidgets('The text in the menu button should be aligned with the text of ' @@ -1002,7 +1003,7 @@ void main() { final Offset updatedItemTextTopRight = tester.getTopRight(updatedItemText); expect(updatedLabelTopRight.dx, equals(updatedItemTextTopRight.dx)); - expect(updatedLabelTopRight.dx, equals(dropdownMenuTopRight.dx - iconWidth)); + expect(updatedLabelTopRight.dx, equals(dropdownMenuTopRight.dx - iconWidth - leadingIconToInputPadding)); // Test when then leading icon is a widget with a bigger size. await tester.pumpWidget(Container()); @@ -1033,7 +1034,7 @@ void main() { final Offset updatedItemTextTopRight1 = tester.getTopRight(updatedItemText1); expect(updatedLabelTopRight1.dx, equals(updatedItemTextTopRight1.dx)); - expect(updatedLabelTopRight1.dx, equals(updatedDropdownMenuTopRight.dx - largeIconWidth)); + expect(updatedLabelTopRight1.dx, equals(updatedDropdownMenuTopRight.dx - largeIconWidth - leadingIconToInputPadding)); }); testWidgets('DropdownMenu has default trailing icon button', (WidgetTester tester) async { @@ -2712,14 +2713,14 @@ void main() { await tester.pumpAndSettle(); // Check text location in text field. - expect(tester.getTopLeft(find.text('Hint')).dx, 48.0); + expect(tester.getTopLeft(find.text('Hint')).dx, 52.0); // By default, the text of item 0 should be aligned with the text of the text field. - expect(tester.getTopLeft(find.text('Item 0').last).dx, 48.0); + expect(tester.getTopLeft(find.text('Item 0').last).dx, 52.0); // By default, the text of item 1 should be aligned with the text of the text field, // so there are some extra padding before "Item 1". - expect(tester.getTopLeft(find.text('Item 1').last).dx, 48.0); + expect(tester.getTopLeft(find.text('Item 1').last).dx, 52.0); }); testWidgets('DropdownMenu can have customized search algorithm', (WidgetTester tester) async { diff --git a/packages/flutter/test/material/input_decorator_test.dart b/packages/flutter/test/material/input_decorator_test.dart index 7120416d26..cfeb0aa01f 100644 --- a/packages/flutter/test/material/input_decorator_test.dart +++ b/packages/flutter/test/material/input_decorator_test.dart @@ -4233,16 +4233,13 @@ void main() { ), ); - // 12 is the left padding. - // TODO(bleroux): consider changing this padding because from M3 spec this should be 16. - expect(getLabelRect(tester).left, 12.0); - // TODO(bleroux): consider changing the input text position because, based on M3 spec, - // the expected horizontal position is 52 (12 padding, 24 icon, 16 gap between icon and input). + // Label left padding is 16.0 (12.0 right padding for a decoration with icons + 4.0 extra padding for the floating label) + expect(getLabelRect(tester).left, 16.0); + // Based on M3 spec, the expected horizontal position is 52 (12 padding, 24 icon, 16 gap between icon and input). // See https://m3.material.io/components/text-fields/specs#1ad2798c-ab41-4f0c-9a97-295ab9b37f33 // (Note that the diagrams on the spec for outlined text field are wrong but the table for // outlined text fields and the diagrams for filled text field point to these values). - // The 48.0 value come from icon min interactive width and height. - expect(getInputRect(tester).left, 48.0); + expect(getInputRect(tester).left, 52.0); }); testWidgets('Label for outlined decoration aligns horizontally with input when alignLabelWithHint is true', (WidgetTester tester) async { @@ -5452,7 +5449,7 @@ void main() { group('for filled text field', () { group('when field is enabled', () { - testWidgets('prefixIcon is correctly positioned', (WidgetTester tester) async { + testWidgets('prefixIcon is correctly positioned - LTR', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( decoration: const InputDecoration( @@ -5472,9 +5469,33 @@ void main() { // Left padding is 12 per Material 3 spec. expect(tester.getRect(findPrefixIconInnerRichText()).left, 12.0); // Check the padding between the prefix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149408. - expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 16.0); + }); + + testWidgets('prefixIcon is correctly positioned - RTL', (WidgetTester tester) async { + await tester.pumpWidget( + buildInputDecorator( + textDirection: TextDirection.rtl, + decoration: const InputDecoration( + filled: true, + labelText: labelText, + prefixIcon: Icon(prefixIcon), + ), + ), + ); + + // By default, the prefix icon is rendered inside a 48x48 constrained box. + expect(getPrefixIconRect(tester).size, const Size(48.0, 48.0)); + // The icon size is 24 per Material 3 spec. + expect(getPrefixIconStyle(tester).fontSize, 24.0); + // Prefix icon is vertically centered inside the container. + expect(getPrefixIconRect(tester).center.dy, getContainerRect(tester).center.dy); + // Right padding is 12 per Material 3 spec. + expect(getDecoratorRect(tester).right - tester.getRect(findPrefixIconInnerRichText()).right, 12.0); + // Check the padding between the prefix icon and the input. + // The gap between the icon and the input should be 16 based on M3 specification. + expect(tester.getRect(findPrefixIconInnerRichText()).left - getInputRect(tester).right, 16.0); }); testWidgets('prefixIcon has correct color', (WidgetTester tester) async { @@ -5493,7 +5514,7 @@ void main() { expect(getPrefixIconStyle(tester).color, expectedColor); }); - testWidgets('suffixIcon is correctly positioned', (WidgetTester tester) async { + testWidgets('suffixIcon is correctly positioned - LTR', (WidgetTester tester) async { await tester.pumpWidget( buildInputDecorator( decoration: const InputDecoration( @@ -5513,9 +5534,33 @@ void main() { // Right padding is 12 per Material 3 spec. expect(getDecoratorRect(tester).right - tester.getRect(findSuffixIconInnerRichText()).right, 12.0); // Check the padding between the suffix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149409. - expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 16.0); + }); + + testWidgets('suffixIcon is correctly positioned - RTL', (WidgetTester tester) async { + await tester.pumpWidget( + buildInputDecorator( + textDirection: TextDirection.rtl, + decoration: const InputDecoration( + filled: true, + labelText: labelText, + suffixIcon: Icon(suffixIcon), + ), + ), + ); + + // By default, the suffix icon is rendered inside a 48x48 constrained box. + expect(getSuffixIconRect(tester).size, const Size(48.0, 48.0)); + // The icon size is 24 per Material 3 spec. + expect(getSuffixIconStyle(tester).fontSize, 24.0); + // Suffix icon is vertically centered inside the container. + expect(getSuffixIconRect(tester).center.dy, getContainerRect(tester).center.dy); + // Left padding is 12 per Material 3 spec. + expect(tester.getRect(findSuffixIconInnerRichText()).left, 12.0); + // Check the padding between the suffix icon and the input. + // The gap between the icon and the input should be 16 based on M3 specification. + expect(getInputRect(tester).left - tester.getRect(findSuffixIconInnerRichText()).right, 16.0); }); testWidgets('suffixIcon has correct color', (WidgetTester tester) async { @@ -5557,9 +5602,8 @@ void main() { // Left padding is 12 per Material 3 spec. expect(tester.getRect(findPrefixIconInnerRichText()).left, 12.0); // Check the padding between the prefix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149408. - expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 16.0); }); testWidgets('prefixIcon has correct color', (WidgetTester tester) async { @@ -5600,9 +5644,8 @@ void main() { // Right padding is 12 per Material 3 spec. expect(getDecoratorRect(tester).right - tester.getRect(findSuffixIconInnerRichText()).right, 12.0); // Check the padding between the suffix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149409. - expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 16.0); }); testWidgets('suffixIcon has correct color', (WidgetTester tester) async { @@ -5645,9 +5688,8 @@ void main() { // Left padding is 12 per Material 3 spec. expect(tester.getRect(findPrefixIconInnerRichText()).left, 12.0); // Check the padding between the prefix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149408. - expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 16.0); }); testWidgets('prefixIcon has correct color', (WidgetTester tester) async { @@ -5688,9 +5730,8 @@ void main() { // Right padding is 12 per Material 3 spec. expect(getDecoratorRect(tester).right - tester.getRect(findSuffixIconInnerRichText()).right, 12.0); // Check the padding between the suffix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149409. - expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 16.0); }); testWidgets('suffixIcon has correct color', (WidgetTester tester) async { @@ -5733,9 +5774,8 @@ void main() { // Left padding is 12 per Material 3 spec. expect(tester.getRect(findPrefixIconInnerRichText()).left, 12.0); // Check the padding between the prefix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149408. - expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 16.0); }); testWidgets('prefixIcon has correct color', (WidgetTester tester) async { @@ -5776,9 +5816,8 @@ void main() { // Right padding is 12 per Material 3 spec. expect(getDecoratorRect(tester).right - tester.getRect(findSuffixIconInnerRichText()).right, 12.0); // Check the padding between the suffix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149409. - expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 16.0); }); testWidgets('suffixIcon has correct color', (WidgetTester tester) async { @@ -5821,9 +5860,8 @@ void main() { // Left padding is 12 per Material 3 spec. expect(tester.getRect(findPrefixIconInnerRichText()).left, 12.0); // Check the padding between the prefix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149408. - expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 16.0); }); testWidgets('prefixIcon has correct color', (WidgetTester tester) async { @@ -5882,9 +5920,8 @@ void main() { // Right padding is 12 per Material 3 spec. expect(getDecoratorRect(tester).right - tester.getRect(findSuffixIconInnerRichText()).right, 12.0); // Check the padding between the suffix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149409. - expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 16.0); }); testWidgets('suffixIcon has correct color', (WidgetTester tester) async { @@ -5946,9 +5983,8 @@ void main() { // Left padding is 12 per Material 3 spec. expect(tester.getRect(findPrefixIconInnerRichText()).left, 12.0); // Check the padding between the prefix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149408. - expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 16.0); }); testWidgets('prefixIcon has correct color', (WidgetTester tester) async { @@ -5987,9 +6023,8 @@ void main() { // Right padding is 12 per Material 3 spec. expect(getDecoratorRect(tester).right - tester.getRect(findSuffixIconInnerRichText()).right, 12.0); // Check the padding between the suffix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149409. - expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 16.0); }); testWidgets('suffixIcon has correct color', (WidgetTester tester) async { @@ -6031,9 +6066,8 @@ void main() { // Left padding is 12 per Material 3 spec. expect(tester.getRect(findPrefixIconInnerRichText()).left, 12.0); // Check the padding between the prefix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149408. - expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 16.0); }); testWidgets('prefixIcon has correct color', (WidgetTester tester) async { @@ -6074,9 +6108,8 @@ void main() { // Right padding is 12 per Material 3 spec. expect(getDecoratorRect(tester).right - tester.getRect(findSuffixIconInnerRichText()).right, 12.0); // Check the padding between the suffix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149409. - expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 16.0); }); testWidgets('suffixIcon has correct color', (WidgetTester tester) async { @@ -6119,9 +6152,8 @@ void main() { // Left padding is 12 per Material 3 spec. expect(tester.getRect(findPrefixIconInnerRichText()).left, 12.0); // Check the padding between the prefix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149408. - expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 16.0); }); testWidgets('prefixIcon has correct color', (WidgetTester tester) async { @@ -6162,9 +6194,8 @@ void main() { // Right padding is 12 per Material 3 spec. expect(getDecoratorRect(tester).right - tester.getRect(findSuffixIconInnerRichText()).right, 12.0); // Check the padding between the suffix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149409. - expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 16.0); }); testWidgets('suffixIcon has correct color', (WidgetTester tester) async { @@ -6207,9 +6238,8 @@ void main() { // Left padding is 12 per Material 3 spec. expect(tester.getRect(findPrefixIconInnerRichText()).left, 12.0); // Check the padding between the prefix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149408. - expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 16.0); }); testWidgets('prefixIcon has correct color', (WidgetTester tester) async { @@ -6250,9 +6280,8 @@ void main() { // Right padding is 12 per Material 3 spec. expect(getDecoratorRect(tester).right - tester.getRect(findSuffixIconInnerRichText()).right, 12.0); // Check the padding between the suffix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149409. - expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 16.0); }); testWidgets('suffixIcon has correct color', (WidgetTester tester) async { @@ -6295,9 +6324,8 @@ void main() { // Left padding is 12 per Material 3 spec. expect(tester.getRect(findPrefixIconInnerRichText()).left, 12.0); // Check the padding between the prefix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149408. - expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(getInputRect(tester).left - tester.getRect(findPrefixIconInnerRichText()).right, 16.0); }); testWidgets('prefixIcon has correct color', (WidgetTester tester) async { @@ -6356,9 +6384,8 @@ void main() { // Right padding is 12 per Material 3 spec. expect(getDecoratorRect(tester).right - tester.getRect(findSuffixIconInnerRichText()).right, 12.0); // Check the padding between the suffix icon and the input. - // TODO(bleroux): the gap between the icon and the input should be 16 based on M3 specification. - // See https://github.com/flutter/flutter/issues/149409. - expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 12.0); + // The gap between the icon and the input should be 16 based on M3 specification. + expect(tester.getRect(findSuffixIconInnerRichText()).left - getInputRect(tester).right, 16.0); }); testWidgets('suffixIcon has correct color', (WidgetTester tester) async {