geocoding_platform_interface 1.0.0+3

  • Readme
  • Changelog
  • Installing
  • 73

Flutter geocoding Plugin #

pub package Build Status codecov

A Flutter geocoding plugin which provides easy geocoding and reverse-geocoding features.

Note: The availability of the Google Play Services depends on your country. If your country doesn't support a connection with the Google Play Services, you'll need to try a VPN to establish a connection. For more information about how to work with Google Play Services visit the following link: https://developers.google.com/android/guides/overview

Usage #

To use this plugin, add geocoding as a dependency in your pubspec.yaml file. For example:

dependencies:
  geocoding: ^1.0.0

NOTE: This plugin relies on the AndroidX version of the Android Support Libraries. This means you need to make sure your Android project is also upgraded to support AndroidX. Detailed instructions can be found here.

The TL;DR version is:

  1. Add the following to your "gradle.properties" file:
android.useAndroidX=true
android.enableJetifier=true
  1. Make sure you set the compileSdkVersion in your "android/app/build.gradle" file to 28:
android {
 compileSdkVersion 28

 ...
}
  1. Make sure you replace all the android. dependencies to their AndroidX counterparts (a full list can be found here: https://developer.android.com/jetpack/androidx/migrate).

API #

To translate an address into latitude and longitude coordinates you can use the placemarkFromAddress method:

import 'package:geocoding/geocoding.dart';

List<Placemark> placemark = await geocoding().placemarkFromAddress("Gronausestraat 710, Enschede");

If you want to translate latitude and longitude coordinates into an address you can use the placemarkFromCoordinates method:

import 'package:geocoding/geocoding.dart';

List<Placemark> placemark = await geocoding().placemarkFromCoordinates(52.2165157, 6.9437819);

Both the placemarkFromAddress and placemarkFromCoordinates accept an optional localeIdentifier parameter. This parameter can be used to enforce the resulting placemark to be formatted (and translated) according to the specified locale. The localeIdentifier should be formatted using the syntax: [languageCode]_[countryCode]. Use the ISO 639-1 or ISO 639-2 standard for the language code and the 2 letter ISO 3166-1 standard for the country code. Some examples are:

Locale identifierDescription
enAll English speakers (will translate all attributes to English)
en_USEnglish speakers in the United States of America
en_UKEnglish speakers in the United Kingdom
nl_NLDutch speakers in The Netherlands
nl_BEDutch speakers in Belgium

Issues #

Please file any issues, bugs or feature requests as an issue on our GitHub page. Commercial support is available, you can contact us at hello@baseflow.com.

Want to contribute #

If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our contribution guide and send us your pull request.

Author #

This geocoding plugin for Flutter is developed by Baseflow.

1.0.0+3 #

  • Renamed the method placemarkFromAddress to locationFromAddress.

1.0.0+2 #

  • Return location class from the placemarkFromAddress method.

1.0.0+1 #

  • Add missing street and toString implementation to Placemark.

1.0.0 #

  • Initial open-source release.

Use this package as a library

1. Depend on it

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


dependencies:
  geocoding_platform_interface: ^1.0.0+3

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:geocoding_platform_interface/geocoding_platform_interface.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
53
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
83
Overall:
Weighted score of the above. [more]
73
Learn more about scoring.

We analyzed this package on Jul 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • geocoding_platform_interface that is a package requiring null.

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 geocoding_platform_interface.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

The package description is too short. (-7 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
meta ^1.1.8 1.1.8 1.2.1
plugin_platform_interface ^1.0.2 1.0.2
Transitive dependencies
collection 1.14.12 1.14.13
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
effective_dart ^1.2.1
flutter_test
mockito ^4.1.1