๐ geo_selector A Flutter widget that provides a map-based location picker with support for: Location search (forward geocoding) Reverse geocoding (get address from lat/lng) My Location button Route planning (optional) with start & end points Integration with OpenStreetMap using flutter_map โจ Features ๐ Select any location by tapping on the map ๐ Search for places using address or name (OpenStreetMap Nominatim) ๐ฏ "My Location" button to jump to deviceโs current location ๐ Display the address of the selected point ๐ Optional Route Mode to calculate routes between two points ๐ Callbacks return LocationResult and routes (List
class LocationPickerExample extends StatelessWidget { const LocationPickerExample({super.key});
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text("Select Location")), body: GeoSelector( initialLocation: const LatLng(28.6139, 77.2090), // New Delhi enableMyLocation: true, showAddress: true, enableRoute: true, onLocationSelected: (LocationResult result) { debugPrint("Selected: Lat=${result.latitude}, " "Lng=${result.longitude}, " "Address=${result.address}"); }, onRouteCalculated: (List
LocationResult({ required this.latitude, required this.longitude, this.address, }); } ๐น Behavior Single Search Mode (default): Tap on map โ select location Search bar for address lookup Address shown at bottom Route Mode (if enableRoute = true): Start & End location input fields Buttons to set current selection as Start/End "Calculate Route" โ draws polyline on map โก Dependencies flutter_map โ Map rendering latlong2 โ LatLng model location โ Device GPS http โ API calls (geocoding/routing) ๐ฎ Roadmap โ Route planning (basic polyline) โ Forward & Reverse geocoding ๐ฒ Autocomplete for search ๐ฒ Custom map tile provider support ๐ฒ Offline maps