How uniqueggamal/offline-plant-disease-detection-app works
LeafMate is a Flutter app for offline plant-disease identification and follow-up care. The main workflow is: a user opens the app, captures or selects a leaf image, gets an on-device classification, reviews localized disease guidance, and may save the scan or schedule a reminder. Other documented capabilities include scan history, theme and language settings, onboarding, and Help/About. The README documents the workflow; source excerpts were platform runners rather than Dart runtime code, so uncertain caller-level wiring is omitted.
Main entry points: cameraScreen.dart Camera and scan UI · main.dart App entry and routing · ai_model.dart TFLite classifier · db_service.dart Local scan database
Components 25
App experience
- App entry and routing
lib/main.dart - Home screen
lib/screens/home/home_screen.dart - Onboarding
lib/screens/onboarding/onboarding_screen.dart
Leaf detection
- Camera and scan UI
lib/screens/camera/cameraScreen.dart - Camera and image input
lib/services/camera_service.dart - TFLite classifier
lib/models/ai_model.dart - Quantized TFLite model
assets/ai/models/mobilenetv2_51classes_quant.tflite - Disease class labels
assets/labels/labels.json
History and care
- Scan history UI
lib/screens/history/history_screen.dart - Scan detail UI
lib/screens/history/scan_detail_screen.dart - Scan record model
lib/models/scan_history_model.dart - Local scan database
lib/services/db_service.dart - Reminder screens
lib/screens/reminder/reminder_main_screen.dart - Reminder model
lib/models/reminder_model.dart - Reminder state
lib/providers/reminder_provider.dart - Local notifications
lib/services/notification_service.dart
Preferences and guidance
- Disease guidance
assets/labels/cure_en.json - Nepali disease guidance
assets/labels/cure_ne.json - Settings UI
lib/screens/settings/settings_screen.dart - Settings state
lib/providers/settings_provider.dart - Localization state
lib/providers/localization_provider.dart - Bilingual app text
assets/labels/app_text_en.json - Nepali app text
assets/labels/app_text_ne.json - Help and About
lib/screens/settings/help_support_screen.dart
Other components
- User
Connections 24
- User → App entry and routing: opens
- App entry and routing → Home screen: routes to
- Home screen → Camera and scan UI: starts scan
- Camera and scan UI → Camera and image input: captures or selects
- Camera and scan UI → TFLite classifier: submits image
- TFLite classifier → Quantized TFLite model: runs inference
- TFLite classifier → Disease class labels: maps prediction
- TFLite classifier → Camera and scan UI: returns prediction
- Camera and scan UI → Disease guidance: loads guidance
- Camera and scan UI → Nepali disease guidance: loads guidance
- Camera and scan UI → Local scan database: saves scan
- Home screen → Local scan database: loads recent scans
- Scan history UI → Local scan database: reads and deletes
- Scan history UI → Scan detail UI: opens scan
- Local scan database → Scan record model: stores records
- Reminder screens → Reminder state: manages reminders
- Reminder state → Reminder model: maintains
- Reminder state → Local notifications: schedules
- Settings UI → Settings state: updates preferences
- Settings UI → Localization state: changes language
- Localization state → Bilingual app text: loads text
- Localization state → Nepali app text: loads text
- App entry and routing → Onboarding: provides route
- App entry and routing → Help and About: routes to