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/
βββ β¦