Google Maps Integration
The app uses thegoogle_maps_flutter package for map rendering:
pubspec.yaml:54
RouteMapScreen
TheRouteMapScreen displays a route on an interactive map.
Basic Setup
lib/screens/route_map/route_map_screen.dart:39-70
Rendering the Map
lib/screens/route_map/route_map_screen.dart:254-283
DirectionsService
TheDirectionsService fetches route polylines from Google Directions API.
Getting Directions
lib/services/directions_service.dart:7-85
DirectionsResult Model
lib/services/directions_service.dart:127-148
Drawing Polylines
Polylines are drawn for each leg of the route.Color Coding by Mode
lib/screens/route_map/route_map_screen.dart:31-91
Creating Polylines
lib/screens/route_map/route_map_screen.dart:94-187
Walking Segments
Walking segments use dotted lines:lib/screens/route_map/route_map_screen.dart:123-132
Markers
Markers indicate start, end, and transfer points.Creating Markers
lib/screens/route_map/route_map_screen.dart:190-211
Marker Colors
- Green: Start point
- Red: End point
- Blue: Transfer/intermediate stops
Camera Bounds
The map automatically fits all route points in view:lib/screens/route_map/route_map_screen.dart:220-225
Node Address Mapping
Node IDs are mapped to real addresses for Google Directions API:lib/screens/route_map/route_map_screen.dart:8-75
Statistics Card
Display route statistics at the bottom:lib/screens/route_map/route_map_screen.dart:352-390
Legend
Show color legend for transport modes:lib/screens/route_map/route_map_screen.dart:421-447
Dark Map Style
Custom dark theme for the map:lib/screens/route_map/route_map_screen.dart:474-486
Example Usage
Error Handling
lib/screens/route_map/route_map_screen.dart:226-231