InputDecorator input and hint widgets have the same width (#16894)
This commit is contained in:
parent
286cd35951
commit
d3d4976f63
@ -771,11 +771,11 @@ class _RenderDecoration extends RenderBox {
|
|||||||
+ contentPadding.right);
|
+ contentPadding.right);
|
||||||
|
|
||||||
boxConstraints = boxConstraints.copyWith(maxWidth: inputWidth);
|
boxConstraints = boxConstraints.copyWith(maxWidth: inputWidth);
|
||||||
layoutLineBox(hint);
|
|
||||||
if (label != null) // The label is not baseline aligned.
|
if (label != null) // The label is not baseline aligned.
|
||||||
label.layout(boxConstraints, parentUsesSize: true);
|
label.layout(boxConstraints, parentUsesSize: true);
|
||||||
|
|
||||||
boxConstraints = boxConstraints.copyWith(minWidth: inputWidth);
|
boxConstraints = boxConstraints.copyWith(minWidth: inputWidth);
|
||||||
|
layoutLineBox(hint);
|
||||||
layoutLineBox(input);
|
layoutLineBox(input);
|
||||||
|
|
||||||
double inputBaseline = contentPadding.top + aboveBaseline;
|
double inputBaseline = contentPadding.top + aboveBaseline;
|
||||||
|
@ -259,6 +259,8 @@ void main() {
|
|||||||
expect(tester.getBottomLeft(find.text('hint')).dy, 28.0);
|
expect(tester.getBottomLeft(find.text('hint')).dy, 28.0);
|
||||||
expect(getBorderBottom(tester), 40.0);
|
expect(getBorderBottom(tester), 40.0);
|
||||||
expect(getBorderWeight(tester), 1.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 {
|
testWidgets('InputDecorator input/label/hint layout', (WidgetTester tester) async {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user