revert changes from excursion main and tracking service
This commit is contained in:
@@ -57,12 +57,17 @@ class TrackingService {
|
||||
|
||||
Future<void> startTracking(BuildContext context) async {
|
||||
if (isTracking) return;
|
||||
final LocationSettings locationSettings = LocationSettings(
|
||||
accuracy: LocationAccuracy.high
|
||||
);
|
||||
|
||||
_lastContext = context;
|
||||
await NotificationService().initNotification();
|
||||
NotificationService().showNotification(
|
||||
if (context.mounted) {
|
||||
NotificationService().showNotification(
|
||||
title: AppLocalizations.of(context)!.trackingRunningInBackground,
|
||||
);
|
||||
}
|
||||
|
||||
// Get tracking interval from settings
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
@@ -71,8 +76,9 @@ class TrackingService {
|
||||
// Create a timer that triggers position updates
|
||||
_positionTimer = Timer.periodic(Duration(seconds: intervalSeconds), (_) async {
|
||||
try {
|
||||
|
||||
final Position position = await Geolocator.getCurrentPosition(
|
||||
desiredAccuracy: LocationAccuracy.high,
|
||||
locationSettings: locationSettings
|
||||
);
|
||||
|
||||
pathList.add(LatLng(position.latitude, position.longitude));
|
||||
@@ -89,7 +95,7 @@ class TrackingService {
|
||||
// Get initial position immediately
|
||||
try {
|
||||
final Position position = await Geolocator.getCurrentPosition(
|
||||
desiredAccuracy: LocationAccuracy.high,
|
||||
locationSettings: locationSettings
|
||||
);
|
||||
|
||||
pathList.add(LatLng(position.latitude, position.longitude));
|
||||
@@ -208,4 +214,4 @@ class TrackingStats {
|
||||
required this.averageAccuracy,
|
||||
required this.totalDistanceMeters,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user