refactor(updates): pass typed runtime policy to deskup

This commit is contained in:
lingjhf committed 2026-10-06 13:38:11 +08:00
1 parent 1ef8edc8bc
commit d83f94afd5
13 files changed
+158 -102

No files matched your search

+7 -2
View File
@@ -1,6 +1,7 @@
import 'dart:async';
import '../diagnostics/app_diagnostics.dart';
import 'app_update_configuration.dart';
import 'package:deskup/deskup.dart';
import 'package:flutter/foundation.dart';
@@ -26,7 +27,11 @@ AppUpdateBridge appUpdateBridge(Ref ref) {
// Application adapter: Riverpod ownership and the macOS workspace quit gate.
class AppUpdateBridge {
AppUpdateBridge([MethodChannel channel = appUpdatesChannel])
: _updater = Deskup(channel: channel);
: _updater = Deskup(
channel: channel,
windows: windowsUpdateConfiguration(),
macos: macosUpdateConfiguration(),
);
final Deskup _updater;
Stream<UpdateStatus> get events => _updater.events;
@@ -65,7 +70,7 @@ class AppUpdateBridge {
Future<void> check() => _updater.check();
Future<void> download() => _updater.download();
Future<void> validateInstall() => _updater.validateInstall();
Future<void> install() => _updater.install();
Future<void> install() => _updater.install(silent: true, restart: true);
Future<void> setAutomaticChecks(bool enabled) =>
_updater.setAutomaticChecks(enabled);