A production-ready Flutter mobile application for interactive SmartRoute planning with real-time routing, distance calculation, location services, and an intuitive map interface.
โจ Features Core Features
- โ Interactive Map Interface - Pan, zoom, and tap to select points
- โ Point-and-Select Functionality - Easy origin and destination marking with visual feedback
- โ Real-time Route Display - Instant route calculation using OSRM (Open Source Routing Machine)
- โ Distance & Duration - Accurate distance calculation and estimated travel time
- โ Current Location - GPS-based location services with permission handling
- โ Route Information Card - Displays distance, duration, and average speed
- ๐ฏ Smart Location Services - Automatic location fetch on app start
- ๐ Swap Origin/Destination - Easily reverse your route
- ๐ Visual Markers - Clear green (start) and red (end) markers
- ๐บ๏ธ Route Visualization - Beautiful blue polyline with smooth rendering
- ๐ซ Animated Instructions - Step-by-step guidance with progress indicators
- ๐จ Material Design 3 - Modern, beautiful UI/UX
- ๐ OpenStreetMap Integration - Free, open-source map tiles
- ๐๏ธ Clean Architecture - Separation of concerns with feature-first structure
- ๐ฅ BLoC State Management - Reactive, predictable state management
- ๐งช Production-Level Code - Comprehensive error handling, logging, and testing
- ๐ Flutter Flavors - Development and Production environments
- ๐ฆ Dependency Injection - GetIt for clean dependency management
- ๐ Type Safety - Freezed models with code generation
This project follows Clean Architecture principles with a feature-first folder structure:
lib/
โโโ main.dart
โโโ main_development.dart # Development flavor entry
โโโ main_production.dart # Production flavor entry
โ
โโโ app/ # Application layer
โ โโโ app.dart # Main app widget
โ โโโ router/ # Navigation/routing
โ โ โโโ app_router.dart
โ โโโ theme/ # Theme configuration
โ โโโ app_theme.dart
โ
โโโ core/ # Core utilities
โ โโโ config/ # App configuration
โ โ โโโ flavor_config.dart
โ โโโ constants/ # Constants
โ โ โโโ api_constants.dart
โ โ โโโ app_constants.dart
โ โโโ di/ # Dependency injection
โ โ โโโ injection_container.dart
โ โโโ errors/ # Error handling
โ โ โโโ exceptions.dart
โ โ โโโ failures.dart
โ โโโ network/ # Network layer
โ โ โโโ dio_client.dart
โ โ โโโ network_info.dart
โ โโโ utils/ # Utilities
โ โ โโโ extensions.dart
โ โ โโโ logger.dart
โ โโโ widgets/ # Reusable widgets
โ โโโ error_widget.dart
โ โโโ loading_widget.dart
โ โโโ permission_dialog.dart
โ โโโ welcome_dialog.dart
โ
โโโ features/ # Features
โโโ map/ # Map feature
โโโ data/ # Data layer
โ โโโ datasources/
โ โ โโโ routing_remote_datasource.dart
โ โ โโโ routing_remote_datasource_impl.dart
โ โโโ models/
โ โ โโโ coordinate_model.dart
โ โ โโโ route_model.dart
โ โ โโโ route_response_model.dart
โ โโโ repositories/
โ โโโ route_repository_impl.dart
โ
โโโ domain/ # Domain layer (Business Logic)
โ โโโ entities/
โ โ โโโ coordinate.dart
โ โ โโโ route.dart
โ โ โโโ route_info.dart
โ โโโ repositories/
โ โ โโโ route_repository.dart
โ โโโ usecases/
โ โโโ calculate_distance.dart
โ โโโ get_route.dart
โ
โโโ presentation/ # Presentation layer (UI)
โโโ bloc/
โ โโโ map_bloc.dart
โ โโโ map_event.dart
โ โโโ map_state.dart
โโโ screens/
โ โโโ map_screen.dart
โโโ widgets/
โโโ location_marker.dart
โโโ map_widget.dart
โโโ route_info_card.dart
โโโ route_polyline.dart
Framework & Language
- Flutter 3.0+ - Cross-platform mobile framework
- Dart 3.0+ - Programming language
State Management
- flutter_bloc ^8.1.5 - BLoC pattern implementation
- bloc ^8.1.4 - Core BLoC library
- equatable ^2.0.5 - Value equality
Map & Location
- flutter_map ^6.1.0 - Interactive map widget
- latlong2 ^0.9.0 - Latitude/Longitude calculations
- location ^6.0.2 - Location services (GPS)
- OpenStreetMap - Free map tiles
- OSRM - Free routing API (No API key required!)
Networking
- dio ^5.4.0 - HTTP client
- retrofit ^4.0.3 - Type-safe REST client
- pretty_dio_logger ^1.3.1 - Request/response logging
- internet_connection_checker ^1.0.0+1 - Network connectivity
Code Generation
- freezed ^2.4.6 - Immutable models
- json_serializable ^6.7.1 - JSON serialization
- build_runner ^2.4.8 - Code generation runner
Dependency Injection
- get_it ^7.6.7 - Service locator
- injectable ^2.3.2 - Code generation for DI
Utilities
- dartz ^0.10.1 - Functional programming (Either)
- logger ^2.0.2 - Beautiful logging
- shared_preferences ^2.2.2 - Local storage
- flutter_flavor ^3.1.3 - Environment flavors
Prerequisites
Ensure you have the following installed:
- Flutter SDK (>=3.0.0) - Install Flutter
- Dart SDK (>=3.0.0) - Comes with Flutter
- Android Studio / VS Code with Flutter extensions
- Android SDK / Xcode (for iOS)
- Git for version control
- Clone the repository``
git clone [https://github.com/majharul-islam181/SmartRoute.git]
cd smart_route
-
Install dependencies
flutter pub get -
Run code generation
flutter pub run build_runner build --delete-conflicting-outputs -
Check Flutter setup
flutter doctor -v -
๐ฎ Running the App
# Run on connected device (without flavors)
flutter run
# Run with development flavor
flutter run --flavor development -t lib/main_development.dart
# Run on specific device
flutter run --flavor development -t lib/main_development.dart -d <device-id>
# List available devices
flutter devices
# Run production flavor
flutter run --flavor production -t lib/main_production.dart --release
# Debug APK (Development)
flutter build apk --flavor development -t lib/main_development.dart --debug
# Release APK (Production)
flutter build apk --flavor production -t lib/main_production.dart --release
# Split APKs by ABI (Smaller file size)
flutter build apk --flavor production -t lib/main_production.dart --release --split-per-abi
-
APK Location:
build/app/outputs/flutter-apk/ -
Android App Bundle (for Play Store)
flutter build appbundle --flavor production -t lib/main_production.dart --release -
AAB Location:
build/app/outputs/bundle/productionRelease/
# Build for iOS
flutter build ios --flavor production -t lib/main_production.dart --release
# Create IPA
flutter build ipa --flavor production -t lib/main_production.dart --release
- Switching Between Flavors
# Development
flutter run --flavor development -t lib/main_development.dart
# Production
flutter run --flavor production -t lib/main_production.dart



