【发布时间】:2023-04-11 02:39:01
【问题描述】:
使用这个简单的设计,如何在列表视图下显示第二张图片?实际上,该列表将从 Firebase 中获取,其中每个项目都是一个 ExpansionTile,因此列表视图的高度无法固定。
该列应该是可滚动的,以便在向下滚动列表下方时可以看到完整的图像。
import 'package:flutter/material.dart';
List<Widget> list = <Widget>[
ListTile(
title: Text('CineArts at the Empire',
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 20.0)),
subtitle: Text('85 W Portal Ave'),
leading: Icon(
Icons.theaters,
color: Colors.blue[500],
),
),
ListTile(
title: Text('The Castro Theater',
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 20.0)),
subtitle: Text('429 Castro St'),
leading: Icon(
Icons.theaters,
color: Colors.blue[500],
),
),
];
class CartWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SafeArea(
child: Column(children: <Widget>[
Image.network("https://via.placeholder.com/350x150"),
Expanded(
child: ListView(
children: list,
),
),
Image.network("https://via.placeholder.com/350x500"), // error: hides above widget
]));
}
}
【问题讨论】:
标签: dart flutter flutter-layout