mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-05-13 12:54:58 +02:00
Update and confirm english localizations.
This commit is contained in:
@@ -111,7 +111,12 @@
|
||||
"advancedSettings": "Advanced Settings",
|
||||
"advancedSettingsSubtitle": "Performance, alerts, and tile provider settings",
|
||||
"proximityAlerts": "Proximity Alerts",
|
||||
"networkStatusIndicator": "Network Status Indicator"
|
||||
"networkStatusIndicator": "Network Status Indicator",
|
||||
"keepScreenAwake": "Keep Screen Awake"
|
||||
},
|
||||
"keepScreenAwake": {
|
||||
"title": "Keep screen awake while using app",
|
||||
"subtitle": "Prevents the screen from turning off automatically while using the app"
|
||||
},
|
||||
"proximityAlerts": {
|
||||
"getNotified": "Get notified when approaching surveillance devices",
|
||||
|
||||
@@ -1,20 +1,45 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../../../app_state.dart';
|
||||
import '../../../services/localization_service.dart';
|
||||
|
||||
class KeepScreenAwakeSection extends StatelessWidget {
|
||||
const KeepScreenAwakeSection({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final appState = context.watch<AppState>();
|
||||
// Standard Pattern: Use AnimatedBuilder to respond to language/localization changes
|
||||
return AnimatedBuilder(
|
||||
animation: LocalizationService.instance,
|
||||
builder: (context, child) {
|
||||
final locService = LocalizationService.instance;
|
||||
final appState = context.watch<AppState>();
|
||||
|
||||
return SwitchListTile(
|
||||
title: const Text('Keep screen awake while using app'),
|
||||
subtitle: const Text('Prevents the screen from turning off automatically while using the app'),
|
||||
value: appState.keepScreenAwake,
|
||||
onChanged: (bool value) {
|
||||
appState.setKeepScreenAwake(value);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Bold Section Header (matches Max Nodes, Proximity, etc.)
|
||||
Text(
|
||||
locService.t('settings.keepScreenAwake'),
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
// The Functional Toggle
|
||||
SwitchListTile(
|
||||
contentPadding: EdgeInsets.zero, // Aligns switch text with the bold header
|
||||
title: Text(locService.t('keepScreenAwake.title')),
|
||||
subtitle: Text(
|
||||
locService.t('keepScreenAwake.subtitle'),
|
||||
style: const TextStyle(fontSize: 12),
|
||||
),
|
||||
value: appState.keepScreenAwake,
|
||||
onChanged: (bool value) {
|
||||
appState.setKeepScreenAwake(value);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ class MapViewState extends State<MapView> {
|
||||
final session = appState.session;
|
||||
final editSession = appState.editSession;
|
||||
|
||||
// Call the safe tracker using appState instead
|
||||
// Keep screen awake based on user setting
|
||||
_updateWakelock(appState.keepScreenAwake);
|
||||
|
||||
// Check if enabled profiles changed and refresh nodes if needed
|
||||
|
||||
Reference in New Issue
Block a user