我需要创建一个列表,它应该能够重新排序,但我也应该能够删除一个项目,如果拖到一个特定的拖动目标。现在,我已经在两个不同的屏幕中合并了这两个功能。一个使用ReorderabelListView,另一个使用Draggable。有没有办法把两者结合起来?
发布于 2021-05-19 10:28:33
您可以使用reorderables plugin完成此操作
ReorderableColumn(
onReorder: (oldIndex, newIndex) {
},
children: someList.map((item) {
final index = someList.indexOf(item);
return Dismissible(
key: ObjectKey(item),
onDismissed: (direction) {
},
background: Container(color: Colors.red),
child: Container(),
);
}).toList(),
);https://stackoverflow.com/questions/67594995
复制相似问题