How qutaibaqusai/heartful-care works
Project Type and Purpose
• This is a multi-platform (Android, iOS, Web, Windows, macOS, Linux) Flutter application.
• It follows a client-side-only architecture, relying on Firebase Authentication (and likely other Firebase services) and local utilities.
• State management is handled via Provider (lib/provider/myprovider.dart).
• Code is organized by feature (Medical Devices, Nurse Centers, Profile, User Settings, Authentication, Intro flow).
Main Components
A. Platform Embedders
– Android (android/)
– iOS (ios/)
– Web (web/)
– Windows (windows/)
– macOS (macos/)
– Linux (linux/)
• These directories contain native host code (build scripts, platform channel setup).
B. Flutter Engine & Dart VM
• The shared runtime that compiles/runs Dart code on each host.
C. Application Layers (lib/)
1. Presentation Layer
– widgets/ (reusable UI widgets)
– sections/ (feature-specific UI flows for MedicalDevices and NurseCenters)
– the various Dart screen files (e.g., login_screen.dart, signup_screen.dart, supplier_home.dart, center_home_page.dart).
2. State Management Layer
– provider/myprovider.dart
• Exposes ChangeNotifiers, holds application state and business logic.
3. Domain/Model Layer
– model/ (Dart classes modeling Intro, HomeSections, Users, Devices, Requests, Reviews, etc.)
4. Data/Service Layer
– utils/Authentication firebase (firebase_auth.dart)
– utils/pickImage.dart, utils/storeImg.dart
• Encapsulates communication with Firebase Auth, Storage, possibly Firestore or Realtime DB if added.
D. Assets & Config
– pubspec.yaml, pubspec.lock
– images/ (Lottie JSON animations, AVIF files)
– android/app/google-services.json, ios/Runner/GoogleService-Info.plist (config for Firebase).
E. Tests
– test/widget_test.dart
Interactions and Data Flow
• User taps UI widget → Presentation Layer invokes Provider method → Provider calls Service Layer → Service Layer interacts with Firebase Auth / Storage → Firebase returns response → Provider updates Model → Provider notifies Presentation Layer → UI re-renders.
• Images and animations are loaded locally from the assets/images folder.
• Platform embedders bootstrap Flutter Engine, load main.dart and handle plugin registration (generated_plugin_registrant.*).
Architectural Patterns & Principles
• Layered Architecture (Presentation → State Management → Domain → Data Services).
• Modular by Feature (separate directories for Medical Devices, Nurse Centers, Profile, etc.).
• Single Source of Truth via Provider.
• Use of Flutter’s plugin system to integrate with Firebase and native APIs.