Setting improvements
This commit is contained in:
parent
e6ac282afd
commit
20898a78e5
2 changed files with 13 additions and 2 deletions
|
|
@ -8,6 +8,7 @@
|
|||
"statusButton": "Show status",
|
||||
"settingsButton": "Change settings",
|
||||
"invalidValue": "Invalid value",
|
||||
"disabledValue": "Disabled",
|
||||
"idLabel": "Device identifier",
|
||||
"urlLabel": "Server URL",
|
||||
"accuracyLabel": "Location accuracy",
|
||||
|
|
@ -17,7 +18,7 @@
|
|||
"intervalLabel": "Interval (seconds)",
|
||||
"fastestIntervalLabel": "Fastest interval (seconds)",
|
||||
"distanceLabel": "Distance (meters)",
|
||||
"heartbeatLabel": "Heartbeat (seconds)",
|
||||
"heartbeatLabel": "Stationary heartbeat (seconds)",
|
||||
"bufferLabel": "Offline buffering",
|
||||
"disableElasticityLabel": "Disable elasticity",
|
||||
"stopDetectionLabel": "Stop detection",
|
||||
|
|
|
|||
|
|
@ -96,7 +96,17 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||
}
|
||||
|
||||
Widget _buildListTile(String title, String key, bool isInt) {
|
||||
final value = isInt ? Preferences.instance.getInt(key)?.toString() : Preferences.instance.getString(key);
|
||||
String? value;
|
||||
if (isInt) {
|
||||
final intValue = Preferences.instance.getInt(key);
|
||||
if (intValue != null && intValue > 0) {
|
||||
value = intValue.toString();
|
||||
} else {
|
||||
value = AppLocalizations.of(context)!.disabledValue;
|
||||
}
|
||||
} else {
|
||||
value = Preferences.instance.getString(key);
|
||||
}
|
||||
return ListTile(
|
||||
title: Text(title),
|
||||
subtitle: Text(value ?? ''),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue