Offline-first farmer marketplace app for Northern Nigeria — connects smallholder farmers directly with buyers via Flutter + SQLite, works without internet.
# FarmLink Naija 🌾
**Linking Farmers. Connecting Markets.**
A Flutter mobile application connecting smallholder farmers and buyers across Nigeria, with offline-first architecture and bilingual (English/Hausa) support.
---
## Features
- **Dual-language UI** — English and Hausa throughout
- **Farmer Dashboard** — real-time stats, market prices, sync status
- **Create Listings** — post produce with crop, quantity, price, location
- **Browse Market** — buyers search and filter active listings
- **Listing Detail Page** — full info, price breakdown, contact-farmer CTA
- **Buyer ↔ Seller Messaging** — thread list + chat screen with unread badge
- **Market Prices** — live per-crop price feed with offline cache & seed defaults
- **OTP Verification** — phone-based auth with 4-digit OTP (reserved for backend)
- **Offline-first** — SQLite local cache + sync queue; works without internet
- **Background Sync** — queues failed operations and retries automatically
- **Role-aware Navigation** — different bottom-nav for farmers vs buyers
- **Session Persistence** — login survives app restart; multiple accounts supported
---
## Architecture
```
lib/
├── core/
│ ├── constant/ # AppColors, AppStrings, AppConstants
│ ├── database/ # SQLite via sqflite (DatabaseHelper)
│ ├── models/ # Crop, UserRole, UserModel, ListingModel, BuyerInterest, MessageModel, SyncQueueItem
│ ├── network/ # ApiClient (Dio)
│ ├── providers/ # AppProvider, AuthProvider, ListingProvider, MarketProvider, MessagesProvider
│ ├── sync/ # SyncService (background queue processor)
│ └── theme/ # AppTheme (Material 3)
├── features/
│ ├── auth/screens/ # Splash, Register, Login, OTP, ProfileSetup, Dashboard, MyListings, CreateListing, Profile
│ ├── buyer/screens/ # Browse, MarketPrices, Notifications, ListingDetail
│ └── messages/screens/ # Messages (thread list), Chat
├── route/ # AppRouter, AuthGuard (role-aware)
└── shared/
├── …