我想将两个图标并排放置在 ListTile 的“尾随”一侧。我尝试添加一个 Row 小部件,其中包含两个图标,但它完全搞乱了整个 ListTile 的布局,使其无法使用。有什么办法可以扩大分配给尾部部分的空间吗?
这是代码:
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Welcome to Flutter',
home: Scaffold(
appBar: AppBar(
title: Text('Welcome to Flutter'),
),
body: ListView(
children: <Widget>[
ListTile(
leading: Icon(Icons.play_arrow,),
title: Text("This is a title"),
subtitle: Text("This is subtitle"),
trailing: Row(
children: <Widget>[
Icon(Icons.flight),
Icon(Icons.flight_land)
]),
)
]
),
),
);
}
}
它是这样的:
Adding mainAxisSize: MainAxisSize.min
Row() 实例修复了该问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)