Locate class


Main class, which does all heavy lifting, requests location permission, enables location and finally gets you location data feed in Stream format


hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
streamController StreamController
Controls location data flow from API endpoint
read / write


areWeGettingLocationUpdate() bool
If you need to know whether we're still getting location data, this can be queried by calling this method
enableLocation() Future<bool>
As you've already got permission from user to access device location, Lets get to enabling location If user accepts the request to enable android device location We get true in return else false
getLocationDataFeed({String locationServiceProvider: LocationServiceProvider.LocationManagerBasedLocation, String locationProvider: LocationProvider.GPS}) Stream<MyLocation>
We start location data feed request here. This method takes two optional positional parameters locationServiceProvider and locationProvider locationServiceProvider -> which is nothing but location service provider selector i.e. whether to get location data by using GoogleMobileServices based Fused Location Provider or platform based LocationManager locationProvider -> which identifies what kind of location service i.e. GPS/ Network, to use when we want to get platform's LocationManager based Location data. in case of GMSBasedLocationService, no need to send this parameter *** Remember one important thing, GMSBasedLocationService requires Access_Fine_Location permission.***
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
requestLocationPermission({String provider: LocationProvider.GPS}) Future<bool>
whenever you require location data, first make sure you have called this method, to check whether location permission is available or not. if permission is already granted, it'll simply return true is runtime permission is denied by user, it'll return false. decision to perform further operation needs to be taken by watching this methods result well it's async ;)
stopLocationDataFeed() Future<bool>
Stops live location data feed from Platform
toString() String
Returns a string representation of this object.


operator ==(dynamic other) bool
The equality operator. [...]