google_map_polyline 0.0.3+1

Gives polyline coordinates to set polylines in Google Map.

pub package

google_map_polyline #

Flutter plugin to retrieve coordinates (in latitude and longitude) to draw the polylines (Route) in google_maps_flutter package. This package made with the inspiration of flutter_polyline_points.

Getting Started #

To use this plugin, add google_map_polyline as a dependency in your pubspec.yaml file.

Example #

  1. First you need to create object using your Google Maps API key.
  1. Now you may able retrieve coordinates for the Polyline route.
  • Get the Polyline coordinates using location coordinates (latitude and longitude)
          await googleMapPolyline.getCoordinatesWithLocation(
              origin: LatLng(40.677939, -73.941755),
              destination: LatLng(40.698432, -73.924038),
              mode:  RouteMode.driving);	
  • Get the Polyline coordinates using address of the location
          await googleMapPolyline.getPolylineCoordinatesWithAddress(
              origin:  '55 Kingston Ave, Brooklyn, NY 11213, USA',
              destination:  '8007 Cypress Ave, Glendale, NY 11385, USA',
              mode:  RouteMode.driving);

Overview #

  • [x] Coordinates with Location Coordinates (Latitude and Longitude)
  • [x] Coordinates with Location Address
  • [x] Route Modes
    • [x] Driving
    • [x] Walking
    • [x] Bicycling
  • [ ] Coordinates with Location Coordinates and Address (example: Origin as address and Destination as coordinates)
  • [ ] Alternative routes

Feature Requests and Issues #

Please file feature requests and bugs at the issue tracker.

[0.0.1 - 0.0.3+1] - Initial publish

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  google_map_polyline: ^0.0.3+1

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:google_map_polyline/google_map_polyline.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Aug 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/src/map_polyline.dart. (-1 points)

Analysis of lib/src/map_polyline.dart reported 2 hints:

line 22 col 13: Await only futures.

line 41 col 13: Await only futures.

Fix lib/src/polyline_utils.dart. (-1 points)

Analysis of lib/src/polyline_utils.dart reported 2 hints:

line 36 col 24: Await only futures.

line 75 col 3: This function has a return type of 'String', but doesn't end with a return statement.

Format lib/google_map_polyline.dart.

Run flutter format to format lib/google_map_polyline.dart.

Format lib/src/route_mode.dart.

Run flutter format to format lib/src/route_mode.dart.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and google_map_polyline.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
dio ^2.1.10 2.1.13
flutter 0.0.0
google_maps_flutter ^0.5.19+2 0.5.20+3
Transitive dependencies
collection 1.14.11 1.14.12
cookie_jar 1.0.1
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies