im trying to make ondismmed for listview but i dont want to let user delete all children of the listview so when the listview has only 1 child the dismissble is disabled so how to do it???
onDismissed: (direction) {
var item = containers.elementAt(index);
if(containers.length > 1){
deleteItem(index);
Scaffold.of(context).showSnackBar(
SnackBar(
content: Text("Item deleted"),
action: SnackBarAction(
label: "UNDO",
onPressed: () {
undoDeletion(index, item);
}
)
)
);
}
},
);