|
|
|
|
@ -36,7 +36,7 @@ class LocationUtils {
|
|
|
|
|
if (value) {
|
|
|
|
|
await Geolocator.checkPermission().then((permission) async {
|
|
|
|
|
if (permission == LocationPermission.always || permission == LocationPermission.whileInUse) {
|
|
|
|
|
Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.best, timeLimit: Duration(seconds: 1)).then((value) {
|
|
|
|
|
Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.best, timeLimit: Duration(seconds: 5)).then((value) {
|
|
|
|
|
setLocation(value);
|
|
|
|
|
if (callBack != null) callBack(LatLng(value.latitude, value.longitude));
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
|