我的卡片使用的是整个屏幕的宽度,而宽度在SizedBox
到50之间(比屏幕小得多).到底怎么回事?以下是我的代码:
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListView(
children: const [
SizedBox(
width: 50,
child: Card(
child: Row(
children: [
Text('test'),
]),
),
),
]
);
}
}