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

Loader not showing when im doing setState #40

Open
mambaur opened this issue Sep 24, 2022 · 4 comments
Open

Loader not showing when im doing setState #40

mambaur opened this issue Sep 24, 2022 · 4 comments

Comments

@mambaur
Copy link

mambaur commented Sep 24, 2022

No description provided.

@rodrigobastosv
Copy link
Owner

Hello @mambaur , thanks for using this package. It's not very clear for me what's you problem. Can you provide a minimal sample that reproduces your issue?

@hugomc92
Copy link

I'm facing the same issue. The problem is that when you show the loader, do something on background and call setState(), the loader automatically hides even if you need to do more things previous to hide it

@callmephil
Copy link

I'm facing the same issue. The problem is that when you show the loader, do something on background and call setState(), the loader automatically hides even if you need to do more things previous to hide it

is your problem solved or can you post a code sample?

@JesusHdez960717
Copy link
Contributor

JesusHdez960717 commented Nov 18, 2023

Hi @hugomc92 & @mambaur, I don't know if they still have this issue, but I assure you that in the latest version of the package (3.0.0 currently) this issue is not reproduced.

Even in the example it can be verified. example code (reproducing the problem I understand you have):

             ElevatedButton(
              onPressed: () async {
                context.loaderOverlay.show();
                setState(() {
                  _isLoaderVisible = context.loaderOverlay.visible;
                });
                await Future.delayed(Duration(seconds: 2));
                if (_isLoaderVisible) {
                  context.loaderOverlay.hide();
                }
                setState(() {
                  _isLoaderVisible = context.loaderOverlay.visible;
                });
              },
              child: Text('Show overlay for 2 seconds'),
            ),

Results in docs (super cool gif).... but basically the Overlay is shown with .show and is not hidden until .hide is called

If you try the latest version and still have the issue, please share the example code so I can reproduce it.

🎄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants