Commit ff45d506 authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Remove explicit width in ListTile trailing element (#12221)

It was incorrectly added in #11858
parent 47c387b6
...@@ -432,7 +432,6 @@ class ListTile extends StatelessWidget { ...@@ -432,7 +432,6 @@ class ListTile extends StatelessWidget {
data: iconThemeData, data: iconThemeData,
child: new Container( child: new Container(
margin: const EdgeInsetsDirectional.only(start: 16.0), margin: const EdgeInsetsDirectional.only(start: 16.0),
width: 40.0,
alignment: FractionalOffsetDirectional.centerEnd, alignment: FractionalOffsetDirectional.centerEnd,
child: trailing, child: trailing,
), ),
......
...@@ -77,6 +77,8 @@ void main() { ...@@ -77,6 +77,8 @@ void main() {
double right(String text) => tester.getTopRight(find.text(text)).dx; double right(String text) => tester.getTopRight(find.text(text)).dx;
double top(String text) => tester.getTopLeft(find.text(text)).dy; double top(String text) => tester.getTopLeft(find.text(text)).dy;
double bottom(String text) => tester.getBottomLeft(find.text(text)).dy; double bottom(String text) => tester.getBottomLeft(find.text(text)).dy;
double width(String text) => tester.getSize(find.text(text)).width;
double height(String text) => tester.getSize(find.text(text)).height;
// 16.0 padding to the left and right of the leading and trailing widgets // 16.0 padding to the left and right of the leading and trailing widgets
void testHorizontalGeometry() { void testHorizontalGeometry() {
...@@ -86,12 +88,14 @@ void main() { ...@@ -86,12 +88,14 @@ void main() {
expect(left('subtitle'), 72.0); expect(left('subtitle'), 72.0);
expect(left('title'), right('leading') + 16.0); expect(left('title'), right('leading') + 16.0);
expect(right('trailing'), 800.0 - 16.0); expect(right('trailing'), 800.0 - 16.0);
expect(width('trailing'), 112.0);
} }
void testVerticalGeometry(double expectedHeight) { void testVerticalGeometry(double expectedHeight) {
expect(tester.getSize(find.byType(ListTile)), new Size(800.0, expectedHeight)); expect(tester.getSize(find.byType(ListTile)), new Size(800.0, expectedHeight));
if (hasSubtitle) if (hasSubtitle)
expect(top('subtitle'), bottom('title')); expect(top('subtitle'), bottom('title'));
expect(height('trailing'), 14.0); // Fits on one line (doesn't wrap)
} }
await tester.pumpWidget(buildFrame()); await tester.pumpWidget(buildFrame());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment