opencage_geocoder 1.0.1

OpenCage Data Geocoding Library for Dart #

A Dart package that provides geocoding and reverse geocoding of locations using the OpenCage Geocoder geocoder.

Usage #

Import package:opencage_geocoder/opencage_geocoder.dart, and use the Geocoder to access geocoding services.

A simple usage example:

var geocoder = new Geocoder("YOUR_KEY");
var response = await geocoder.geocode("rennes");
// Or
response = await geocoder.reverseGeocode(2.3514992, 48.8566101);

You can also add one of the named parameter (language, countryCode, bounds, abbrv, limit, minConfidence, noAnnotations, noDedupe, noRecord, addRequest) :

var response = await geocoder.geocode("rennes", limit: 2, countryCode: "fr");

You will find links to the API docs on the pub page.

Contributions #

Contributions are welcome! If you find a bug please report it and if you want a feature please report it.

If you want to contribute code please file an issue and create a branch off of the current dev branch and file a pull request.

License #

MIT © Aloïs Deniel

Changelog #

1.0.1 #

  • Added documentation.

1.0.0 #

  • Update for Dart2

0.0.5 #

  • Initial version

Use this package as a library

1. Depend on it

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


dependencies:
  opencage_geocoder: ^1.0.1

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

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

  • Dart: 2.7.1
  • pana: 0.13.5

Health issues and suggestions

Document public APIs. (-0.01 points)

141 out of 146 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/model.g.dart. (-9.08 points)

Analysis of lib/src/model.g.dart reported 19 hints, including:

line 16 col 22: The declaration '_$CoordinatesToJson' isn't referenced.

line 29 col 22: The declaration '_$PointToJson' isn't referenced.

line 45 col 22: The declaration '_$BoundsToJson' isn't referenced.

line 57 col 22: The declaration '_$TimestampToJson' isn't referenced.

line 69 col 22: The declaration '_$StayInformedToJson' isn't referenced.

Fix lib/src/geocoder.dart. (-3.45 points)

Analysis of lib/src/geocoder.dart reported 7 hints, including:

line 23 col 7: Don't explicitly initialize variables to null.

line 24 col 7: Don't explicitly initialize variables to null.

line 54 col 5: Don't explicitly initialize variables to null.

line 55 col 5: Don't explicitly initialize variables to null.

line 80 col 22: Unnecessary new keyword.

Fix lib/src/model.dart. (-0.50 points)

Analysis of lib/src/model.dart reported 1 hint:

line 133 col 12: Unnecessary new keyword.

Maintenance suggestions

The package description is too short. (-2 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.

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

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
json_annotation ^3.0.1 3.0.1
Dev dependencies
build_runner ^1.7.2
json_serializable ^3.2.5
pedantic ^1.9.0
test ^1.9.4