feat: Add setting to disable map tab for battery savings

Add a new "Disable Map" toggle in settings that allows users to hide
the map tab entirely. This is useful for scenarios where the map is
not needed and battery conservation is a priority.

Changes:
- Add disableMap and disableMapDescription localized strings (all languages)
- Add isMapEnabled state to AppProvider with persistence
- Update HomeScreen to dynamically adjust tab count based on setting
- Make onNavigateToMap optional in MessagesTab and ContactsTab
- Add toggle switch in Settings screen under Interface section
This commit is contained in:
Janez Troha
2025-12-04 18:33:00 +01:00
parent 53aa8e57e2
commit 3e2e4aa4d9
19 changed files with 258 additions and 30 deletions

View File

@@ -528,6 +528,19 @@ class _SettingsScreenState extends State<SettingsScreen> {
},
),
),
Consumer<AppProvider>(
builder: (context, appProvider, child) => SwitchListTile(
secondary: const Icon(Icons.map_outlined),
title: Text(AppLocalizations.of(context)!.disableMap),
subtitle: Text(
AppLocalizations.of(context)!.disableMapDescription,
),
value: !appProvider.isMapEnabled,
onChanged: (value) async {
await appProvider.toggleMapEnabled(!value);
},
),
),
ListTile(
leading: const Icon(Icons.language),
title: Text(AppLocalizations.of(context)!.language),