gaurishankar007 / flutter_sliding_toast

MIT License
1 stars 0 forks source link

Function to dismiss Toast(s) #2

Closed jeansusgodney closed 2 months ago

jeansusgodney commented 3 months ago

Is your feature request related to a problem? Please describe. I would like to have a possibility to dismiss previously displayed Toast / dismiss all displayed Toasts. I have checked that other packages do this but I would love to keep using flutter sliding toast since they look the most beautiful to be honest.

Describe the solution you'd like Something like SlidingToast().dismissAll(); or a dismissOtherOnShow flag in the parameter would be nice.

Describe alternatives you've considered Stack visible Toast on top of each other

gaurishankar007 commented 3 months ago

Thank your for your feedback, but I did not understand your problem statement clearly. So, can you explain in more detail.

  1. The flutter sliding toast is auto dismissed after it reaches out it's display duration or you can dismissed it by yourself by sliding the toast horizontally or vertically
  2. At the current moment, previously displayed toast is not dismissed on displaying a new toast, But we can achieve that along with dismissing all the toast
  3. The flutter sliding toast positions are not static, the toast can be displayed at ani position top, bottom, bottom left, top right. so, stacking them would not look good. However, we can achieve it too by restricting user's to display the toasts at a static position.

My solutions are listed below

  1. Programmatically dismissing a single or all toasts
  2. Showing toasts one after another only in a linear way
  3. Stacking them at a position
jeansusgodney commented 3 months ago

The suggested solutions sound good to me, thanks for the quick reply.

gaurishankar007 commented 2 months ago

A new version is published with the options for closing a single or all toasts programmatically. This should solve your problem.