Flutter listView 设置分割线
2020-06-08 本文已影响0人
__素颜__
ListView.separated(
//排列方向 垂直和水平
scrollDirection: Axis.vertical,
//分割线构建器
separatorBuilder: (BuildContext context, int index) {
return Divider(height: 2, color: Colors.green);
},
itemBuilder: (BuildContext context, int position) {
return ListTile();
},
itemCount: myList.length);