A Flutter demo application that demonstrates how to manage user sessions and role-based navigation using SharedPreferences.
This project is built to showcase app flow architecture, persistent local storage, and multi-role routing logic in Flutter.
- Splash screen session check
- Role-based navigation (Student / Teacher / Admin)
- Local session persistence using SharedPreferences
- Automatic routing based on saved login state
- Logout with session reset
- Clean UI and multi-screen architecture
The app simulates a login system where user data and selected role are stored locally using SharedPreferences.
On app launch:
- Splash screen checks stored session
- If session exists → user is routed to their role dashboard
- If no session → user is redirected to login
This demonstrates persistent session handling without external authentication services.
- Flutter
- Dart
- SharedPreferences
lib/
├── main.dart
├── splash_screen.dart
├── login_screen.dart
├── student_screen.dart
├── teacher_screen.dart
├── admin_screen.dart
android/
ios/
pubspec.yaml
/screenshots ├── login.png └── student.png
| Login Screen | Student Screen |
|---|---|
![]() |
![]() |
- Clone the repository:
git clone https://github.com/Dev-Muhammad-Faizan/Flutter-SharedPrefs-Multi-Role-App.git- Navigate to the project directory:
cd Flutter-SharedPrefs-Multi-Role-App- Install dependencies:
flutter pub get- Run the app:
flutter runThis project focuses on understanding:
- Persistent local storage
- Session management
- Role-based UI navigation
- App startup routing logic
Muhammad Faizan
Flutter Developer

