How hrpofficial736/resq works
Project type and purpose
• This is a Flutter mobile application (“resq”) focusing on emergency response: showing weather, air-quality, recent alerts, shelters on map, SOS button, reporting feature, and emergency contacts.
• It follows a feature-driven modular structure with clear separation between UI (presentation), state management (providers), domain/use-cases, data/repositories, models, and network services.
File structure
• Top-level Flutter project: android/, lib/, test/, pubspec.yaml, etc.
• lib/ core folders:
• features/ – one folder per feature (home, alerts, emergency, report, shelters, splash). Each feature has subfolders: data/models, domain/use-cases, presentation/screens & widgets.
• providers/ – Riverpod/Provider classes coordinating UI and business logic (e.g., weather_provider.dart).
• services/ – API clients for external services (weather_api_service.dart, air_quality_api_service.dart, location_api_service.dart) and a generic network_client.dart.
• main.dart – application entry, sets up routing and providers.
README
a. Main components:
• Mobile App (Flutter)
· Presentation Layer (Screens & Widgets)
· State Management Layer (Providers)
· Domain Layer (Use-Case Classes)
· Data Layer (Repositories & Models)
· Network Layer (NetworkClient & API Services)
• External Services:
· Weather API
· Air Quality API
· Location API (geocoding/reverse)
· (Optional) Backend for alerts reporting, shelters data (if external)
b. Relationships & Interactions:
• UI Screens invoke Providers → Providers call Use-Cases → Use-Cases call Repositories → Repositories use API Services (via NetworkClient) → External API → Response flows back upward, populating Models and updating UI via Providers.
• Shared Widgets (core/widgets) sit alongside Screens and are fed data by Providers.
c. Architectural patterns & design principles:
• Layered (Clean) Architecture: separation of concerns between presentation, domain, data, and external layers.
• Feature-based modularization: each feature folder encapsulates its own data, domain, presentation.
• Dependency injection via Providers.
• Single source of truth for state in each Provider.
d. Relevant technologies & libraries:
• Flutter/Dart
• Provider or Riverpod (state management)
• HTTP client (network_client.dart likely wraps Dio or HttpClient)
• Google Maps or similar (in shelters/maps_widget.dart)
• JSON serialization mapped to Dart models
d. Under Domain layer, note use-case classes (e.g., GetWeather, GetAQI, GetAlerts).
e. Under Data layer, show repositories (weather_repo, aqi_repo, alert_repo) alongside model definitions.
f. Under Network layer, show NetworkClient connecting to each API service class.