-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to remove previous fired toast ? #169
Comments
i have struggled like you, to dismiss the previous toast message. ToastificationItem? _currentToast; if (_currentToast != null) { // Show the new toast and save its reference
` |
I believe using "toastification.dismissAll();" before firing a new one should do the trick. |
When using |
@dorklein @Vinicius-8 @dorklein What exactly is your problem? Do you want to show only for example one toast on the page? |
YES. For example, I have a button to download a file, I want to show first a message "Downloading..." and when the download has finished immediately show a new Toast "Download successful". Sometimes when the download is fast, the |
@dorklein Alright, In the latest changes, we added a feature that allows you to limit the maximum number of toasts you want to show. For example, you can set it to 1.
|
You will access to it in next version |
u
i have found a trick from the documentation. u can dismiss it using the first toastedId. every toast has dedicated toastId. if u are curios to find the full code i have replied it before. u can use that, and it works 100%. |
I want to automatically remove the first toast when a new one is fired, because currently, the toasts are stacking up.
I've set the duration to 5 seconds so that the user has enough time to read the message before it disappears.
autoCloseDuration: Duration(seconds: durationSeconds ?? 5),
Is there any documentation I should review carefully to resolve this?
Sharing an image for reference,
The text was updated successfully, but these errors were encountered: