Skip to content

Flutter slidable onDismissed error when delete middle item  #500

Open
@johny444

Description

Hi all I've some problem with flutter_slidable on onDismissed function it's work when dismiss the last item but I don't know why when do it when the first or middle item it's error
_:═╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═
The following assertion was thrown building SlidableDismissal(state:
SlidableDismissalState#a0f44(ticker inactive)):
A dismissed Slidable widget is still part of the tree.
Make sure to implement the onDismissed handle of the ActionPane and to immediately remove the
Slidable widget from the application once that handler has fired.

I need some help please and this my code on startActionPane:
```
startActionPane: ActionPane(
motion: ScrollMotion(),
dismissible: DismissiblePane(
key: ValueKey(item.id),
onDismissed: () {
// setState(() {
// noteslist.removeAt(i);
// });
firestore_Datasource().delete_note(item.id);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content:
Text('Delete ${item.detail}')));
},
),
children: [
SlidableAction(
onPressed: (context) {},
backgroundColor: Color(0xFFFE4A49),
foregroundColor: Colors.white,
icon: Icons.delete,
label: 'Delete',
),
],
),

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions