How icorrect0165/tomato-guard works
Tomato Guard AI is an offline-first Flutter app for farmers. Its main workflow is capturing or selecting a leaf image, running on-device pest and disease detection, recording results, and consulting treatment advice. Separate branches support treatment history and reminders, bilingual settings, news, backups, and report/audio services. The README documents the high-level data and service connections; Dart implementation was not sampled, so finer call ownership and some persistence wiring remain uncertain.
Main entry points: detection_provider.dart Detection State · tracking_provider.dart Treatment Tracking · camera_screen.dart Capture / Upload · tflite_detection_repo.dart On-device Inference
Components 28
Diagnosis
- Capture / Upload
lib/features/detection/presentation/camera_screen.dart - Detection State
lib/features/detection/presentation/detection_provider.dart - On-device Inference
lib/features/detection/data/tflite_detection_repo.dart - YOLOv8 Model
assets/models/best_int8.tflite - Detection Results
lib/features/detection/presentation/result_screen.dart - Detection Details
lib/features/detection/presentation/detection_detail_screen.dart - Detection History
lib/features/detection/data/detection_local_repo.dart
Treatment & Advice
- Advisory Screen
lib/features/advisory/presentation/advisory_screen.dart - Advisory State
lib/features/advisory/presentation/advisory_provider.dart - Advisory Data
lib/features/advisory/data/advisory_repo.dart - Treatment Knowledge
assets/data/treatments.json - Treatment Tracking
lib/features/tracking/presentation/tracking_provider.dart - Treatment Records
lib/features/tracking/data/treatment_repo.dart - Log Treatment
lib/features/tracking/presentation/add_treatment_screen.dart - Treatment History
lib/features/tracking/presentation/history_screen.dart - Reminder Service
lib/services/notification_service.dart
Farmer Support
- Backup / Restore
lib/features/backup_restore/presentation/backup_screen.dart - Backup Data
lib/features/backup_restore/data/backup_repo.dart - News Feed
lib/features/news/presentation/news_screen.dart - News State
lib/features/news/presentation/news_provider.dart - RSS Service
lib/features/news/data/news_service.dart - PDF Reports
lib/services/pdf_service.dart - Read Aloud
lib/services/tts_service.dart
Shared Platform
- Settings
lib/features/settings/presentation/settings_screen.dart - Language State
lib/features/settings/presentation/language_provider.dart - English / Kiswahili
lib/l10n/app_localizations.dart
Other components
- Farmer
- Google RSS
Connections 25
- Farmer → Capture / Upload: captures image
- Capture / Upload → Detection State: submits image
- Detection State → On-device Inference: runs inference
- On-device Inference → YOLOv8 Model: loads model
- Detection State → Detection Results: presents result
- Detection Results → Detection Details: opens details
- Detection State → Detection History: records detection
- Farmer → Advisory Screen: requests advice
- Advisory Screen → Advisory State: requests advice
- Advisory State → Advisory Data: loads recommendations
- Advisory Data → Treatment Knowledge: reads treatments
- Farmer → Log Treatment: logs treatment
- Log Treatment → Treatment Tracking: submits treatment
- Treatment Tracking → Treatment Records: saves records
- Treatment History → Treatment Tracking: loads history
- Treatment Tracking → Reminder Service: schedules reminders
- Farmer → Backup / Restore: manages backup
- Backup / Restore → Backup Data: exports / restores
- Farmer → News Feed: views news
- News Feed → News State: requests articles
- News State → RSS Service: fetches feed
- RSS Service → Google RSS: fetches RSS
- Farmer → Settings: changes language
- Settings → Language State: updates locale
- Language State → English / Kiswahili: selects strings