A minimal Flutter scanning app for delivery drivers to track bakery crates loaded into and removed from their vehicle.
Drivers scan QR codes attached to bakery crates using the phone camera. Each scan is recorded as a Check In (loading a crate) or Check Out (removing a crate). The app shows a live count of crates currently in the vehicle.
Key design goal: maximum scanning speed with minimal UI interaction.
- Fullscreen camera scanner — continuous QR code detection via Google ML Kit
- Check In / Check Out mode — two large buttons to switch scanning direction
- Live inventory banner — shows total crate count and a breakdown by product type
- Scan feedback — short beep + vibration on every accepted scan
- Duplicate scan cooldown — 1-second cooldown per QR code prevents double-counting
- In-memory event log — full history of all scan events with timestamps
A plain numeric ID (most common):
14
Or a JSON payload:
{
"package_id": "88291",
"product_type": "croissant"
}- Flutter SDK ≥ 3.11
- Android device or emulator (API 21+)
- For Chrome emulation: any browser
flutter runflutter run -d chromeIn Chrome, tap the QR button (bottom right) to open the emulation dialog. Enter a crate ID (e.g. 14) and tap Scan to simulate a real scan.
lib/
├── main.dart # App entry point, Provider setup
├── models/
│ └── models.dart # ScanMode, InventoryItem, ScanEvent
├── providers/
│ └── inventory_provider.dart # In-memory state, scan logic, cooldown
├── screens/
│ └── scanner_screen.dart # Main screen (camera + overlays)
├── services/
│ └── feedback_service.dart # Beep generation + vibration
└── widgets/
├── inventory_banner.dart # Top floating crate count banner
└── mode_toggle.dart # Check In / Check Out buttons
| Package | Purpose |
|---|---|
mobile_scanner |
QR code detection via camera |
provider |
Lightweight state management |
vibration |
Haptic feedback on scan |
audioplayers |
Beep audio playback |
State is managed with a single InventoryProvider (ChangeNotifier). The inventory is an in-memory Map<String, InventoryItem> keyed by package_id. All scan events are appended to a List<ScanEvent> for audit/export purposes.
The beep is generated programmatically as a PCM WAV sine wave — no audio asset files are required.