flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
166.74k stars 27.63k forks source link

Add dismissLimits to Dismissible to limit the drag extent #88515

Open Bonsai11 opened 3 years ago

Bonsai11 commented 3 years ago

Use case

Currently, the Dismissible widget can be swiped the complete width, completely hiding the swiped item. Having the possiblity to set some kind of limit, similar to dismissThresholds but as a maximum, makes it possible to show the background widget while still seeing part of the to be dismissed item.

Proposal

Just like dismissThresholds, add something like a dismissLimits parameter where you can specify a maximum for each DismissDirection, which prevents the animition to go the full width but instead to a user chosen percentage. In my case, you would only be able to swipe to about 20%, showing a delete icon in the background followed by a dialog to confirm the delete.

chinmoy12c commented 3 years ago

I think what you want can be achieved using this package https://github.com/letsar/flutter_slidable. Please confirm if this matches your use case. 😄

Bonsai11 commented 3 years ago

I think what you want can be achieved using this package https://github.com/letsar/flutter_slidable. Please confirm if this matches your use case. 😄

That might be but I would rather see such features in the official widget instead of forcing people to add another dependency to their projects. If Flutter didn't have a Dismissible widget already, then using an externel package should be okay.

gruvw commented 2 years ago

They should definitely add support for fixed length slidable.

tharun797 commented 12 months ago

is there any workaround for this?

Velkamhell97 commented 12 hours ago

Any update ?