Skip to content
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

DismisAll doesn't work if multiple toasts called at the same time #119

Open
amxDusT opened this issue Aug 1, 2024 · 3 comments
Open

DismisAll doesn't work if multiple toasts called at the same time #119

amxDusT opened this issue Aug 1, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@amxDusT
Copy link

amxDusT commented Aug 1, 2024

Describe the bug
I'm trying to show only one toast at a time in my application by dismissing all before showing new toasts, but whenever 2 or more toasts get called at around the same time, they all show instead of dismissing.

To Reproduce

toastification
    ..dismissAll(delayForAnimation: false)
    ..show(
      title: const Text('test 1'),
    )
    ..dismissAll(delayForAnimation: false)
    ..show(
      title: const Text('test 2'),
    );

Expected behavior
The first toast ('test 1') should be dismissed

Flutter information:

  • OS: iOS, Android
  • Flutter Version: 3.22.3
  • Toastification Version 2.1.0
@amxDusT amxDusT added the bug Something isn't working label Aug 1, 2024
@payam-zahedi
Copy link
Owner

Hey @amxDusT

Thanks for opening this issue

what exactly you want to achive here?

To only show one notification?

@amxDusT
Copy link
Author

amxDusT commented Aug 19, 2024

Exactly.
The problem seems to be in the toastification_manager: it has a delay in showing the toast, apparently waiting for the overlay. Though when dismiss/dismissAll is called these delays don't get removed.
The following pull is an attempt to fix that #123

@payam-zahedi
Copy link
Owner

Alright, I got your point

but I'm not sure the best way to solve it is to keep some toast as idle and keep them in a separate list

let me investigate on this and will let you know what's my plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants