diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart index 358527c8bc..af012b7338 100644 --- a/packages/flutter/lib/src/material/input_decorator.dart +++ b/packages/flutter/lib/src/material/input_decorator.dart @@ -771,11 +771,11 @@ class _RenderDecoration extends RenderBox { + contentPadding.right); boxConstraints = boxConstraints.copyWith(maxWidth: inputWidth); - layoutLineBox(hint); if (label != null) // The label is not baseline aligned. label.layout(boxConstraints, parentUsesSize: true); boxConstraints = boxConstraints.copyWith(minWidth: inputWidth); + layoutLineBox(hint); layoutLineBox(input); double inputBaseline = contentPadding.top + aboveBaseline; diff --git a/packages/flutter/test/material/input_decorator_test.dart b/packages/flutter/test/material/input_decorator_test.dart index b9d3dbcdf4..a3861c03f1 100644 --- a/packages/flutter/test/material/input_decorator_test.dart +++ b/packages/flutter/test/material/input_decorator_test.dart @@ -259,6 +259,8 @@ void main() { expect(tester.getBottomLeft(find.text('hint')).dy, 28.0); expect(getBorderBottom(tester), 40.0); expect(getBorderWeight(tester), 1.0); + + expect(tester.getSize(find.text('hint')).width, tester.getSize(find.text('text')).width); }); testWidgets('InputDecorator input/label/hint layout', (WidgetTester tester) async {