I think it's because of your login page doesn't send user to any screen. Try to use navigator to go your main screen and if user can go main screen successfully then it will add datas to your Firestore Cloud.
Where in this project did you use the splash screen. I see it as part of your repo but I cannot see where you used it in the project. Great job done though
Hi Damodar, first of all THANK YOU for both great videos about User Roles and Login. Your videos are from around 8 month ago and maybe because of changes in the meantime I receive errors in main.dart and admin_home.dart. Maybe you can help about what changed in Flutter version. My errors belong to "if (user['role'] == 'admin') {" and error message says: "The operator [] isn't defined for the type Object. Try defining the operator '[]'". There is in Andoid Studio a red waveline under ['role'].
With changes in dart language like null safety and other improvements, these errors are coming. you can make `user['role']` to `(user as Map)['role']`. You need to explicitly define types and it should work.
I am using 0.18.1+1 and the version released is 0.18.1+2, and change-log specifies only minor change, and the code is also working fine. I am not sure what you are referring to.. If you have any issue, create a issue in github, provide proper information, code and errors
I have developed an app with admin But the problem is admin is going logged by the same email and password which is registered for user I want differentiate between both admin user so that admin only can log by his own email pass. How to do that
From what I understand, There might be two ways, server side claims and roles in firestore, firebase.google.com/docs/firestore/solutions/role-based-access I have a tutorial here that is a bit old but might help you understand roles in firestore. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-A0Fn5pgDTn0.html
Hello, great tutorial. I was wondering if this way of roll based checking would have any sort of security issues, also, can you do a roll based video using firebase custom tokens?
What if you want your Home Screen on your main dart to be your splash page? How would you make the first screen your splash page but still get user data from the main screen?
i need to implement the same process in my app but I m using phone authentication instead of email/password. can you help me out with what changes should I make?
@@appwriters where to save by phone number and how? I m very much new to flutter and non-tech background. my phone auth is working fine. I just copied your code and tried to make it work mine. but I am unable to create stream builder for auth change. please look into it. thanks for reply.
In my app, there is an Auditorium booking system, VC Appointment System, and Cafe Details . Now the above three system handle by three different users means when someone wants to meet VC he can request to the VC Personal assistant that I want an appointment the assistant send a message to the user that your appointment is fixed. Similarly, for Auditorium booking and the Cafe manager add the items so the user can see the items and price of food now I want to show auditorium admin to his page and for VC admin and cafe manager so how would I do that.'
@@appwriters bro getting null for name while doing creating an account. Is it possible to pass name which user provides in sign up form to our firestore db? I struggling with this for 3 days now. If yes, which dart file needs to be updated Thanks
Not sure if I understand your query fully. If you want to assign multiple roles for same user you can use Array (roles: super_admin,admin,customer) or you can use multiple boolean fields like (super_admin: true, admin:true, customer:true).
@@appwriters I want to assign roles to a different user I am developing an app in which there are 15 admins so how can I do that like as in the video you used if-else statement that if the role is admin then return AdminPage now I want to add more admins so should I used another if-else statement
You can simply do these with conditionals (if or ternary operator by checking on the value of user or any other field that you want to base the visibility on)
@@nepalicloud If that coin is only in APP and doesn't translate to real world physical cash, I think it's safe from any legal obligations of Nepal government.
Hey brother, Just watched the video and looks like I manually had to provide the role . Is there any way to differentiate user like normal user and admin at the time of authentication like by adding another screen where I can ask user about role and authenticate it with some kind of pass/code ,I had use google auth for this . Is it possible? If yes then how ? Or Is there better way to do that ?
I want to assign roles to a different user I am developing an app in which there are 15 admins so how can I do that like as in the video you used the if-else statement that if the role is admin then return AdminPage now I want to add more admins so should I used another if-else statement
What do you mean? Even if you add 1000 admins, only one will login at a time, and when a admin logs in, it will simply work whether it's first admin or the 1000th admin. If that's your question. If not please be more clear with your question. Thank you for watching my videos.
@@appwritersThankyou for replying. In my app, there is an Auditorium booking system, VC Appointment System, and Cafe Details . Now the above three system handle by three different users means when someone wants to meet VC he can request to the VC Personal assistant that I want an appointment the assistant send a message to the user that your appointment is fixed. Similarly, for Auditorium booking and the Cafe manager add the items so the user can see the items and price of food now I want to show auditorium admin to his page and for VC admin and cafe manager so how would I do that.