JackJonson / flutter_styled_toast

A Styled Toast Flutter package.
Apache License 2.0
76 stars 43 forks source link

When I scope flutter_styled_toast in flutter >=3.10.1, viewInsects in MediaQuery don't work. #29

Closed oboard closed 1 year ago

oboard commented 1 year ago

When I scope flutter_styled_toast in flutter >=3.10.1, viewInsects in MediaQuery don't work. Especially when a TextField on the bottom of my screen and I click the TextField, view wouldn't resize in time

gabrielguedest commented 1 year ago

I have opened a pull request that fixes this issue: https://github.com/JackJonson/flutter_styled_toast/pull/30

If you would like to use the fix, you can update the dependency in your pubspec.yaml file to point directly to the branch with the fix until the pull request is approved:

flutter_styled_toast:
  git:
    url: https://github.com/gabrielguedest/flutter_styled_toast
    ref: master
darkstarx commented 1 year ago

Have the same trouble. All text fields don't scroll up when the virtual keyboard is opening. I can confirm the PR #30 is working for this moment, I'd be appreciate the maintainer for merging.

But I'd note that there is no need for adding the MediaQuery in the StyledToast widget since it already has the MediaQuery above in the widget tree (it takes it from the View widget or something). So the MediaQuery widget is absolutely redundant in the StyledToast widget and must be removed. The Localizations widget must be left there because the ContextMenuController uses the top most Overlay that is not the WidgetsApp's overlay but the StyledToast's overlay that has to have the Localizations above in the widget tree.

JackJonson commented 1 year ago

New version 2.2.1 published which upgraded to 3.10.x