diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart index 988eecd26ba..f50f5798337 100644 --- a/packages/flutter/lib/src/material/input_decorator.dart +++ b/packages/flutter/lib/src/material/input_decorator.dart @@ -2783,8 +2783,7 @@ class InputDecoration { /// The maximum number of lines the [helperText] can occupy. /// - /// Defaults to null, which means that the [helperText] will be limited - /// to a single line with [TextOverflow.ellipsis]. + /// Defaults to null, which means that the [helperText] is not limited. /// /// This value is passed along to the [Text.maxLines] attribute /// of the [Text] widget used to display the helper. @@ -2873,8 +2872,7 @@ class InputDecoration { /// The maximum number of lines the [errorText] can occupy. /// - /// Defaults to null, which means that the [errorText] will be limited - /// to a single line with [TextOverflow.ellipsis]. + /// Defaults to null, which means that the [errorText] is not limited. /// /// This value is passed along to the [Text.maxLines] attribute /// of the [Text] widget used to display the error. diff --git a/packages/flutter/test/material/input_decorator_test.dart b/packages/flutter/test/material/input_decorator_test.dart index 5e3dec436a9..4efdd2a05b1 100644 --- a/packages/flutter/test/material/input_decorator_test.dart +++ b/packages/flutter/test/material/input_decorator_test.dart @@ -3906,6 +3906,23 @@ void main() { expect(getDecoratorRect(tester).height, closeTo(containerHeight + helperGap + errorHeight * numberOfLines, 0.25)); }); + testWidgets('Error height is not limited by default', (WidgetTester tester) async { + const int numberOfLines = 3; + await tester.pumpWidget( + buildInputDecorator( + decoration: const InputDecoration( + labelText: 'label', + errorText: threeLines, + filled: true, + ), + ), + ); + + final Rect errorRect = tester.getRect(find.text(threeLines)); + expect(errorRect.height, closeTo(errorHeight * numberOfLines, 0.25)); + expect(getDecoratorRect(tester).height, closeTo(containerHeight + helperGap + errorHeight * numberOfLines, 0.25)); + }); + testWidgets('Helper height grows to accommodate helper text', (WidgetTester tester) async { const int maxLines = 3; await tester.pumpWidget( @@ -3960,6 +3977,23 @@ void main() { expect(helperRect.height, closeTo(helperHeight * numberOfLines, 0.25)); expect(getDecoratorRect(tester).height, closeTo(containerHeight + helperGap + helperHeight * numberOfLines, 0.25)); }); + + testWidgets('Helper height is not limited by default', (WidgetTester tester) async { + const int numberOfLines = 3; + await tester.pumpWidget( + buildInputDecorator( + decoration: const InputDecoration( + labelText: 'label', + helperText: threeLines, + filled: true, + ), + ), + ); + + final Rect helperRect = tester.getRect(find.text(threeLines)); + expect(helperRect.height, closeTo(helperHeight * numberOfLines, 0.25)); + expect(getDecoratorRect(tester).height, closeTo(containerHeight + helperGap + helperHeight * numberOfLines, 0.25)); + }); }); group('Helper widget', () {