How ramonsantospinto/uberclone works
Purpose and Entry Points
UberClone is a Flutter Android/iOS urban-mobility portfolio app centered on location, destination search, route display, and trip lifecycle state. Flutter starts at lib/main.dart; native hosts bootstrap the Flutter runtime through android/app/src/main/kotlin/br/com/uberclone/uberclone/MainActivity.kt and ios/Runner/AppDelegate.swift.
Composition and Dependency Boundary
Centralized GetIt registration wires presentation to domain contracts and concrete data services in lib/core/DI/injection.dart. This is the main substitution boundary: UI/Bloc code should consume service interfaces rather than Google/Dio implementations. Shared device-location access sits separately in lib/core/services/location_service.dart.
Map Feature Structure
The primary feature is isolated under lib/features/map. Its domain layer defines provider-agnostic contracts and trip state: lib/features/map/domain/services/i_places_service.dart, lib/features/map/domain/services/i_directions_service.dart, and lib/features/map/domain/enums/trip_status.dart. This prevents presentation/domain code from depending directly on Google API details.
External Data Integration
Concrete implementations call mapping APIs and map responses into feature models: lib/features/map/data/services/places_service_impl.dart, lib/features/map/data/services/directions_service_impl.dart, lib/features/map/data/models/place_prediction.dart, and lib/features/map/data/models/route_info.dart. Google Maps/Places are the material external services; Dio is the HTTP client. API credentials also cross native boundaries via android/app/src/main/AndroidManifest.xml and ios/Runner/AppDelegate.swift.
State and Control Flow
lib/features/map/presentation/bloc/map_bloc.dart owns the reactive flow: location/map initialization, destination-search results, route calculation, and transitions through TripStatus. Events originate from presentation pages, invoke injected domain services, then emit state consumed by map and ride UI. The Bloc is the primary orchestration boundary between asynchronous services and rendering.
User-Facing Flow
The home/map flow is assembled in lib/features/map/presentation/screens/home_screen.dart and rendered through lib/features/map/presentation/pages/map_page.dart. Destination selection is handled by lib/features/map/presentation/pages/search_destination_page.dart; route/trip controls are surfaced through lib/features/map/presentation/widgets/uber_bottom_sheet.dart. Google Maps Flutter provides the native map surface, while marker and geometry utilities support map rendering in lib/core/utils/map_custom_marker.dart and lib/core/utils/map_helpers.dart.
Runtime and Platform Infrastructure
The app targets Flutter/Dart 3.x with native Android Gradle and iOS Xcode runners. Native map SDK configuration and permissions belong to android/app/src/main/AndroidManifest.xml and ios/Runner/Info.plist. The architecture currently represents a client application: no backend, persistence store, authentication provider, or dispatch service is present in the repository structure.
Main entry points: map_bloc.dart Map Bloc · injection.dart GetIt composition · map_page.dart Map page · places_service_impl.dart Places service
Components 22
Runtime
- Flutter app entry
lib/main.dart - Android host
android/app/src/main/kotlin/br/com/uberclone/uberclone/MainActivity.kt - iOS host
ios/Runner/AppDelegate.swift - Android map config · Supplies map SDK credentials and permissions.
android/app/src/main/AndroidManifest.xml - iOS permissions · Declares native location and map permissions.
ios/Runner/Info.plist
Core composition
- GetIt composition · Wires contracts to concrete services.
lib/core/DI/injection.dart - Device location
lib/core/services/location_service.dart - Map rendering utilities · Builds custom markers and map geometry.
lib/core/utils/map_custom_marker.dart - Map helpers
lib/core/utils/map_helpers.dart
Map domain
- Places contract
lib/features/map/domain/services/i_places_service.dart - Directions contract
lib/features/map/domain/services/i_directions_service.dart - Trip status
lib/features/map/domain/enums/trip_status.dart
Map data
- Places service
lib/features/map/data/services/places_service_impl.dart - Directions service
lib/features/map/data/services/directions_service_impl.dart - Place prediction
lib/features/map/data/models/place_prediction.dart - Route info
lib/features/map/data/models/route_info.dart - Google Maps & Places
Map presentation
- Map Bloc · Coordinates initialization, search, routing, and trip transitions.
lib/features/map/presentation/bloc/map_bloc.dart - Home screen
lib/features/map/presentation/screens/home_screen.dart - Map page
lib/features/map/presentation/pages/map_page.dart - Destination search
lib/features/map/presentation/pages/search_destination_page.dart - Trip controls
lib/features/map/presentation/widgets/uber_bottom_sheet.dart
Connections 25
- Android host → Flutter app entry: boots
- iOS host → Flutter app entry: boots
- Flutter app entry → GetIt composition: initializes
- Android map config → Google Maps & Places: credentials
- iOS host → Google Maps & Places: credentials
- GetIt composition → Places contract: binds implementation
- GetIt composition → Directions contract: binds implementation
- GetIt composition → Device location: provides
- Places service → Places contract: implements
- Directions service → Directions contract: implements
- Places service → Google Maps & Places: searches
- Directions service → Google Maps & Places: requests routes
- Places service → Place prediction: maps responses
- Directions service → Route info: maps responses
- Home screen → Map page: assembles
- Map page → Map Bloc: renders state
- Destination search → Map Bloc: dispatches search
- Trip controls → Map Bloc: dispatches trip actions
- Map Bloc → Device location: initializes location
- Map Bloc → Places contract: searches destinations
- Map Bloc → Directions contract: calculates route
- Map Bloc → Trip status: transitions
- Map page → Map rendering utilities: draws markers
- Map page → Map helpers: draws geometry
- iOS permissions → Device location: permits access