rodrigobastosv / loading_overlay

MIT License
122 stars 32 forks source link

Loader Overlay acts weird when there's multiple pages using it #43

Closed bruno-f-silva closed 1 year ago

bruno-f-silva commented 1 year ago

Hello! First of all, I'd like to thank you for this great package!

Here's my problem. I have a hub page that has 5 buttons, 4 of them take you to different pages and one of them does stuff, part of it is to call context.loaderOverlay.show. When I click that button to show the overlay, it shows without any problem.

But if I go to any of the two of those four pages that also has a LoaderOverlay, go back to the hub page and click the button that shows the overlay, the context.loaderOverlay.visible shows true but the overlay doesn't show. AND if i click a second time on the button to show the overlay after it is hidden (even though it didn't show), it shows normally.

I have taken the LoaderOverlay from the widget tree of those two pages that have it and it works fine, but if I put it back, it acts like this.

I have tried many things. I have tried showing it and hiding it and showing it again, it doesn't work. I have tried using GlobalLoaderOverlay instead of LoaderOverlay and it doesn't work. I have taken every LoaderOverlay from every page and put GlobalLoaderOverlay on the main file, and it doesn't work. I'm not sure what to do. I'd appreciate if you could help me. Thanks!

cabbi commented 1 year ago

Have similar issue

rodrigobastosv commented 1 year ago

Hey guys, do any of you guys mind sharing a minimal example so i can take a look?

Loading Overlay uses InheritedWidget under the hooks, so i do not think this should be a issue?

Thanks very much!

cabbi commented 1 year ago

Hi, I did investigation in my code and I found out I was by mistake using GlobalLoaderOverlay more than once. So I solved, thanks

bruno-f-silva commented 1 year ago

Hello! It seems I managed to solve the problem by trying GlobalLoaderOverlay once more! I'm guessing it had something to do with the many contexts...

Anyway, thank you for your help! And thanks once again for this package!

adar2378 commented 3 months ago

Anyway to solve it without using GlobalLoaderOverlay? I have custom UI logic for different overlays. And I don't want to combine it all on the top level :(

adar2378 commented 3 months ago

@rodrigobastosv Could you please provide me more info about the comment above if possible