Welcome to the documentation for Aidra Connect, a comprehensive Flutter mobile application designed for environmental management, collection tracking, and educational resources.
Overview
Aidra Connect is a Flutter application (version 10.0.2+16) that provides a complete platform for managing environmental data, tracking collections, accessing e-learning resources, and monitoring CO2 emissions. The application follows modern Flutter development practices using the BLoC pattern for state management and provides a rich user experience with support for multiple languages and themes.
Key Features
🔐 Authentication & Security
- Secure user authentication with session management
- Biometric authentication support (Face ID, Fingerprint)
- JWT token-based authentication
- Secure storage for sensitive data
📊 Dashboard & Analytics
- Main Dashboard: Overview of key metrics and statistics
- Environmental Dashboard: Track environmental impact and sustainability metrics
- CO2 Emissions Tracking: Monitor and analyze carbon footprint
- Monthly Footprint Statistics: Detailed monthly environmental reports
📦 Collections Management
- Create and manage collection requests
- Track collection history and transactions
- Update collection details
- View proposed collection times
- Transaction history tracking
📚 E-Learning Platform
- Access to educational courses and materials
- PDF viewer for course documents
- QCM (Multiple Choice Questions) for assessments
- Course details and progress tracking
- Support for multiple learning modules
💰 Wallet & Transactions
- Digital wallet functionality
- Transaction history
- Payment processing integration
🔔 Notifications
- Push notifications via Firebase Cloud Messaging
- In-app notification center
- Real-time notification updates
⚙️ Settings & Configuration
- Theme customization (Light/Dark mode)
- Language selection and localization
- FAQ section
- Profile management
- Document management
🌍 Environmental Features
- Energy consumption tracking
- Waste management monitoring
- Transport impact analysis
- Water usage statistics
- Food consumption tracking
- Operational details dashboard
🛒 Smart E-Commerce
- Integrated e-commerce functionality
- Product browsing and management
Architecture
The application follows a clean architecture pattern with the following structure:
lib/
├── core/ # Core functionality and utilities
│ ├── api/ # API client and network layer
│ ├── router/ # Navigation and routing
│ ├── services/ # Service locator and dependency injection
│ ├── storage/ # Local storage management
│ ├── ui/ # Reusable UI components
│ └── utils/ # Utility functions
├── features/ # Feature modules
│ ├── authentication/
│ ├── dashboard/
│ ├── collections/
│ ├── elearning/
│ ├── environmental_dashboard/
│ ├── wallet/
│ └── ...
└── main.dart # Application entry point
State Management
The application uses the BLoC (Business Logic Component) pattern for state management:
- flutter_bloc for BLoC implementation
- bloc for core BLoC functionality
- Separate BLoCs/Cubits for each feature module
Dependency Injection
Routing
- GoRouter for declarative routing
- Route guards for authentication
- Deep linking support
Installation
To set up and run the project locally, follow these steps:
Prerequisites
- Flutter SDK (>=3.2.1 <4.0.0)
- Dart SDK
- Android Studio / Xcode (for mobile development)
- Firebase account (for push notifications and cloud services)
Setup Steps
- Clone the repository:
git clone <repository-url>
cd Connect-V.1.0
- Install Flutter dependencies:
- Configure environment variables:
- Create .env, .env.dev, and .env.test files in the root directory
- Add your configuration values (API endpoints, keys, etc.)
- Configure Firebase:
- Add google-services.json to android/app/
- Add GoogleService-Info.plist to ios/Runner/
- Run the application:
Building for Production
Android:
flutter build apk --release
# or
flutter build appbundle --release
iOS:
flutter build ios --release
Development
Code Structure
The project follows a feature-based modular architecture:
- Features: Each feature is self-contained with its own:
- Presentation layer (UI screens and widgets)
- Logic layer (BLoCs/Cubits)
- Data layer (models and repositories)
- Core: Shared functionality used across features:
- API client
- Routing
- Services
- Utilities
- UI components
Key Dependencies
- State Management: flutter_bloc, bloc
- Networking: dio
- Routing: go_router
- Dependency Injection: get_it
- Local Storage: flutter_secure_storage, shared_preferences, hive
- UI Components: flutter_screenutil, flutter_svg, lottie
- Firebase: firebase_core, firebase_messaging, cloud_firestore
- Charts: fl_chart
- PDF: syncfusion_flutter_pdfviewer, pdf
Environment Configuration
The application supports multiple environments:
- Development (dev)
- Test (test)
- Production (default)
Environment is set via --dart-define flag:
flutter run --dart-define=ENVIRONMENT=dev
Usage Examples
Basic Authentication Flow
import 'package:connect/features/authentication/presentation/logic/authentication_bloc/authentication_bloc.dart';
final authBloc = AuthenticationBloc();
authBloc.add(LoadSessionEvent());
authBloc.add(LoginEvent(email: 'user@example.com', password: 'password'));
Navigation Example
import 'package:go_router/go_router.dart';
import 'package:connect/core/router/routes.dart';
context.go(
Routes.dashboard.route);
context.go('${Routes.collectionDetails.route}/$collectionId');
Using BLoC
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:connect/features/dashboard/presentation/logic/dashboard_cubit/dashboard_cubit.dart';
BlocBuilder<DashboardCubit, DashboardState>(
builder: (context, state) {
if (state is DashboardLoaded) {
return DashboardView(data: state.data);
}
return LoadingIndicator();
},
)
Localization
The application supports multiple languages through the flutter_localization package. Language files are located in lib/core/localization/.
To add a new language:
- Create a new localization file
- Add translations
- Update the language selection in settings
Testing
Run tests using:
For integration tests:
flutter test integration_test/
Contributing
When contributing to this project:
- Follow the existing code structure and patterns
- Use BLoC pattern for state management
- Write meaningful commit messages
- Add documentation for new features
- Ensure all tests pass
License
[Add your license information here]
Support
For issues, questions, or contributions, please refer to the project repository or contact the development team.
Version: 10.0.2+16
Last Updated: 2024