Skip to content

majharul-islam181/SmartRoute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

29 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SmartRoute Planner ๐Ÿš—๐Ÿ“

A production-ready Flutter mobile application for interactive SmartRoute planning with real-time routing, distance calculation, location services, and an intuitive map interface.

Feature Screenshot Description
๐ŸŽฏ Welcome Screen Beautiful onboarding with instructions
๐Ÿ—บ๏ธ Interactive Map OpenStreetMap with tap-to-select
๐Ÿ›ฃ๏ธ Route Display Real-time route with distance & time
๐Ÿ“ Location Services Smart permission handling

โœจ 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

Advanced Features

  • ๐ŸŽฏ 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

Technical Features

  • ๐Ÿ—๏ธ 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

๐Ÿ›๏ธ Architecture

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


๐Ÿ› ๏ธ Tech Stack

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

๐Ÿš€ Getting Started

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

Installation

  • 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

Development Mode

# 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

Production Mode

# Run production flavor
flutter run --flavor production -t lib/main_production.dart --release

๐Ÿ“ฆ Building APK/IPA

# 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/

iOS IPA

# 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

๐ŸŒˆ Flavors

  • Switching Between Flavors
# Development
flutter run --flavor development -t lib/main_development.dart

# Production
flutter run --flavor production -t lib/main_production.dart

About

๐Ÿ“ Flutter route planning app with interactive maps, real-time routing, and GPS location services. Built with Clean Architecture, BLoC pattern, and OpenStreetMap. Free and open-source.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors