InputDecorator input and hint widgets have the same width (#16894)

This commit is contained in:
Hans Muller 2018-04-23 13:53:15 -07:00 committed by GitHub
parent 286cd35951
commit d3d4976f63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -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;

View file

@ -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 {