mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-15 21:03:41 +00:00
Make network auto control setting reactive with proper GetX observable
Co-authored-by: monkeyWie <[email protected]>
This commit is contained in:
1 parent
14df9490cf
commit
27dc7aea52
2 files changed
+14
-6
No files matched your search
@@ -550,18 +550,16 @@ class SettingView extends GetView<SettingController> {
|
||||
return null;
|
||||
}
|
||||
|
||||
return ListTile(
|
||||
return Obx(() => ListTile(
|
||||
title: Text('networkAutoControl'.tr),
|
||||
subtitle: Text('networkAutoControlTip'.tr),
|
||||
trailing: Switch(
|
||||
value: Database.instance.getNetworkAutoControl(),
|
||||
value: controller.networkAutoControl.value,
|
||||
onChanged: (bool value) {
|
||||
Database.instance.saveNetworkAutoControl(value);
|
||||
// Trigger rebuild to update the display value
|
||||
controller.update();
|
||||
controller.updateNetworkAutoControl(value);
|
||||
},
|
||||
),
|
||||
);
|
||||
));
|
||||
}
|
||||
|
||||
// advanced config proxy items start
|
||||
|
||||
Reference in new issue
Block a user