# Shamba AI π±
**Instant crop disease & pest diagnosis for Kenyan smallholder farmers.**
Take or upload a photo of a sick leaf or pest β Google Gemini vision returns crop name, disease/pest, confidence, treatments, prevention tips, and a **Kiswahili** summary.
Built with **Flutter** + **Material 3** as a farmer-friendly Android app (also runs on web for demos).
---
## Features
| Feature | Description |
|--------|-------------|
| **Take Photo** | Capture a leaf or pest with the camera |
| **Upload Gallery** | Pick an existing image |
| **AI Diagnosis** | Gemini vision β structured JSON result |
| **Action-first results** | Organic steps first, then chemical options |
| **Confidence meter** | High / medium / low visual ring |
| **Kiswahili summary** | Copy-ready text for WhatsApp sharing |
| **History** | Local Hive store with thumbnails (device only) |
| **Recent scans** | Quick reopen from the Home screen |
| **About** | Privacy notes & agronomist disclaimer |
---
## Screenshots / branding
| Asset | Path |
|-------|------|
| App logo | `assets/images/logo.png` |
| Brand mark | `assets/images/brand_mark.png` |
| Android launcher | `android/app/src/main/res/mipmap-*/ic_launcher.png` |
| Web favicon | `web/favicon.png` |
---
## Tech stack
- **Flutter** 3.22+ (stable)
- **Dart** 3.3+
- **Google Gemini** (`google_generative_ai`) β default model: `gemini-2.5-flash`
- **image_picker** β camera & gallery
- **Hive** β local scan history
- **Material 3** + **Google Fonts (Nunito)**
---
## Project structure
```
shamba_ai/
βββ lib/
β βββ main.dart
β βββ config/api_config.dart # API key via --dart-define
β βββ models/ # DiagnosisResult, ScanHistoryItem
β βββ services/ # Gemini, history, image pickers
β βββ screens/ # Home, Result, History, About
β βββ widgets/ # Logo, cards, loading, buttons
β βββ theme/app_theme.dart
βββ android/ # Android app β¦