Package selection guidance compiled from public package information, community data, and project usage.
A Flutter package that converts geographic coordinates or Google encoded polyline strings into a list of latitude and longitude points. It simplifies the process of working with polylines in maps by decoding complex polyline data commonly used in routing services. Ideal for displaying routes, paths, or travel tracks on maps within Flutter applications. The package supports multiple platforms including Android, iOS, macOS, Windows, and Linux, ensuring cross-platform consistency.
Use cases
Displaying map routes from encoded polylines
Converting coordinate lists to polylines
Integrating with navigation or tracking features
Rendering custom paths on maps
Processing route data from APIs
Key features
Supports Google encoded polyline decoding
Handles raw coordinate arrays
Cross-platform compatibility
Lightweight and easy to integrate
Provides accurate point conversion
Suitable for
Map-based apps with routing
Location tracking applications
Navigation tools
Route visualization features
Developers using Google Maps API
Considerations
Requires valid input data (coordinates or encoded string)
Does not handle map rendering itself
Depends on external map widgets for display
No built-in error handling for malformed inputs
Limited to polyline point extraction only
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
Flutter Polyline Points
A Flutter package for decoding polyline points from Google Maps Directions API and the new Google Routes API. This package provides a unified interface supporting both legacy Directions API and the enhanced Google Routes API.
🚀 Version 3.0 - Simplified Routes API Integration
Version 3.0 introduces a simplified and unified approach to Google's routing services:
Single PolylinePoints class for both APIs
Simplified Routes API integration with essential features
Enhanced request/response models with better type safety
Custom body parameters for advanced use cases
Comprehensive test coverage for reliability
Backward compatibility maintained for existing code
Note: Custom headers are only supported with the Routes API (getRouteBetweenCoordinatesV2). The legacy Directions API uses GET requests and doesn't support custom headers.
🔄 Migration Guide
From v2.x to v3.0
Version 3.0 simplifies the API while maintaining backward compatibility:
// OLD (v2.x)PolylinePoints polylinePoints = PolylinePoints();
PolylineResult result = await polylinePoints.getRouteBetweenCoordinates(
googleApiKey: "YOUR_API_KEY",
request: request,
);
// NEW (v3.0)PolylinePoints polylinePoints = PolylinePoints(apiKey: "YOUR_API_KEY");
PolylineResult result = await polylinePoints.getRouteBetweenCoordinates(
request: request,
);
Converting Between APIs
// Convert Routes API response to legacy formatRoutesApiResponse routesResponse = await polylinePoints.getRouteBetweenCoordinatesV2(
request: routesRequest,
);
PolylineResult legacyResult = polylinePoints.convertToLegacyResult(routesResponse);