location_provider

Last updated:

0 purchases

location_provider Image
location_provider Images
Add to Cart

Description:

location provider

Flutter location_provider Plugin #


A Flutter location_provider plugin which provides easy address and latlong and reverse-geocoding features.
Important:

This plugin uses the free Geocoding services provided by the iOS and Android platforms. This means that there are restrictions to their use. More information can be found in the Apple documentation for iOS and the Google documentation for Android.
When a PlatformException(IO_ERROR, ...) gets thrown, most of the times it means that the rate limit has been reached.
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, please follow the installation guide on the official geocoding plugin page.

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:

Add the following to your "gradle.properties" file:

android.useAndroidX=true
android.enableJetifier=true
copied to clipboard

Make sure you set the compileSdkVersion in your "android/app/build.gradle" file to 31:

android {
compileSdkVersion 31

...
}
copied to clipboard

Make sure you replace all the android. dependencies to their AndroidX counterparts (a full list can be found Android migration guide).


API #
To translate an address into latitude and longitude coordinates you can use the placemarkFromAddress method:
import 'package:location_provider/location_provider.dart';
final lat = await LocationHelper.getLatitudeFromAddress(address);
final lng = await LocationHelper.getLongitudeFromAddress(address);
copied to clipboard
If you want to translate latitude and longitude coordinates into an address you can use the placemarkFromCoordinates method:
import 'package:location_provider/location_provider.dart';

final address = await LocationHelper.getLocationFullAddress(lat, lan);
copied to clipboard
Example (Recording) #
https://user-images.githubusercontent.com/33664603/215685551-7dc56191-74d0-453d-b93c-05cc9dcdf8fb.mov
Issues #
Please file any issues, bugs or feature requests as an issue, you can contact us at [email protected].
Author #
This geocoding plugin for Flutter is developed by RahulKushwaha.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.