Fix per-app proxy selection
This commit is contained in:
@@ -94,8 +94,16 @@ class PerAppProxyPage extends HookConsumerWidget with PresLogger {
|
||||
title: TextFormField(
|
||||
onChanged: (value) => searchQuery.value = value,
|
||||
autofocus: true,
|
||||
decoration: InputDecoration.collapsed(
|
||||
decoration: InputDecoration(
|
||||
hintText: "${localizations.searchFieldLabel}...",
|
||||
isDense: true,
|
||||
filled: false,
|
||||
border: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
enabledBorder: InputBorder.none,
|
||||
errorBorder: InputBorder.none,
|
||||
focusedErrorBorder: InputBorder.none,
|
||||
disabledBorder: InputBorder.none,
|
||||
),
|
||||
),
|
||||
leading: IconButton(
|
||||
@@ -179,7 +187,10 @@ class PerAppProxyPage extends HookConsumerWidget with PresLogger {
|
||||
package.name,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
subtitle: Text(package.packageName),
|
||||
subtitle: Text(
|
||||
package.packageName,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
value: selected,
|
||||
onChanged: (value) async {
|
||||
final List<String> newSelection;
|
||||
|
||||
@@ -20,7 +20,7 @@ class Pref<T> with InfraLogger {
|
||||
|
||||
/// Updates the value asynchronously.
|
||||
Future<void> update(T value) async {
|
||||
loggy.debug("updating preference [$key] to [$value]");
|
||||
loggy.debug("updating preference [$key]($T) to [$value]");
|
||||
try {
|
||||
if (mapTo != null && mapFrom != null) {
|
||||
await prefs.setString(key, mapTo!(value));
|
||||
@@ -45,10 +45,12 @@ class Pref<T> with InfraLogger {
|
||||
|
||||
T getValue() {
|
||||
try {
|
||||
loggy.debug("getting persisted preference [$key]");
|
||||
loggy.debug("getting persisted preference [$key]($T)");
|
||||
if (mapTo != null && mapFrom != null) {
|
||||
final persisted = prefs.getString(key);
|
||||
return persisted != null ? mapFrom!(persisted) : defaultValue;
|
||||
} else if (T == List<String>) {
|
||||
return prefs.getStringList(key) as T ?? defaultValue;
|
||||
}
|
||||
return prefs.get(key) as T? ?? defaultValue;
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user