<commit_before># Flutter Geocoding Plugin  

[![pub package](https://img.shields.io/pub/v/geocoding.svg)](https://pub.dartlang.org/packages/geocoding)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart)
[![Build Status](https://app.bitrise.io/app/9b65bb23ab8807cf/status.svg?token=<KEY>)](https://app.bitrise.io/app/9b65bb23ab8807cf)
[![codecov](https://codecov.io/gh/Baseflow/flutter-geocoding/branch/master/graph/badge.svg)](https://codecov.io/gh/Baseflow/flutter-geocoding)

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](https://flutter.io/platform-plugins/). For example:

```yaml
dependencies:
  geocoding: ^1.0.4
```

> **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](https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility). 
>
>The TL;DR version is:
>
>1. Add the following to your "gradle.properties" file:
>
>```
>android.useAndroidX=true
>android.enableJetifier=true
>```
>2. Make sure you set the `compileSdkVersion` in your "android/app/build.gradle" file to 28:
>
>```
>android {
>  compileSdkVersion 28
>
>  ...
>}
>```
>3. 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:

``` dart
import 'package:geocoding/geocoding.dart';

try {
    List<Location> locations = await locationFromAddress("Gronausestraat 710, Enschede");
} on NoResultFoundException {
    // Implement behaviour on no results
    rethrow;
}
```

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

``` dart
import 'package:geocoding/geocoding.dart';

try{
    List<Placemark> placemarks = await placemarkFromCoordinates(52.2165157, 6.9437819);
} on NoResultFoundException {
    // Implement behaviour on no results
    rethrow;
}
```
<commit_msg>Fix documentation referring to old method name<commit_after># Flutter Geocoding Plugin  

[![pub package](https://img.shields.io/pub/v/geocoding.svg)](https://pub.dartlang.org/packages/geocoding)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart)
[![Build Status](https://app.bitrise.io/app/9b65bb23ab8807cf/status.svg?token=<KEY>)](https://app.bitrise.io/app/9b65bb23ab8807cf)
[![codecov](https://codecov.io/gh/Baseflow/flutter-geocoding/branch/master/graph/badge.svg)](https://codecov.io/gh/Baseflow/flutter-geocoding)

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](https://flutter.io/platform-plugins/). For example:

```yaml
dependencies:
  geocoding: ^1.0.4
```

> **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](https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility). 
>
>The TL;DR version is:
>
>1. Add the following to your "gradle.properties" file:
>
>```
>android.useAndroidX=true
>android.enableJetifier=true
>```
>2. Make sure you set the `compileSdkVersion` in your "android/app/build.gradle" file to 28:
>
>```
>android {
>  compileSdkVersion 28
>
>  ...
>}
>```
>3. 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 `locationFromAddress` method:

``` dart
import 'package:geocoding/geocoding.dart';

try {
    List<Location> locations = await locationFromAddress("Gronausestraat 710, Enschede");
} on NoResultFoundException {
    // Implement behaviour on no results
    rethrow;
}
```

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

``` dart
import 'package:geocoding/geocoding.dart';

try{
    List<Placemark> placemarks = await placemarkFromCoordinates(52.2165157, 6.9437819);
} on NoResultFoundException {
    // Implement behaviour on no results
    rethrow;
}
```

{'fraction_non_alphanumeric': 0.12363508277562522, 'fraction_numerical': 0.017964071856287425, 'mean_word_length': 5.0095238095238095, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 49, 'https://': 28, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4452702', 'n_tokens_mistral': 1864, 'n_tokens_neox': 1738, 'n_words': 506}