Welcome to the documentation for Aidra Driver, a comprehensive Flutter mobile application designed for driver management, collection tracking, and green energy initiatives.
Overview
Aidra Driver is a Flutter application (version 1.3.5+68) that provides a complete platform for drivers to manage collections, track locations in real-time, handle deliveries, and contribute to green energy initiatives. The application follows Clean Architecture principles with Domain-Driven Design (DDD) and uses the BLoC pattern for state management.
Key Features
🔐 Authentication & Security
- Secure user authentication with session management
- Biometric authentication support (Face ID, Fingerprint)
- Fast sign-in with saved credentials
- Secure storage for sensitive data
- JWT token-based authentication
📍 Location & Tracking
- Real-time GPS tracking
- Location services integration
- Maps integration with Google Maps
- Geolocation and geocoding support
- Route tracking for collections
📦 Collections Management
- Create and manage collection requests
- Track collection history
- Collection status management
- Real-time collection updates
- Offline collection support
🚚 Unloading & Delivery
- Unloading management
- Delivery tracking
- Signature capture
- Document handling
- Collection verification
📊 Dashboard & Analytics
- Driver dashboard with key metrics
- Collection statistics
- Performance tracking
- Analytics integration (PostHog)
💰 Wallet & Transactions
- Wallet functionality
- Transaction history
- Payment tracking
📚 E-Learning
- Educational content access
- Course materials
- Learning progress tracking
🔔 Notifications
- Push notifications (OneSignal)
- Firebase Cloud Messaging
- In-app notification center
- Real-time updates
⚙️ Settings & Configuration
- Profile management
- App settings
- Language preferences
- Theme customization
📱 Offline Support
- Offline-first architecture
- Local database (Isar)
- Offline sync service
- Queue management for offline operations
Architecture
The application follows Clean Architecture with the following structure:
lib/
├── core/ # Core functionality and utilities
│ ├── api/ # API client and network layer
│ ├── router/ # Navigation and routing
│ ├── services/ # Service locator and core services
│ ├── isar/ # Local database (Isar)
│ ├── UI/ # Reusable UI components
│ └── utils/ # Utility functions
├── features/ # Feature modules
│ ├── auth/
│ ├── collections/
│ ├── dashboard/
│ ├── e-learning/
│ ├── history/
│ ├── home/
│ ├── notifications/
│ ├── settings/
│ ├── unloading/
│ └── 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
Local Storage
- Isar - NoSQL database for local data
- SecureStorage - Secure credential storage
- SharedPreferences - App preferences and cache
Installation
To set up and run the project locally, follow these steps:
Prerequisites
- Flutter SDK (>=3.5.4)
- 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 aidra_driver_v1_0
- Install Flutter dependencies:
- 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)
- Domain layer (entities and use cases)
- 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: isar, flutter_secure_storage, shared_preferences
- UI Components: flutter_screenutil, flutter_svg, lottie
- Firebase: firebase_core, firebase_messaging, cloud_firestore
- Maps: google_maps_flutter, geolocator, geocoding
- Analytics: posthog_flutter
- Notifications: onesignal_flutter
Usage Examples
Basic Authentication Flow
import 'package:aidra_drive/features/auth/presentation/logic/auth_bloc/auth_bloc.dart';
final authBloc = AuthBloc();
authBloc.add(LoadSessionEvent());
authBloc.add(LoginEvent(email: 'driver@example.com', password: 'password'));
Navigation Example
import 'package:go_router/go_router.dart';
import 'package:aidra_drive/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:aidra_drive/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 easy_localization package. Language files are located in assets/translations/.
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
- Follow Clean Architecture principles
- 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: 1.3.5+68
Last Updated: 2024