location_navigator 1.0.1
location_navigator: ^1.0.1 copied to clipboard
A Flutter package to navigate and find nearby places using location.
π Location Navigator #
A Flutter package to find and navigate nearby places (e.g. Mosques, Hospitals, Hotels, Restaurants, Pharmacies) using OpenStreetMap (Overpass API) and Geolocator.
β¨ Features #
- π Get user's current location with permission handling
- π Show nearby Mosques, Hospitals, Restaurants, Hotels, Pharmacies etc.
- π Dropdown to select place type (amenity)
- π Search box to filter nearby places by name
- π Places automatically sorted by distance
- πΊοΈ Built-in Map view with markers and navigation
- π¨ Simple Material Design with teal theme
βοΈ How It Works #
-
Get Current Location
Uses geolocator to request permission and fetch the user's latitude & longitude. -
Fetch Nearby Places
Calls OpenStreetMap (Overpass API) via aPlaceServiceto search for nearby places based on amenity type (e.g., hospital, mosque, hotel). -
Distance Calculation
Each place's distance from the user is calculated using:Geolocator.distanceBetween(...) Sorting & Filtering Select a category (Hospital, Mosque, Hotel etc.) via dropdown Or search any nearby place by name Results sorted by nearest distance Display Results A ListView shows the places with name, type, and distance On tap β opens a Map screen (powered by flutter_map ) where the userβs location and selected place are displayed
π¦ Installation
Add the dependency in your pubspec.yaml:
dependencies: location_navigator: ^1.0.1
Then run:
flutter pub get