Closed ferrumzp closed 4 years ago
Hey, I also started learning flutter and firebase quite recently, but I think you can not manage roles just with firebase authenticaiton. Instead, what you could do, is make a some sort of launch screen, where you would give the user three options: signUp as user, manager or admin, and from there redirect them to a screen that implements the authorization methods for the user type selected. Also, in here, you could try and use firestore or realtime database, to store the user type and other authentication requirements.
And for the second question, you could use a library called "Shared Preferences" which allows you to store data locally with key value pairs, which basiclly means you can save weather the user has logged in or not, and in case the user is logged in, you can instead of displaying the initial "SignUp screen" you could directly redirect them to your app. Also, if you want to store more complex data locally from the user, you might want to use "SQLite" which allows you to manage a local database. Hope it was somehow helpful.
Daniel from Spain
@DUKITROX thank you for you detailed explaination. Yes most of the part its correct. But @ferrumzp consider following things
Hope this answered your queries. Thank you
Hello. Thank you very, very much for your work. This is a very good start for beginners and those who are just starting to learn Flutter like me. I want to ask you how can I make authorization for user types: user, manager, admin? I only found heavily outdated data that doesn't support the current version of Dart and Flutter. And how to make sure that the authorized user remains in the system on subsequent launches of the application? Thank you. Best regards, Dmitry