From 7102d19311f152800e120cab9216576fb29f57b2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 5 Jul 2025 09:52:01 -0700 Subject: [PATCH] Remove motion switch --- lib/l10n/app_en.arb | 1 - lib/main_screen.dart | 19 +------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 44afffb..4e01dd9 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -26,7 +26,6 @@ "wakelockLabel": "Wake lock", "stopDetectionLabel": "Stop detection", "trackingLabel": "Continuous tracking", - "motionLabel": "Active movement", "advancedLabel": "Advanced settings", "passwordLabel": "Password", "optimizationMessage": "To ensure reliable tracking, please disable battery optimization for this app.", diff --git a/lib/main_screen.dart b/lib/main_screen.dart index d8d42c4..fbf815e 100644 --- a/lib/main_screen.dart +++ b/lib/main_screen.dart @@ -18,7 +18,6 @@ class MainScreen extends StatefulWidget { class _MainScreenState extends State { bool trackingEnabled = false; - bool? stopDetection; bool? isMoving; @override @@ -31,7 +30,6 @@ class _MainScreenState extends State { final state = await bg.BackgroundGeolocation.state; setState(() { trackingEnabled = state.enabled; - stopDetection = Preferences.instance.getBool(Preferences.stopDetection); isMoving = state.isMoving; }); bg.BackgroundGeolocation.onEnabledChange((bool enabled) { @@ -94,6 +92,7 @@ class _MainScreenState extends State { contentPadding: EdgeInsets.zero, title: Text(AppLocalizations.of(context)!.trackingLabel), value: trackingEnabled, + activeTrackColor: isMoving == false ? Theme.of(context).colorScheme.error : null, onChanged: (bool value) async { if (await PasswordService.authenticate(context) && mounted) { if (value) { @@ -111,19 +110,6 @@ class _MainScreenState extends State { } }, ), - if (stopDetection == false) - SwitchListTile( - contentPadding: EdgeInsets.zero, - title: Text(AppLocalizations.of(context)!.motionLabel), - value: isMoving == true, - onChanged: (bool value) { - if (value) { - bg.BackgroundGeolocation.changePace(true); - } else { - bg.BackgroundGeolocation.changePace(false); - } - }, - ), const SizedBox(height: 8), OverflowBar( spacing: 8, @@ -177,9 +163,6 @@ class _MainScreenState extends State { onPressed: () async { if (await PasswordService.authenticate(context) && mounted) { await Navigator.push(context, MaterialPageRoute(builder: (_) => const SettingsScreen())); - setState(() { - stopDetection = Preferences.instance.getBool(Preferences.stopDetection); - }); } }, child: Text(AppLocalizations.of(context)!.settingsButton),