diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart index 31aa46ae37..36fcaff43e 100644 --- a/packages/flutter/lib/src/material/input_decorator.dart +++ b/packages/flutter/lib/src/material/input_decorator.dart @@ -1268,13 +1268,12 @@ class _RenderDecoration extends RenderBox { final double containerHeight = contentPadding.top + (label == null ? 0.0 : decoration.floatingLabelHeight) + _lineHeight(width, [prefix, input, suffix]) - + subtextHeight + contentPadding.bottom + densityOffset.dy; final double minContainerHeight = decoration.isDense! || expands ? 0.0 : kMinInteractiveDimension; - return math.max(containerHeight, minContainerHeight); + return math.max(containerHeight, minContainerHeight) + subtextHeight; } @override diff --git a/packages/flutter/test/material/input_decorator_test.dart b/packages/flutter/test/material/input_decorator_test.dart index a74c206f7e..0b56a55e12 100644 --- a/packages/flutter/test/material/input_decorator_test.dart +++ b/packages/flutter/test/material/input_decorator_test.dart @@ -4548,4 +4548,29 @@ void main() { expect(errorDetails?.toString(), contains("InputDecorator's children reported a negative baseline")); expect(errorDetails?.toString(), contains('RenderStack')); }); + + testWidgets('min intrinsic height for TextField with no content padding', (WidgetTester tester) async { + // Regression test for: https://github.com/flutter/flutter/issues/75509 + await tester.pumpWidget(MaterialApp( + home: Material( + child: Center( + child: IntrinsicHeight( + child: Column( + children: const [ + TextField( + decoration: InputDecoration( + labelText: 'Label Text', + helperText: 'Helper Text', + contentPadding: EdgeInsets.zero, + ), + ), + ], + ), + ), + ), + ), + )); + + expect(tester.takeException(), isNull); + }); }