mirror of
https://github.com/flutter/flutter
synced 2024-09-21 17:22:30 +00:00
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);
|
||||
|
||||
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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue