Flutter · Offline-First · Maps · Firebase
Flutter Mobile Development Case Study

The goal
In disaster scenarios or remote areas of Nepal, network connectivity is highly unreliable. The objective was to build a mobile application that allowed field workers and citizens to report incidents (fires, landslides, medical emergencies) accompanied by precise GPS coordinates and photographic evidence.
The critical requirement was that the app could not fail simply because there was no internet connection. It needed to function fully offline, capturing data locally, and then seamlessly synchronizing with the central command servers the moment a 3G/4G or Wi-Fi connection was re-established.
How it was built
Frontend Framework: Flutter was utilized to ensure cross-platform compatibility without sacrificing access to native device features like precise GPS sensors and the camera hardware.
Offline-First Database: Instead of relying on direct API calls, all data writes were directed to a local SQLite database (via the `sqflite` package). A background sync engine constantly monitored network status using the `connectivity_plus` package.
Mapping & Location: Integrated Google Maps SDK for Flutter to render customized map tiles. Implemented background location tracking to allow command centers to see the real-time movement of response teams.
Technical hurdles
Mobile OSs (especially newer Android versions and iOS) aggressively kill background processes to save battery. Ensuring incident reports synced successfully in the background when connectivity returned was difficult.
Implemented the `workmanager` package to schedule periodic, OS-compliant background tasks. The task checked the local SQLite queue for pending uploads. If internet was available, it initiated an upload, handling retries and marking items as synced only upon a 200 OK from the server.
High-resolution smartphone cameras generated 5MB+ image files. Uploading these over weak 3G connections frequently timed out, blocking the sync queue.
Added a pre-processing step using the `flutter_image_compress` plugin. Images were automatically resized and compressed (quality: 70%) before being saved to SQLite. This reduced file sizes from ~5MB to ~300KB, drastically improving upload success rates on poor networks.
Results
The architecture proved highly resilient in the field. Field workers could confidently log data knowing it would eventually reach the server without requiring manual retries. Command centers received near real-time location updates of units, improving dispatch efficiency.
100%
Offline Functionality
~3s
Location Broadcast Avg.
94%
Reduction in Media Size