flutter - 如何使用图像 Flutter 创建简单的 Listview
问题描述
我想知道如何实现与此 图像相似或接近的东西,而不是使用卡片,任何示例代码都会受到高度赞赏
解决方案
试试这个代码
ListView.builder(
itemCount: 2,
itemBuilder: (BuildContext context, int index) {
return Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Row(
children: <Widget>[
SizedBox(width: 10.0),
Image.asset(
'Your Asset',
height: 100,
),
SizedBox(width: 20.0),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
'Title Here',
style: TextStyle(
color: Colors.black,
fontSize: 18.0,
fontWeight: FontWeight.w500,
),
),
SizedBox(width: 6.0),
Text(
'Subtitle Here',
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
fontWeight: FontWeight.w300,
),
),
],
),
),
],
),
Divider(
color: Colors.black,
thickness: 1.5,
),
],
);
},
),
推荐阅读
- javascript - Laravel 5.5,使用 3 个下拉按钮过滤器而不重置第一个和第二个过滤器
- image - 如何在 Delphi 2010(VCL) 中使用鼠标平移图像
- vba - 每个唯一键的多个字典(VBA)
- reactjs - 更新了 react-native,现在它不会构建
- objective-c - 我如何以编程方式停止使用 Thread 为 UIActivityIndicatorView 设置动画
- css - 内部 CSS 不适合我
- python - 为什么这个条件不会引发异常:(1==0 <= 1/0) == False?Python如何解析这个?
- java - 通过JSON解析并在java中选择多个项目
- php - Laravel 路由不返回控制器
- php - composer install 不断消耗所有RAM内存