A comprehensive, offline-first dairy management application built with Flutter, designed to streamline the tracking of milk sales, purchases, customers, and suppliers. It features robust PDF reporting, secure local storage, and app activation controls.
-
Offline First All data is stored locally using SQLite. No internet connection required.
-
Customer & Supplier Management Easily manage profiles for both customers and milk suppliers.
-
Sales & Purchase Tracking Record daily milk sales to customers and purchases from suppliers.
-
Ledger & Reports Generate detailed ledger reports for specific date ranges.
-
PDF Generation & Printing Export reports to PDF and print them directly from the app.
-
App Activation Security Secure the app using a 6-digit activation code system.
-
Backup & Restore Export and import database backups to prevent data loss.
![]() |
![]() |
![]() |
| Dashboard | Add Sale | Add Purchase |
![]() |
![]() |
![]() |
| Suppliers List | Create Ledger Report | View Report |
![]() |
||
| Backup & Restore |
- Framework: Flutter
- State Management: GetX
- Database: SQLite (sqflite)
- Reporting: PDF & Printing packages
- Storage: Shared Preferences
lib/
├── main.dart # App entry point
├── core/
│ ├── database/
│ │ └── database_helper.dart # SQLite database helper
│ ├── theme/
│ │ └── app_theme.dart # App theme configuration
│ └── services/
│ └── activation_service.dart # App activation logic
├── data/
│ ├── models/
│ │ ├── customer_model.dart # Customer data model
│ │ ├── purchase_model.dart # Purchase data model
│ │ └── sale_model.dart # Sale data model
│ └── repositories/
│ ├── customer_repository.dart # Customer data access
│ └── sale_repository.dart # Sale data access
└── modules/
├── dashboard/ # Dashboard screen
├── customers/ # Customer management
├── suppliers/ # Supplier management
├── sales/ # Sales tracking
└── purchases/ # Purchase tracking
The app follows the GetX pattern with a clear separation of concerns among Views, Controllers, and Bindings. This ensures that the UI remains separate from the business logic.
A Repository pattern is used to abstract the data source (SQLite) from the business logic. Controllers interact with repositories rather than querying the database directly.
The app operates entirely offline, making it reliable for dairy shops in areas with poor or no internet connectivity. Data is persisted in a local SQLite database.
The app uses SQLite for local data persistence. It manages tables for:
- Customers: Stores customer details and balances.
- Suppliers: Stores supplier details and balances.
- Sales: Records milk sales transactions.
- Purchases: Records milk purchase transactions.
To secure the app, an activation flow is implemented:
- A pre-defined list of valid activation codes is stored in the app.
- On first launch, the user must enter a valid code.
- Used codes are tracked in
SharedPreferencesto prevent reuse.
- Flutter SDK
- Android Studio or VS Code
- Android SDK
-
Clone the repository
git clone https://github.com/yourusername/dairy_manager.git cd dairy_manager -
Install dependencies
flutter pub get
-
Run the app
flutter run
- On first launch, enter a valid 6-digit activation code.
- Once activated, the app will open to the Dashboard.
- Navigate to the Sales section.
- Tap Add Sale.
- Select a customer, enter the quantity, rate, and save.
- Navigate to the Reports section.
- Select Customer or Supplier report.
- Choose the date range and tap Generate.
- You can view, export to PDF, or print the report.
Abdul Sami
- GitHub: @5-abdulsami
- Website: abdulsami.live
- Email: 5abdulsami2004@gmail.com
- LinkedIn: Abdul Sami






