RationApp is a mobile application designed to help Eritrean dairy farmers calculate optimal feed rations for their livestock. Built with Flutter, the app provides a simple, offline-first interface that enables farmers to make informed feeding decisions based on scientific calculations.
Dairy farming in Eritrea faces challenges with high feed costs and low milk production. RationApp addresses this by:
- Providing a mobile tool for calculating balanced cow feed based on specific animal characteristics
- Working completely offline, essential in areas with limited internet access
- Helping farmers optimize feed costs while maintaining proper nutrition
- Supporting agricultural extension officers during farm visits
- Input cow details (weight, pregnancy status, milk production, etc.)
- User-friendly dropdown menus and text fields
- Calculates precise nutritional needs based on cow characteristics
- Shows requirements for dry matter, energy, protein, and minerals
- Add and edit fodder and concentrate ingredients
- Track nutritional values of feed mixes
- Visual indicators show when nutrient levels meet requirements
- Update local feed prices
- Calculate the cost of different feed combinations
- Suggests the most cost-effective feed mix that meets nutritional requirements
- Available in multiple languages (English, Arabic, Tigrinya)
- All features work without internet connection
- Data is stored locally on the device
This section provides essential guidance for non-technical users who need to maintain and update the app after the initial development phase.
-
Locate the language files: All text content is stored in the
lib/l10n
directory in.arb
files:intl_en.arb
- English textintl_ar.arb
- Arabic textintl_ti.arb
- Tigrinya text
-
Edit the files: Open these files with any text editor (like Notepad, TextEdit, or Visual Studio Code). The format looks like this:
"concentrateSorghumGrain": "Sorghum grain", "@concentrateSorghumGrain": { "description": "Concentrate: Sorghum grain" },
-
Make your changes:
- Edit only the text inside the quotation marks after the key (e.g., "Sorghum grain")
- Do not change the keys (the text before the colon, e.g., "concentrateSorghumGrain")
- The description field helps translators understand the context
- Make sure to maintain the JSON format with proper commas and brackets
-
Save the files: Save the changes and proceed to building an update.
To modify nutritional values or add new feed ingredients:
- Open
lib/data/nutrition_tables.dart
- For existing ingredients, find the relevant item in either
fodderItems
orconcentrateItems
list - Update the nutritional values as needed
- To add a new ingredient:
- Add a new
FeedIngredient
entry following the existing pattern - Include the ID, name, and all nutritional parameters
- Add corresponding translation keys to the
.arb
files
- Add a new
Once you've made your content changes, you'll need to build and distribute the updated app:
- Install Flutter: Follow the Flutter installation guide
- Install Visual Studio Code: Download from code.visualstudio.com
- Install Git: Download from git-scm.com
-
Get the code:
git clone https://github.com/minerva-university/rationapp.git cd rationapp
-
Install dependencies:
flutter clean flutter pub get
-
Build the APK (for Android):
flutter build apk
The APK will be located at
build/app/outputs/flutter-apk/app-release.apk
For regions with limited connectivity, use these methods to distribute updates:
-
Direct APK sharing: Provide the APK file to extension officers via:
- USB drives (most common method)
- Email (where internet is available)
- Bluetooth transfer
-
Installation instructions for extension officers:
- Copy the APK file to the farmer's phone
- Navigate to the file using a file manager
- Tap the APK file to install (may need to enable "Install from Unknown Sources" in settings)
- If updating an existing installation, the app data will be preserved
When distributing updates, consider providing:
- Change summary: A simple document explaining what has changed in the new version
- Visual guides: Screenshots showing new features or modified screens
- Training sessions: Brief in-person demonstrations for extension officers
- Flutter SDK
- Android Studio or VS Code with Flutter extensions
- An Android or iOS device/emulator
-
Clone the repository:
git clone https://github.com/minerva-university/rationapp.git
-
Navigate to the project directory:
cd rationapp
-
Get dependencies:
flutter clean flutter pub get
-
Run the app:
flutter run
- constants/ - Static data and configuration
- data/ - Nutrition tables and local data sources
- l10n/ - Language localization files
- models/ - Data structures for core app concepts
- screens/ - Main UI pages
- services/ - Business logic and data management
- utils/ - Calculation utilities including feed optimization
- widgets/ - Reusable UI components
cow_requirements_calculator.dart
- Calculates nutritional needsfeed_calculator.dart
- Processes feed mixture calculationsfeed_optimizer.dart
- Implements linear optimization for least-cost feed
persistence_manager.dart
- Handles local data storage using SharedPreferencesfeed_state.dart
- Manages application state for feed ingredients
home_screen.dart
- Main navigation interfacecow_characteristics_page.dart
- Input screen for cow detailsfeed_formula_page.dart
- Feed planning interface
The project includes comprehensive unit tests covering core functionality. Run tests with:
flutter test
- Developed as part of the CSARIDE (Climate Smart Agriculture Research and Innovation Support for Dairy Value Chains in Eritrea) project
- Based on validated feeding calculations provided by dairy nutrition experts
https://drive.google.com/file/d/1SWrLI1id3nmioVazO3mt5RVLcD0GxiHE/view?usp=sharing
https://drive.google.com/file/d/1gP4m_uVphBi3CbbMOgZzetGX9MLo5bkG/view?usp=sharing
For questions or support, please contact somtochiumeh@gmail.com