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
585 stars 45 forks source link

Raising the top of toast with the keyboard open #124

Closed StarProxima closed 1 month ago

StarProxima commented 2 months ago

@payam-zahedi Thanks for a great package, the quality level is really very high, I am in the process of switching from my own solution to this package.

Describe the bug

Currently, toasts do not react to an open keyboard, so the user can skip them when acting while the keyboard is still open.

Video demonstrating the problem:

https://github.com/user-attachments/assets/c44c1756-580d-4f18-ae4f-cc03c488865c

Expected behavior Toasts go up over the keyboard when it is open and down when it is closed. Perhaps we could add an additional parameter to regulate this behavior.

Flutter information:

payam-zahedi commented 2 months ago

Hey @StarProxima

Thanks for opening the issue

Yes, I didn't think about this and this must be solved ASAP.

payam-zahedi commented 2 months ago

If you are looking for a quick solution for now, I would suggest changing the alignment of your toasts

You can show them from top.

LucasXu0 commented 2 months ago

Here's my workaround:

Add MediaQuery.of(context).viewInsets.bottom as the toast padding.

Screenshot 2024-08-22 at 16 43 47
ghrlt commented 2 months ago

Here's my workaround:

Add MediaQuery.of(context).viewInsets.bottom as the toast padding.

Is there a workaround if we have no context available?