Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter slidable onDismissed error when delete middle item #500

Open
johny444 opened this issue Sep 9, 2024 · 0 comments
Open

Flutter slidable onDismissed error when delete middle item #500

johny444 opened this issue Sep 9, 2024 · 0 comments

Comments

@johny444
Copy link

johny444 commented Sep 9, 2024

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',
),
],
),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant