如何在我的应用程序中解决此问题
我的代码
class StreamBuilderFireStore extends StatelessWidget {
Widget _buildList(BuildContext context, DocumentSnapshot document) {
return Card(
clipBehavior: Clip.antiAlias,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.network(document['img'], fit: BoxFit.cover),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(document['title']),
),
]),
);
}
答案 0 :(得分:1)
尝试这样的事情,
Card(
child: Column(
children: <Widget>[
AspectRatio(
child: Image.network(
'https://images.unsplash.com/photo-1502759683299-cdcd6974244f?auto=format&fit=crop&w=440&h=220&q=60',
fit: BoxFit.cover),
aspectRatio: 2/1,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text('title is heretitle is heretitle is heretitle is heretitle is here'),
),
],
),
),
输出: