A cross-platform Flutter app for real-time smart city monitoring and traffic incident management. Metro City Pulse gives operators a unified view of city incidents on an interactive map, operational statistics, CCTV-backed alerts, and user settings β optimized for mobile, tablet, and desktop layouts.
- Interactive map dashboard β Google Maps view of incidents across Bengaluru with marker filtering, severity legend, custom info windows, zoom controls, and periodic data refresh.
- Stats overview β Summary cards (total cases, new alerts, open cases, total videos), embedded map section, and recent alerts.
- Alerts workspace β Filterable alert list with confidence scoring, date-range selection, tabbed case status, and CCTV video playback.
- Responsive shell β Side navigation on tablet/desktop; drawer + bottom navigation on mobile. Layout adapts via a custom
AppResponsivebreakpoint system. - Authentication flow β Login, signup, and forgot-password screens wired to Firebase Auth (requires Firebase project setup).
- Localization β English and Spanish via ARB translation files with runtime locale switching.
- Theming β Light and dark mode with persisted user preference.
- Connectivity awareness β Offline detection using
connectivity_pluswith a dedicated no-internet screen.
| Category | Packages |
|---|---|
| Framework | Flutter (SDK ^3.10.9) |
| State management | Riverpod (hooks_riverpod, riverpod_annotation, code generation) |
| Navigation | GoRouter |
| Maps | google_maps_flutter, google_maps_cluster_manager_2 |
| Auth | firebase_core, firebase_auth, msal_auth / msal_js (MSAL not yet integrated) |
| Media | video_player |
| Storage | shared_preferences |
| UI | flutter_svg, syncfusion_flutter_datepicker, Poppins font |
| Networking | connectivity_plus |
| Serialization | json_annotation / json_serializable |
The codebase follows Clean Architecture:
lib/
βββ core/ # App bootstrap, routing, themes, providers, constants, utils
β βββ config/ # Environment configuration (prod/stage/dev/test)
β βββ router/ # GoRouter setup and route constants
β βββ provider/ # Global Riverpod providers (theme, locale, repositories)
β βββ themes/ # Light/dark theme definitions and assets
βββ data/ # Models, local/remote data sources, repository implementations
β βββ data_source/
β β βββ local/ # SharedPreferences / local DB
β β βββ remote/ # REST API service and endpoints
β βββ models/
β βββ repositories/
βββ domain/ # Entities, repository contracts, use cases
βββ presentation/ # Screens, widgets, feature-specific providers
β βββ screens/
β β βββ home/ # App shell (side menu, bottom nav)
β β βββ maps/ # Map dashboard
β β βββ dashboard/ # Stats screen
β β βββ alerts/ # Alerts list and video panel
β β βββ login/ # Auth screens
β β βββ profile/
β β βββ settings/
β βββ widgets/ # Shared UI components
βββ main.dart # Entry point
| Route | Screen | Description |
|---|---|---|
/ |
Login | Landing / sign-in with responsive split layout |
/login |
Login | Email & password authentication |
/signup |
Signup | New user registration |
/forgotPassword |
Forgot Password | Password reset flow |
/home |
Home | Main shell with map, stats, alerts, and chat nav items |
/profile |
Profile | User profile details |
/settings |
Settings | Language and theme preferences |
Inside /home, navigation works as follows:
| Nav item | Screen | Notes |
|---|---|---|
| Dashboard | CustomMapScreen |
Full-screen Google Maps incident view |
| Stats | DashboardScreen |
KPI cards, map section, recent alerts |
| Alerts | AlertsScreen |
Alert list + CCTV video player |
| Chat AI | β | Placeholder in bottom nav (not yet implemented) |
Map and alert data currently loads from bundled sample JSON:
assets/json/maps_sample_data.jsonβ incident records for Bengaluru locations
The MapRepository is structured to swap this for a REST API call once backend endpoints are configured in lib/core/config/environment.dart and lib/data/data_source/remote/endpoints.dart.
- Flutter SDK ^3.10.9
- Dart SDK (bundled with Flutter)
- A Google Maps API key with Maps SDK enabled
- A Firebase project (for authentication)
-
Clone the repository
git clone https://github.com/VK027/metro_city_pulse.git cd metro_city_pulse -
Install dependencies
flutter pub get
-
Generate code
Riverpod and JSON serialization rely on
build_runner:dart run build_runner build --delete-conflicting-outputs
-
Configure Google Maps
Add your API key to the platform manifests:
-
Android β
android/app/src/main/AndroidManifest.xmlinside<application>:<meta-data android:name="com.google.android.geo.API_KEY" android:value="YOUR_API_KEY"/>
-
iOS β
ios/Runner/AppDelegate.swiftorios/Runner/Info.plist:<key>GMSApiKey</key> <string>YOUR_API_KEY</string>
-
Web β load the Maps JavaScript API with your key in
web/index.html.
-
-
Configure Firebase (optional, required for auth)
- Create a Firebase project and add Android/iOS/Web apps.
- Download
google-services.json(Android) andGoogleService-Info.plist(iOS) into the respective platform folders. - Run
flutterfire configureto generatefirebase_options.dart. - Uncomment
Firebase.initializeApp()inlib/core/main_initialisation.dart.
-
Run the app
flutter run
Supported targets: Android, iOS, Web, macOS, Linux, and Windows.
API base URLs for prod, stage, dev, and test environments are defined in lib/core/config/environment.dart. Update the restBaseUrl values and wire up the REST client in lib/core/dependency_manager.dart when connecting to a live backend.
Translation files live in assets/translations/:
app_en.arbβ Englishapp_es.arbβ Spanish
Add or update keys in both files, then use .tr(ref) via the localization utilities.
The project uses flutter_lints and riverpod_lint with a custom lint plugin. Run analysis with:
flutter analyzeflutter testPrivate project β not published to pub.dev (publish_to: 'none').
Made with care by Viivek Kumar