What’s Dismissible?

The Dismissible class is a widget in Flutter that allows users to dismiss a widget by dragging it in a specified direction. It provides a smooth sliding animation and can be used to remove items from lists with swipe gestures.

Check the official documentation for more.

Dismissible explained for Android Developers

For Android developers, the Dismissible widget can be compared to the swipe-to-dismiss functionality often seen in RecyclerViews. Just like in Android, where you can implement swipe gestures to remove items, the Dismissible widget allows for similar interactions in Flutter. It also supports callbacks for actions taken after the item is dismissed, akin to how you might handle item removal in Android.

Example Code

Here is an example of how to use Dismissible:

Dismissible(
key: Key(item.id),
onDismissed: (direction) {
// Remove the item from the data source
},
child: ListTile(
title: Text(item.title),
),
);

Dismissible Remarks

The Dismissible widget is a powerful tool for creating interactive and user-friendly interfaces in Flutter. By leveraging its capabilities, developers can enhance the user experience with intuitive swipe actions.

Bootstrap Your app with ShipFlutter

A fully customizable starter kit to seamlessly launch responsive Android, iOS, and Web apps with Flutter powered by Firebase and Vertex AI.