【发布时间】:2019-08-29 17:27:28
【问题描述】:
使用 ListView.separated 我们可以在列表项之间添加 Divider(),但是,一旦我转换到 SliverList,我就看不到我的分隔符了。
delegate: SliverChildBuilderDelegate(
// displays the index of the current item.
(context, index) => new ListTile(
title: Text(_sagItems[index].manufacturer, style: TextStyle(fontSize: 18),),
subtitle: Text(_sagItems[index].model, style: TextStyle(fontSize: 16)),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => DetailScreen(sagitem: _sagItems[index]),
),
);
},
),
//DIVIDER NOT WORKING HERE
Divider(color: Colors.blueGrey),
childCount: _sagItems.length,
),
用 SliverList 添加分隔符的关键是什么?
【问题讨论】: