This project addresses the critical need for accurate waste management predictions in South Africa through data-driven insights. The application leverages machine learning to predict waste tonnage across South African provinces, enabling better resource allocation and waste management strategies. By providing reliable waste generation forecasts, it supports sustainable waste reduction, reuse, recycling, and recovery activities. The solution bridges the gap between waste data and actionable insights for environmental sustainability.
- 🏠 Modern Home Screen - Beautiful gradient design with easy navigation
- 📊 Prediction Screen - Input forms for waste data with real-time validation
- 🤖 ML Integration - Machine learning predictions via REST API
- 📱 Responsive Design - Works on both Android and iOS devices
- ℹ️ About Screen - Detailed information about the app and data sources
- 🎨 Material Design 3 - Modern UI with smooth animations
The app connects to a publicly available FastAPI backend:
- Base URL:
https://sa-waste-linearregression.onrender.com - Prediction Endpoint:
https://sa-waste-linearregression.onrender.com/predict - Swagger UI Documentation:
https://sa-waste-linearregression.onrender.com/docs - Method: POST
- Content-Type: application/json
{
"number_of_facilities": 10,
"general_waste": 500,
"hazardous_waste": 50,
"province_features": [0, 0, 1, 0, 0, 0, 0, 0, 0, 0]
}{
"predicted_total_waste_tonnage": 1250.75
}Test the API: Visit the Swagger UI at https://sa-waste-linearregression.onrender.com/docs to interact with the API directly.
🎥 ** Demo**: Watch the 5-minute app demo
- Eastern Cape, Free State, Gauteng, KwaZulu-Natal, Limpopo
- Mpumalanga, North West, Northern Cape, Western Cape
- Flutter SDK: Version 3.8.1 or higher (Install Flutter)
- Dart SDK: Included with Flutter
- IDE: Android Studio, VS Code, or IntelliJ IDEA with Flutter plugins
- Device: Android/iOS device or emulator
-
Clone the repository:
git clone https://github.com/yourusername/SA_Waste_LinearRegression.git cd SA_Waste_LinearRegression/prediction_app -
Install Flutter dependencies:
flutter pub get
-
Verify Flutter installation:
flutter doctor
Fix any issues reported by Flutter Doctor.
-
Connect your device or start an emulator:
- Android: Connect via USB with Developer Options enabled, or start Android emulator
- iOS: Connect iPhone/iPad or start iOS Simulator (macOS only)
-
Run the application:
flutter run
Or for specific platforms:
flutter run -d android # For Android flutter run -d ios # For iOS
-
Build for release (optional):
flutter build apk # Android APK flutter build ios # iOS (macOS only)
- Ensure your device has Developer Options and USB Debugging enabled (Android)
- For iOS, ensure you have Xcode installed and device is trusted
- Run
flutter cleanfollowed byflutter pub getif you encounter dependency issues
flutter: Flutter SDKhttp: HTTP client for API callsprovider: State managementmaterial_design_icons_flutter: Additional icons
lib/
├── main.dart # App entry point
├── models/
│ └── prediction_model.dart # Data models
├── providers/
│ └── prediction_provider.dart # State management
├── screens/
│ ├── home_screen.dart # Home page
│ ├── prediction_screen.dart # Prediction form
│ └── about_screen.dart # About page
└── services/
└── api_service.dart # API integration
- Launch the app - Opens to a beautiful home screen
- Tap "Start Prediction" - Navigate to the prediction form
- Enter facility data: Number of facilities, waste amounts, select province
- Tap "Predict Waste Tonnage" - Get machine learning powered prediction
- View results - See predicted total waste tonnage