How to create a mark as read type of dismissable ListTile just like the one in Gmail App

Hello everyone,

I was working on Dismissable the other day and was trying to implement add to cart functionality.
I wonder is there any way where you just swipe the dismissable like the one in Gmail App for Mark as read and it stays in the ListView but adding the item in the cart. and if you swipe in other direction it will remove the item from the cart.

Any help would be appreciated :blush:

Thanks in advance.

Hey @nikkbh The Dismissible Widget is exactly what you need. Here’s a quick video about it for intro.

https://api.flutter.dev/flutter/widgets/Dismissible-class.html

1 Like

@sakina,I’m trying to automate the swipe gesture pn particular email so that i can perform the actions.Please let me know if you know any supported methods.

Thanks.

@Krrish_12
Pls make a separate thread of your problem, if possible provide a code snippets, and description of what you have tried and what problem you are facing.

You can use confirmDismiss property to check direction eg. if your mark as read is at start to end direction so return false for that.

confirmDismiss: (DismissDirection direction) async {
  if (direction == DismissDirection.startToEnd) {
    return false;
  }
  return true;
},