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