Тёмный

Flutter - Beyond Firebase Auth - User Roles with Firestore 

Appwriters
Подписаться 10 тыс.
Просмотров 24 тыс.
50% 1

Опубликовано:

 

25 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 99   
@kikalamuofficial5865
@kikalamuofficial5865 2 года назад
Thank you been looking for this ❤️
@snoligroup
@snoligroup 2 года назад
hello I love what you done it's a nice tuto. hope you will continue to help others by doing more vidéos like that
@WikkiOnIlluminati
@WikkiOnIlluminati 2 года назад
Could you please update the description of this video to show timestamps for chapters of your video?
@enriqueglopezsanchez
@enriqueglopezsanchez 4 года назад
Thank you. Very good video
@swayamshreemohantyvlogs8126
@swayamshreemohantyvlogs8126 3 года назад
Thanks man you are just awesome..
@appwriters
@appwriters 3 года назад
You're welcome!
@luzgenesis7
@luzgenesis7 4 года назад
I have a problem in a main.dart when i logged => " The method '[]' was called on null. Receiver: null Tried calling: []("role") "
@appwriters
@appwriters 3 года назад
Compare you code with the code in the github repository.
@doctork2579
@doctork2579 3 года назад
did u got the solution ? please help because i stack to this also
@luzgenesis7
@luzgenesis7 3 года назад
@@doctork2579 tell me if it works for you
@emirhan6134
@emirhan6134 3 года назад
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.
@paulinezipagan2136
@paulinezipagan2136 2 года назад
upp! can someone help? what's the solution for this?
@SeyyedNaquibAlFaruqi-ACS
@SeyyedNaquibAlFaruqi-ACS 3 года назад
thanks a lot man. You saved me.
@kobbydiscount2635
@kobbydiscount2635 4 года назад
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
@tobiasmiklavcic2211
@tobiasmiklavcic2211 3 года назад
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'].
@appwriters
@appwriters 3 года назад
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.
@mpr2801
@mpr2801 3 года назад
Have u corrected your error Even i am.getting d same error
@mpr2801
@mpr2801 3 года назад
@@appwriters What are the changes that we need to make if we get the above error
@jimbansuela6515
@jimbansuela6515 2 года назад
hey if you are still having this error just remove the " .data()" in "snapshot.data.data()"
@richpo9814
@richpo9814 4 года назад
Firebase Auth made updates for October. There were lots of changes made. Firebase Auth and User. Dart now conflicts with eachother when importing.
@appwriters
@appwriters 4 года назад
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
@dileepdilraj5254
@dileepdilraj5254 3 года назад
Read documents in official flutter website there are very few commands only changed and that more easy access commands
@sgouri3519
@sgouri3519 3 года назад
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
@appwriters
@appwriters 3 года назад
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
@anugrahkorambeth431
@anugrahkorambeth431 3 года назад
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?
@appwriters
@appwriters 3 года назад
If you apply the same role based checking as well in the Firestore Security rules, then there should not be any security issue.
@leoncoors5734
@leoncoors5734 4 года назад
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?
@appwriters
@appwriters 4 года назад
Best implement some state management to do it properly. Check my flutter firebase starter ( github.com/lohanidamodar/flutter_firebase_starter )
@Yusuf-rh6sj
@Yusuf-rh6sj 4 года назад
Thx from Turkey
@appwriters
@appwriters 4 года назад
Thank you too! for your support
4 года назад
oo topram
@ahmedtarek8676
@ahmedtarek8676 4 года назад
thank you you are the best
@akshaybhadauria4765
@akshaybhadauria4765 2 года назад
Can you please make a video on role based using react and firestore
@appwriters
@appwriters 2 года назад
Sorry, not doing react for quite some time now, But if you understand roles here, it should be similar to how you implement in react
@alanoodalmaari8106
@alanoodalmaari8106 3 года назад
When I press on login it does not take me to the another page still in log in page
@appwriters
@appwriters 3 года назад
You should please compare your code to the code in the repository!
@jcperez7925
@jcperez7925 2 года назад
is there an updated version of this video?
@appwriters
@appwriters 2 года назад
Sorry, no, but most of the concepts should work in any version
@amitbairwa7016
@amitbairwa7016 3 года назад
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
@appwriters 3 года назад
If you can make phone auth work, then only thing to do is in firestore save by phone number. everything else should be the same.
@amitbairwa7016
@amitbairwa7016 3 года назад
@@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.
@urdupuzzle9438
@urdupuzzle9438 4 года назад
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
@appwriters 4 года назад
That means they all are not same admin, they all have different role, so you have to handle separately.
@urdupuzzle9438
@urdupuzzle9438 4 года назад
@@appwriters How to handle it. Can you give me some guideline please I need this?
@1stplace362
@1stplace362 2 года назад
bro did you find a solution
@urdupuzzle9438
@urdupuzzle9438 2 года назад
@@1stplace362 no
@jayamuruganj5091
@jayamuruganj5091 3 года назад
pls make the video for the admin only create the users
@leoncoors5734
@leoncoors5734 4 года назад
Good video brother
@jayamuruganj5091
@jayamuruganj5091 3 года назад
pls make the video for the admin only create the users that means admin must create the user,user role,remove the user, update user position
@pulscare6272
@pulscare6272 4 года назад
you are love. solved my big problem. ThankYou soo much.. how to save "name" in database throuh signup
@appwriters
@appwriters 4 года назад
Same as any way you save any other value, you can update once the user is created to store the name or update on firebase auth and database as well.
@pulscare6272
@pulscare6272 4 года назад
@@appwriters Thankyou.
@adnankitabi9530
@adnankitabi9530 3 года назад
@@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
@urdupuzzle9438
@urdupuzzle9438 4 года назад
how to assign multiple roles like if there is more than one admin then we should use else if or something else??
@appwriters
@appwriters 4 года назад
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).
@urdupuzzle9438
@urdupuzzle9438 4 года назад
@@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
@pulscare6272
@pulscare6272 4 года назад
if i want show all admin in user_home_page.. what code should i write for this??
@appwriters
@appwriters 4 года назад
I am not sure I understand your question?
@pulscare6272
@pulscare6272 4 года назад
@@appwriters want to show all admin list in user's home page.
@victorlongoro4574
@victorlongoro4574 3 года назад
hellow sir , can you make a video using using getx with role based, its bit challenge out here
@luzgenesis7
@luzgenesis7 4 года назад
if i just want hide some widgets in home page just for users how can i do it? thanks for the video !!
@nepalicloud
@nepalicloud 4 года назад
u can use visibilty widget and its has Visiblity{child:container(),visiblity:user.isAdmin = = true ?true : false;}
@appwriters
@appwriters 4 года назад
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
@nepalicloud 4 года назад
@@appwriters sir , in app coin banauda nepal ma legal xa just for internal app transaction only
@appwriters
@appwriters 4 года назад
@@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.
@appwriters
@appwriters 4 года назад
@@nepalicloud It should basically be like reward points ?
@neteshpaudel724
@neteshpaudel724 3 года назад
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 ?
@mpr2801
@mpr2801 3 года назад
@Netesh Paudel Did u got d solution for that
@neteshpaudel724
@neteshpaudel724 3 года назад
@@mpr2801 no brother
@gaspargiddson5060
@gaspargiddson5060 3 года назад
how can i add name on my Map data
@danishdarren1179
@danishdarren1179 3 года назад
do you have any video on cloud firestore, refrerece data type
@appwriters
@appwriters 3 года назад
Sorry, not yet. Might be a nice addition.
@danishdarren1179
@danishdarren1179 3 года назад
@@appwriters If u could explain it, it'd be helpful, coz there aren't many explanatory videos on that, the way you do, Love from Maharashtra ❤️
@urdupuzzle9438
@urdupuzzle9438 4 года назад
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
@appwriters
@appwriters 4 года назад
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.
@urdupuzzle9438
@urdupuzzle9438 4 года назад
@@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.
@pulscare6272
@pulscare6272 4 года назад
want to show all admin list in user's home page.
@appwriters
@appwriters 4 года назад
It's just querying the Users collection and displaying the list
@eduardomelato5147
@eduardomelato5147 4 года назад
if I log out and then log in with a admin account i get to the non-admin home page
@appwriters
@appwriters 4 года назад
Compare you code to the Code in the Repo linked in the Description.
@Bl4kRobbie53
@Bl4kRobbie53 4 года назад
if you can make a video "how to create a profilepage and update dataprofile", i think i come to your house i bring you a italian pizza
@urdupuzzle9438
@urdupuzzle9438 4 года назад
How to handle it. Can you give me some guideline please I need this?
@appwriters
@appwriters 4 года назад
Multiple if-else or switch statement
@ExtraServingsBTS
@ExtraServingsBTS 3 года назад
You can't handle it.
@urdupuzzle9438
@urdupuzzle9438 3 года назад
@@ExtraServingsBTS then what to do
@ExtraServingsBTS
@ExtraServingsBTS 3 года назад
@@urdupuzzle9438 start by watching 'A Few Good Men'
@송지훈-w9m
@송지훈-w9m 4 года назад
Very thank's
@vongphetphongsavath2477
@vongphetphongsavath2477 3 года назад
Great tutorial, thank you.
@appwriters
@appwriters 3 года назад
Glad you enjoyed it!
@basspalace2920
@basspalace2920 3 года назад
Yo......you look like a bald Tekashi69.....dope tutorial though. I definitely needed this.
@appwriters
@appwriters 3 года назад
Thank you!
@roshanjungkunwar8440
@roshanjungkunwar8440 4 года назад
you from Nepal bro ?
@appwriters
@appwriters 4 года назад
Yes! Why bro?
@roshanjungkunwar8440
@roshanjungkunwar8440 4 года назад
@@appwriters i was just wondering on your name so
@ravikovind
@ravikovind 4 года назад
🔥♥️
@Dima-qz4su
@Dima-qz4su 2 года назад
cuntinue ;)
@leloughlemperough1903
@leloughlemperough1903 3 года назад
thanks a lot man. You saved me.
@appwriters
@appwriters 3 года назад
Awesome! good to hear!
Далее
Flutter RBAC (Role Based Access Control)
11:28
Просмотров 5 тыс.
Team Spiderman True Or False Mask,nono #Shorts
00:37
[Flutter] Firebase Authentication Using Riverpod
1:48:13
React Native vs Flutter - Which should you use?
22:31
Flutter Firebase Authentication - The Clean Way
8:12
Просмотров 134 тыс.
(Ep 54) Search List View With Flutter & Firestore
20:34