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

Where to put the UpgradeAlert #2

Closed
jasonlaw opened this issue Apr 30, 2019 · 5 comments
Closed

Where to put the UpgradeAlert #2

jasonlaw opened this issue Apr 30, 2019 · 5 comments

Comments

@jasonlaw
Copy link

Hi @larryaasen ,

In my app, before the MaterialApp, I have long initializing process, which including the user authentication as well. During the initializing process, there will be a loading screen display. After the initialization, MaterialApp will be called and home is routed to a Login page. In the Login page, it checks if user has been successfully authenticated (during initialization) so it would re-route to the App main page.
So my question is, where should I apply the UpgradeAlert?

Thanks in advance.

@larryaasen
Copy link
Owner

The UpgradeAlert widget can be placed into any part of the widget tree just like any other widget. It will not begin the upgrade checks until after its first build. If you add the UpgradeAlert widget in the App main page after your Login page, it will not appear on your Login page, and will appear after user has been successfully authenticated.

You could also add it into your Login page if that is necessary to block the user from Login until they are using the correct version. Your decision of where to place the UpgradeAlert widget is based on when you want the user to see the prompt, and if you plan to block them out of the app.

You should be able to place the UpgradeAlert widget any place in the widget tree.

@jasonlaw
Copy link
Author

jasonlaw commented May 3, 2019

Clear now, thank you!

@larryaasen
Copy link
Owner

I am closing this issue now that the explanation seems to be clear.

@tiagohbalves
Copy link

I have a problem with place of Upgrader, because I use login page and a AutoLogin function. This causes that when realizes the autologin and navigate to a other screen the Dialog is showed briefly but is dismissed after that. There is a soluction? I'm using the 2.8.3 version.

@larryaasen
Copy link
Owner

@tiagohbalves You could put Upgrade in both places. You could put it on the login screen, and if the autologin is being used, it could skip the login screen, and put it on the screen after autologin.

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

3 participants