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. Key methods include onDismissed, which is called when the widget is dismissed, and resizeDuration, which controls the animation duration when the widget collapses.

Check the official documentation for more.

Dismissible explained for Web Developers

From a web developer’s perspective, the Dismissible class can be compared to swipe actions in web frameworks like React or Vue, where components can be removed from the DOM through user interactions. It provides a similar user experience to swipeable cards in mobile applications, allowing for intuitive item management.

Example Code

Here is an example of how to use Dismissible:

Dismissible(
key: Key('item'),
onDismissed: (direction) {
// Remove the item from the data source
},
child: ListTile(
title: Text('Swipe me to dismiss'),
),
);

Dismissible Remarks

The Dismissible class enhances user experience by allowing intuitive swipe gestures to manage items, making it a valuable tool for Flutter developers.

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.