Setting improvements

This commit is contained in:
Anton Tananaev 2025-06-13 15:40:47 -07:00
parent e6ac282afd
commit 20898a78e5
2 changed files with 13 additions and 2 deletions

View file

@ -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 ?? ''),