•  


GitHub - adumrewal/role-based-login-architecture: Flutter: Role based user authentication and login management. Simplified and modular architecture
Skip to content

Flutter: Role based user authentication and login management. Simplified and modular architecture

License

Notifications You must be signed in to change notification settings

adumrewal/role-based-login-architecture

Folders and files

Name Name
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Login & Role Based User Authentication Architecture

Tech: Flutter and Firebase

Efficient state management and navigation for apps with specific home screens for various user roles.

Many times when working on an app we come across the following scenario:

  • How does one control navigation and state management in the app wrt login/logout/user-role
  • Every app requires a separate screen for logged in users vs not logged in users
  • Also, if your app has multiple user roles, like Admin, Student, Teacher, Staff, it becomes very cumbersome to manage which view to show for each user and how to ensure one user type does not have access to outside information

Here in this repository I have provided a very simple structure for the app to ensure when there is a change in user state, the app gets updated automatically.

Architecture / Sequence Diagram

sequence-diagram

Screenshots

Login Screen Admin Home Student Home
login-screen admin-portal student-portal

Suppose you are in the login screen and press the login button. In this case the user should be navigated inside the app and we should pop the login screen from the app. Adding if the user is an Admin types, he should be shown screen 2 vs screen 3 or X for other user roles.

Now for a logged in user, when they logout, the entire state of the app should be refreshed and a login screen should be shown. (i.e. They should not have access to previously shown information)

The relevant files are available inside the lib folder. main.dart, routes.dart, loginManager.dart and homePageNavigator.dart are the main files required to create an efficient login structure. Others are just helpers to create a sample app.

Getting Started

A few resources to get you started if this is your first Flutter project:

I use VSCode for running flutter applications. It is very efficient and works like a charm. Open the project folder in VSCode and click on run. Your sample app will get launched.

If you like this repo and would like me to work on more such sample projects, please do let me know or give it a ?

If you are working on a flutter project and are stuck anywhere, feel free to reach out. Would be happy to help :)

About

Flutter: Role based user authentication and login management. Simplified and modular architecture

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본