A Flutter mobile application with Firebase authentication and Firestore profile storage.
The app follows a layered architecture with BLoC for state management and dependency injection via get_it.
UI (Screens / Widgets)
↕ BLoC (Events → States)
↕ Controller (Business Logic)
↕ Service (Firebase SDK)
↕ Firebase (Auth / Firestore)
views/— Screens and UI widgets. Each screen usesBlocConsumerto dispatch events and react to states.blocs/— BLoC classes handle events (e.g.StoreProfileDataEvent), call controllers, and emit states (ProfileLoading,ProfileSuccess,ProfileFailure).controllers/— Thin layer that wraps services, converts exceptions intobool/ nullable return values so BLoCs don't handle raw exceptions.services/— Direct Firebase SDK wrappers (FirebaseAuthService,FirebaseStorageService). Registered as singletons in the DI container.models/— Data classes (UserProfileModel) withtoMap()/fromJson()serialization.core/— Shared constants (AppColors,AppTextStyles) and reusable widgets (AppButton,AppTextField,AppDropDown,AppText).controllers/di_controller.dart— Centralget_itcontainer that wires all dependencies.
User taps "Continue"
→ ProfileBloc receives StoreProfileDataEvent
→ StorageController.storeData()
→ FirebaseStorageService stores in Firestore
→ Controller returns true/false
→ BLoC emits ProfileSuccess / ProfileFailure
→ UI shows snackbar
- Document ID = User UID — Each user's profile is stored at
user_profiles/{uid}so reads/writes don't need a separate query. AppTextwidget — UsesMediaQueryto scale font size proportionally to screen width (reference: 375px). SetmaxLines: 1to enable responsive scaling; omit for multi-line wrapping text.- Controllers over raw services in BLoCs — Controllers catch and convert exceptions so BLoCs only deal with
bool/ nullable results.
| Package | Purpose |
|---|---|
flutter_bloc + bloc |
State management (BLoC pattern) |
get_it |
Dependency injection / service locator |
firebase_core |
Firebase initialization |
firebase_auth |
Email/password authentication |
cloud_firestore |
Profile data storage |
google_fonts |
DM Serif Display & Outfit fonts |
- Flutter SDK >= 3.11.4
- Android Studio / Xcode (for device builds)
- A Firebase project (the current config points to
strongify-d804d)
# 1. Install dependencies
flutter pub get
# 2. Run on device or emulator
flutter run
# 3. (Optional) Run analysis
flutter analyzeThe project is pre-configured for Android with google-services.json. To point to your own Firebase project:
- Create a Firebase project at https://console.firebase.google.com
- Enable Authentication (Email/Password) and Cloud Firestore
- Download the
google-services.jsonfor Android and place it atandroid/app/google-services.json - Re-run
flutterfire configureto regeneratelib/firebase_options.dart
Note: Only Android is currently configured. iOS, web, macOS, Windows, and Linux require additional Firebase setup.