payam-zahedi / toastification

Toastification is a Flutter package for displaying customizable toast messages. It provides predefined widgets for success, error, warning, and info messages, as well as a custom widget for flexibility. With Toastification, you can add and manage multiple toast messages at the same time with ease.
https://payamzahedi.com/toastification/
BSD 3-Clause "New" or "Revised" License
587 stars 45 forks source link

The only-one option is supported #101

Open laterdayi opened 6 months ago

laterdayi commented 6 months ago

The only-one option is supported

I want multiple clicks to show only the latest toast, just one

payam-zahedi commented 6 months ago

I guess you can close all the other toasts before showing the new one

You can use this sample:

toastification.dismissAll();

toastification.show(...);
payam-zahedi commented 6 months ago

Is this what you need?

laterdayi commented 6 months ago

yes I think a lot of people need to hit it and only one toast comes out at the same time

laterdayi commented 6 months ago

It is hoped that the official can provide the only-one option

AntonioAEMartins commented 4 weeks ago

Hi @laterdayi and @payam-zahedi,

I hope you're both doing well.

I was reading through the discussion on this issue and agree that a "one-only" toast option could be very useful, especially for mobile environments. If you're open to it, I'd love to contribute by implementing this feature. My suggestion is to introduce a only_one_mode variable in the ToastificationConfigProvider, which can be toggled between true or false to control this behavior. Let me know your thoughts, and if we align on this, I can start working on it.

Looking forward to your feedback!