Forward and reverse geocodeing is easy now
- Easy To Use
- No Errors
import 'package:geocoder2/geocoder2.dart';
GeoData data = await Geocoder2.getDataFromCoordinates(
latitude: 40.714224,
longitude: -73.961452,
googleMapApiKey: "GOOGLE_MAP_API_KEY");
//Formated Address
print(data.address);
//City Name
print(data.city);
//Country Name
print(data.country);
//Latitude
print(data.latitude);
//Longitude
print(data.longitude);
//Postal Code
print(data.postalCode);
//State
print(data.state);
//Street Number
print(data.street_number);
GeoData data = await Geocoder2.getDataFromAddress(
address: "277 Bedford Ave, Brooklyn, NY 11211, USA",
googleMapApiKey: "GOOGLE_MAP_API_KEY");
//Formated Address
print(data.address);
//City Name
print(data.city);
//Country Name
print(data.country);
//Latitude
print(data.latitude);
//Longitude
print(data.longitude);
//Postal Code
print(data.postalCode);
//State
print(data.state);
//Street Number
print(data.street_number);