google_maps_routes
1.1.2, released 5 years ago by aikenahac.com
Draw routes on Google Maps using the Directions API
What it does
This package uses the Google Directions API to generate polylines and display them on a GoogleMap widget. It also provides a distance calculator for the route.
AI-written summary of version 1.1.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to show driving, walking, bicycling or transit routes on a Google Map
- You want to calculate the distance of a route
- You want a simple API to add polylines to a map
Skip it when
- You are not using google_maps_flutter or you need a non‑Google map solution
- You need advanced routing features like turn‑by‑turn navigation
Strengths
- Easy to integrate with google_maps_flutter
- Supports multiple travel modes
- Provides a built‑in distance calculator
- No code generation required
Weaknesses
- Only works with Google Maps and the Directions API
- Requires a Google API key and billing enabled
- No offline routing support
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
Add google_maps_routes, google_maps_flutter, and flutter_polyline_points to pubspec. Provide a Google Directions API key. No build_runner or native permissions needed.
import 'package:google_maps_routes/google_maps_routes.dart';
List<LatLng> points = [LatLng(37.7749, -122.4194), LatLng(34.0522, -118.2437)];
MapsRoutes route = MapsRoutes();
await route.drawRoute(points, 'Route', Colors.blue, 'YOUR_API_KEY');
GoogleMap(polylines: route.routes);Alternatives
Packages that do the same job and could replace google_maps_routes.
- google_maps_flutter_web
Web platform implementation of google_maps_flutter.
88Compare - google_maps_flutter_android
Android implementation of the google_maps_flutter plugin.
82Compare - google_maps_flutter_ios
iOS implementation of the google_maps_flutter plugin.
81Compare - google_maps_flutter_ios_sdk10
iOS implementation of the google_maps_flutter plugin using Google Maps SDK 10.
77Compare
Works with
Packages commonly used together with google_maps_routes: ones it builds on, ones built on it, and its own family.