Update channel setting: AppSettings passed in (singletons_test back at its baseline)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
foxyzandClaude Opus 5.5 committed 2026-10-18 17:33:32 +03:00
1 parent ad53b6822a
commit 5116923858
1 file changed
+5 -5
@@ -196,7 +196,7 @@ class UpdateSettings extends StatelessWidget {
], ],
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
UpdateChannelSetting(controller: c), UpdateChannelSetting(controller: c, settings: s),
SignalBuilder( SignalBuilder(
builder: (context) => SwitchListTile( builder: (context) => SwitchListTile(
key: const ValueKey('auto-check-updates'), key: const ValueKey('auto-check-updates'),
@@ -216,11 +216,11 @@ class UpdateSettings extends StatelessWidget {
/// to go back to the latest release now when that one is older. /// to go back to the latest release now when that one is older.
class UpdateChannelSetting extends StatelessWidget { class UpdateChannelSetting extends StatelessWidget {
final UpdateController controller; final UpdateController controller;
final AppSettings? settings; final AppSettings settings;
const UpdateChannelSetting({super.key, required this.controller, this.settings}); const UpdateChannelSetting({super.key, required this.controller, required this.settings});
Future<void> _choose(BuildContext context, UpdateChannel ch) async { Future<void> _choose(BuildContext context, UpdateChannel ch) async {
final s = settings ?? AppSettings.instance; final s = settings;
if (ch == s.updateChannel.peek()) return; if (ch == s.updateChannel.peek()) return;
s.setUpdateChannel(ch); s.setUpdateChannel(ch);
if (ch == UpdateChannel.stable && isDevBuild(controller.currentVersion)) { if (ch == UpdateChannel.stable && isDevBuild(controller.currentVersion)) {
@@ -258,7 +258,7 @@ class UpdateChannelSetting extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final s = settings ?? AppSettings.instance; final s = settings;
return SignalBuilder(builder: (context) { return SignalBuilder(builder: (context) {
final ch = s.updateChannel.value; final ch = s.updateChannel.value;
return ListTile( return ListTile(