Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
Aidra Driver

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

  1. Clone the repository:
    git clone <repository-url>
    cd aidra_driver_v1_0
  2. Install Flutter dependencies:
    flutter pub get
  3. Configure Firebase:
    • Add google-services.json to android/app/
    • Add GoogleService-Info.plist to ios/Runner/
  4. Run the application:
    flutter run

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';
// Initialize authentication
final authBloc = AuthBloc();
authBloc.add(LoadSessionEvent());
// Handle login
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';
// Navigate to dashboard
context.go(Routes.dashboard.route);
// Navigate with parameters
context.go('${Routes.collectionDetails.route}/$collectionId');
Routes
Definition routes.dart:30

Using BLoC

import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:aidra_drive/features/dashboard/presentation/logic/dashboard_cubit/dashboard_cubit.dart';
// Access BLoC in widget
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:

flutter test

For integration tests:

flutter test integration_test/

Contributing

When contributing to this project:

  1. Follow the existing code structure and patterns
  2. Use BLoC pattern for state management
  3. Follow Clean Architecture principles
  4. Write meaningful commit messages
  5. Add documentation for new features
  6. 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