Got rid of some redundant / can never happen type of if statements

This commit is contained in:
stopflock
2025-12-04 21:12:17 -06:00
parent 89f8ad2e0a
commit 6cda350f22
3 changed files with 35 additions and 49 deletions
+24 -26
View File
@@ -101,32 +101,30 @@ class NavigationSheet extends StatelessWidget {
address: provisionalAddress,
),
const SizedBox(height: 16),
// Only show routing buttons if navigation features are enabled
if (enableNavigationFeatures(offlineMode: appState.offlineMode)) ...[
Row(
children: [
Expanded(
child: ElevatedButton.icon(
icon: const Icon(Icons.directions),
label: Text(LocalizationService.instance.t('navigation.routeTo')),
onPressed: () {
appState.startRoutePlanning(thisLocationIsStart: false);
},
),
),
const SizedBox(width: 12),
Expanded(
child: ElevatedButton.icon(
icon: const Icon(Icons.my_location),
label: Text(LocalizationService.instance.t('navigation.routeFrom')),
onPressed: () {
appState.startRoutePlanning(thisLocationIsStart: true);
},
),
),
],
),
],
// Show routing buttons (sheet only opens when online, so always available)
Row(
children: [
Expanded(
child: ElevatedButton.icon(
icon: const Icon(Icons.directions),
label: Text(LocalizationService.instance.t('navigation.routeTo')),
onPressed: () {
appState.startRoutePlanning(thisLocationIsStart: false);
},
),
),
const SizedBox(width: 12),
Expanded(
child: ElevatedButton.icon(
icon: const Icon(Icons.my_location),
label: Text(LocalizationService.instance.t('navigation.routeFrom')),
onPressed: () {
appState.startRoutePlanning(thisLocationIsStart: true);
},
),
),
],
),
],
// SETTING SECOND POINT: Show both points and select button