颤振卡视图底部溢出

时间:2019-12-09 08:55:17

标签: flutter flutter-layout

如何在我的应用程序中解决此问题

我的代码



    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']),
            ),
          ]),
    );
  }

How to solve this

i want to make like this

1 个答案:

答案 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'),
                            ),
                          ],
                        ),
                      ),

输出:

enter image description here