GeolocatorService class

A service for handling geolocation and location-based data retrieval.

This service provides:

  • Access to the user's current position with permission handling.
  • Reverse geocoding to get city and country from coordinates.
  • Integration with the Google Places API to fetch nearby locations and generate a CustomMapPage widget with markers.

Constructors

GeolocatorService()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getCityAndCountryFromPosition(Position position) Future<String>
Returns a human-readable string containing the city and country from the provided Position using the Google Geocoding API.
getCurrentLocation() Future<Position>
Retrieves the user's current GPS position.
getNearbyPlacesMap({required Position position, int radius = 50000, String? type, required String title, required VoidCallback? onBack, LatLng? fallbackPosition}) Future<CustomMapPage>
Retrieves nearby places from the Google Places API and returns a CustomMapPage.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited