I am currently building an app that has a first page with two buttons: 'New users -->" and "Existing users -->". The goal is for new users to click their button and go through a setup process that ends with their home page that is saved when the app is closed. The next time a user opens the app, once they click their existing users button, I want the app to open to the home page the setup process ends at. How do I achieving this? Any help would be appreciated!
CodePudding user response:
You can use GoRouter (from flutter team) plugin for handling this scenario and navigation.
https://pub.dev/packages/go_router
While initialising the router, you can provide redirect
where you can handle if user should be navigated to the setup screen or home screen.
CodePudding user response:
Use database / shared preference / secure storage to store whether the setup process was completed and what data was saved.
Now if you are using any framework like GetX
or something you can easily navigate to the desired pages or you can use Navigator.to
.... if not using a framework.
you can use something like
bool isSetupDone = // get from storage
the use this Boolean value to either alert, show/hide button/ popup message accordingly as per your usecase.