6/22/1
This commit is contained in:
@@ -29,7 +29,6 @@ class LocationBackgroundController extends GetxController {
|
||||
BackgroundLocation.startLocationService();
|
||||
BackgroundLocation.getLocationUpdates((location) {
|
||||
// Handle location updates here
|
||||
print("New location: ${location.latitude}, ${location.longitude}");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -47,21 +46,9 @@ class LocationBackgroundController extends GetxController {
|
||||
BackgroundLocation.setAndroidConfiguration(
|
||||
Duration.microsecondsPerSecond); // Set interval to 5 seconds
|
||||
|
||||
BackgroundLocation.getLocationUpdates((location1) {
|
||||
print('''\n
|
||||
Latitude: ${location1.latitude.toString()}
|
||||
Longitude: ${location1.longitude.toString()}
|
||||
Altitude: ${location1.altitude.toString()}
|
||||
Accuracy: ${location1.accuracy.toString()}
|
||||
Bearing: ${location1.bearing.toString()}
|
||||
Speed: ${location1.speed.toString()}
|
||||
|
||||
|
||||
''');
|
||||
});
|
||||
BackgroundLocation.getLocationUpdates((location1) {});
|
||||
} else {
|
||||
await Permission.locationAlways.request();
|
||||
print('Location permission not granted');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user