我需要在我的重新排序列表中包含使用滑动删除项目的选项。问题是 ReorderableListView 小部件收到一个列表,因此我无法添加 Dismissible() 小部件。有什么办法可以解决这个问题吗?
Widget _buildReorderableListSimple(BuildContext context) {
return ReorderableListView(
onReorder: _onReorder,
children: _getListItems(),
);
}
List<ListTile> _getListItems() => _items
.map(
(Song item) => _buildTenableListTile(context, item),
)
.toList();
ListTile _buildTenableListTile(Song item, int index) {
return ListTile(
key: ValueKey(item.songId),
title: new Text(
'${item.sequence}. ${item.name}',
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
subtitle: new Text(
'${item.artist} ${item.songId}',
style: TextStyle(
color: Colors.black,
),
),
onTap: () {
},
);
}
Run Code Online (Sandbox Code Playgroud) flutter ×1