Delivery App
A mobile app I built to explore real-time tracking and Flutter.
I wanted to see how difficult it is to build a real-time logistics app, so I tried making this DoorDash-style delivery app. It was a great way to jump into mobile development and learn how to keep a mobile app in sync with a database.
The "Hot Reload" Magic
I really enjoyed working with Flutter. The speed of development was amazing—I used Provider for state management to handle everything from the user's cart to their authentication state without making the code too messy.
Real-time Tracking
The most challenging part was definitely the delivery tracking. I used Firebase Realtime Database because its listeners are perfect for location updates.
// A small part of how I handled the driver's location updates
void _updateDriverLocation(Position position) {
final latLng = LatLng(position.latitude, position.longitude);
_mapController?.animateCamera(CameraUpdate.newLatLng(latLng));
// Sync with Firebase to let the customer know where the driver is
FirebaseDatabase.instance.ref('deliveries/${orderId}/location').set({
'lat': position.latitude,
'lng': position.longitude,
'timestamp': ServerValue.timestamp,
});
}
Battery vs. Accuracy
I didn't expect how much high-accuracy GPS drains a phone's battery. I spent a few late nights playing around with the distanceFilter and accuracy settings in the Geolocator plugin, trying to find a balance where the tracking still looked smooth but didn't kill the phone in 20 minutes.
This project taught me a lot about mobile UX and the importance of handling asynchronous data properly. If I were to keep working on it, I'd probably look into better routing algorithms for multi-stop deliveries, but for a first mobile app, I'm pretty happy with how it turned out.