How suhanisunehra/women_safety_framework works
Project Type and Purpose
• This is a cross-platform Flutter application (“women_safety_framework”) targeting mobile (Android, iOS), web, and desktop (Windows, macOS, Linux).
• Its purpose is to provide safety features for women in different roles (normal user, working woman, organization admin), including incident reporting, geofencing alerts, emergency contacts, and location-based services (e.g., finding nearby hospitals or police stations).
File-Structure Analysis
• Top-level platform folders: android/, ios/, web/, windows/, macos/, linux/
• Core application code in lib/ with subfolders:
• roles/ – screens per user role (normal_user, working_women, organization_admin)
• widgets/ & reusable_widgets/ – UI components
• utils/ – helper functions, constants
• secureStorageService.dart – local storage for tokens/settings
• fetchWorkplaceDetails.dart – network service for external data
• Standard Flutter config files: pubspec.yaml, platform runners, Gradle/Xcode projects.
Key Technologies & Services
• Flutter / Dart for UI and business logic
• Firebase (implied by google-services.json) for authentication, data storage
• HTTP / REST for external workplace details
• Device APIs: Geolocation, Geofencing, Battery status, Notifications (via platform channels or Flutter plugins)
• Secure local storage for sensitive tokens/settings
Components
a. Client-side Layers
• Presentation Layer: Screens & Widgets (lib/roles/*, lib/widgets/*)
• Business Logic Layer: Services & Controllers (fetchWorkplaceDetails.dart, secureStorageService.dart, role screen ViewModels)
• Data Layer:
• Local Storage (secure storage plugin)
• Network Services (HTTP/Firebase SDK)
• Platform Integration:
• Flutter Engine
• Platform Channels (for geofencing, battery monitoring, notifications)
b. External Services
• Firebase Auth & Firestore (or Realtime Database)
• External REST API for workplace details
• Third-party Maps/Places API (for hospital/police station lookup)
c. Platform Runners
• Android (Gradle / Java-Kotlin stub)
• iOS (Xcode / Swift stub)
• Web, Windows, macOS, Linux runners
Interactions & Data Flows
• User interacts with UI screens → UI dispatches to Business Logic
• Business Logic calls:
• SecureStorageService for local read/write
• Network Services:
– Firebase SDK (sign-in/up, read/write reports)
– HTTP client (fetchWorkplaceDetails)
• Platform Channels (request geolocation, set geofence, monitor battery)
• External Services return data → Business Logic transforms → UI updates
Architectural Patterns & Principles
• Layered Architecture (Presentation / Domain / Data)
• Separation of Concerns: each role’s screens isolated under lib/roles
• Reusable Components: centralized widgets & utilities to avoid duplication
• Single Source of Truth: services handle all data access
Final Recommendations
• Significant parts: platform runners, Flutter engine, UI modules, services, storage, external backends.