OpenCage Data Geocoding Library for Dart #
A Dart package that provides geocoding and reverse geocoding of locations using the OpenCage Geocoder geocoder.
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 (
var response = await geocoder.geocode("rennes", limit: 2, countryCode: "fr");
You will find links to the API docs on the pub page.
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.
MIT © Aloïs Deniel
- Added documentation.
- Update for Dart2
- 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:
$ pub get
$ 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:
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]
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.
lib/src/model.g.dart. (-9.08 points)
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.
lib/src/geocoder.dart. (-3.45 points)
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.
lib/src/model.dart. (-0.50 points)
lib/src/model.dart reported 1 hint:
line 133 col 12: Unnecessary new keyword.
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
opencage_geocoder.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.