latlong_to_place 0.0.7
latlong_to_place: ^0.0.7 copied to clipboard
A Flutter library to fetch device LatLng via geolocator and convert it into rich PlaceInfo via the null-safe geocoding plugin.
latlong_to_place #

A Flutter library to fetch the device’s current latitude/longitude via geolocator and convert it into detailed PlaceInfo (address components, city, state, country, etc.) via the null-safe geocoding plugin.
Features #
- 🗺️ getCurrentPlaceInfo() – asks for permission, fetches GPS coords, then reverse-geocodes.
- 🔄 getPlaceInfo(lat, lng) – reverse-geocode any coordinates.
- 🎯 Returns a
PlaceInfowith:formattedAddressstreetlocalitycitystatecountrypostalCodelatitudelongitude

- 🧭 Distance Support (New!)
- Calculate distance between multiple
LatLngpoints. - Get result in Kilometers, Meters, or Miles.
- Easy-to-use
DistanceServiceclass included.
- Calculate distance between multiple

Installation #
Add to your app’s pubspec.yaml:
dependencies:
latlong_to_place: ^0.0.4
🗺️ Best Route (OpenStreetMap)
Find the best route between two coordinates using free OpenStreetMap routing (OSRM).
### Example
```dart
final route = await RouteService.getBestRoute(
start: LatLng(28.6139, 77.2090),
end: LatLng(28.5355, 77.3910),
mode: TravelMode.driving,
);
print(route?.distanceKm); // in KM
print(route?.duration); // Duration
print(route?.polyline); // List<LatLng>