google_maps_webservice 0.0.15

  • Readme
  • Changelog
  • Installing
  • 96

google_maps_webservice #

Build Status codecov Donate

Google Maps Web Services API

API key #

To use this library you need a Web API key. Here

This is not compatible with Android and iOS API key but can be use inside a Flutter app.

Availables API #

Usage #

Geocoding #

import "package:google_maps_webservice/geocoding.dart";

final geocoding = new GoogleMapsGeocoding(apiKey: "<API_KEY>");
final geocoding = new GoogleMapsGeocoding(apiKey: "<API_KEY>", httpClient: new BrowserClient());
final geocoding = new GoogleMapsGeocoding(baseUrl: "");

GeocodingResponse response = await geocoding.searchByAddress("1600 Amphitheatre Parkway, Mountain View, CA");

Places #

import "package:google_maps_webservice/places.dart";

final places = new GoogleMapsPlaces(apiKey: "<API_KEY>");
final places = new GoogleMapsPlaces(apiKey: "<API_KEY>", httpClient: new BrowserClient());
final places = new GoogleMapsPlaces(baseUrl: "");

PlacesSearchResponse reponse = await places.searchNearbyWithRadius(new Location(31.0424, 42.421), 500);
PlacesSearchResponse reponse = await places.searchNearbyWithRankby(new Location(31.0424, 42.421), "distance");
PlacesSearchResponse reponse = await places.searchByText("123 Main Street");

PlacesDetailsResponse response = await places.getDetailsByPlaceId("PLACE_ID");
PlacesDetailsResponse response = await places.getDetailsByReference("REF");

Timezone #

import "package:google_maps_webservice/timezone.dart";

final timezone = new GoogleMapsTimezone(apiKey: "<API_KEY>");
final timezone = new GoogleMapsTimezone(apiKey: "<API_KEY>", httpClient: new BrowserClient());
final timezone = new GoogleMapsTimezone(baseUrl: "");

TimezoneResponse response = await timezone.getByLocation(new Location(31.0424, 42.421));
TimezoneResponse response = await timezone.getByLocation(new Location(31.0424, 42.421), timestamp: DateTime.utc(2019, 4, 24));
TimezoneResponse response = await timezone.getByLocation(new Location(31.0424, 42.421), timestamp: DateTime.utc(2019, 4, 24), language: 'es');

Proxy #

In case of using a proxy the baseUrl can be set. The apiKey is not required in case the proxy sets it. (Not storing the apiKey in the app is good practice)

Feature Requests and Issues #

Please file feature requests and bugs at the issue tracker.

Changelog #

0.0.15 #

  • Handle 'now' string for departure_time
  • Fix alternatives params
  • fix GeocodedWaypoint.partialMatch type (now a boolean)

0.0.14 #

  • Support Timezone API, thanks to @aryzhov
  • Support fields and region for place details

0.0.13 #

  • Support Photos API, thanks to @domesticmouse

0.0.12 #

  • Add Distance Matrix API, thanks to @1abid

0.0.11 #

  • fix session token
  • add pagetoken for searchNearby

0.0.10 #

  • introduced configurable base url
  • changed apiKey to an optional named parameter
  • added session token parameter for autocomplete search

0.0.9 #

  • fix partial match type in geocoding

0.0.8 #

  • fix 'Int' is not double

0.0.7 #

  • fix opening hours

0.0.6 #

  • update dart sdk

0.0.5 #

  • bug fix

0.0.4 #

  • support Dart 2

0.0.3 #

  • parse Geometry field in place details response

0.0.2 #

  • Directions API

0.0.1 #

  • Geocoding API
  • Places API

Use this package as a library

1. Depend on it

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

  google_maps_webservice: ^0.0.15

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or 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_maps_webservice/directions.dart';
import 'package:google_maps_webservice/distance.dart';
import 'package:google_maps_webservice/geocoding.dart';
import 'package:google_maps_webservice/geolocation.dart';
import 'package:google_maps_webservice/places.dart';
import 'package:google_maps_webservice/timezone.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 Oct 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21


Detected platforms: Flutter, web, other

No platform restriction found in libraries.

Health suggestions

Fix lib/src/core.dart. (-1.49 points)

Analysis of lib/src/core.dart reported 3 hints:

line 268 col 5: DO use curly braces for all flow control structures.

line 270 col 5: DO use curly braces for all flow control structures.

line 277 col 5: DO use curly braces for all flow control structures.

Maintenance suggestions

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.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

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

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <3.0.0
http >=0.11.0 <1.0.0 0.12.0+2
meta ^1.1.0 1.1.7
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
http_parser 3.1.3
path 1.6.4
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
coverage ^0.12.2
pedantic ^1.4.0 1.8.0+1
test ^1.3.0
test_coverage ^0.2.3