DesktopUpdaterController class
Coordinates update checks, downloads, and install handoff for UI code.
The controller owns the high-level UpdateState used by the ready-made widgets and by custom Flutter UI. Automatic startup checks run quietly and report failures through state; explicit calls such as checkVersion keep throwing so apps can handle user-triggered failures directly.
- Inheritance
-
- Object
- ChangeNotifier
- DesktopUpdaterController
Constructors
-
DesktopUpdaterController({required Uri? appArchiveUrl, DesktopUpdateLocalization? localization, bool allowUnsignedMacOSUpdates = false, String channel = "stable", String? installationIdentity, UpdatePreferences? preferences, UpdateRecoveryStore? recoveryStore, String? diagnosticsLogPath, DesktopUpdaterTelemetry? telemetry, MinimumOSSupportChecker? isMinimumOSSupported, UpdateDiagnosticsRecorder? diagnosticsRecorder, Future<
void> onProblemReport(UpdateProblemReport report)?, FutureOr<void> onCleanupReport(UpdateCleanupReport report)?, bool skipInitialVersionCheck = false, ReleaseNotesLoader? releaseNotesLoader, Uri? releaseNotesUrl}) - Creates a controller for a hosted zip-first app archive.
-
DesktopUpdaterController.forTesting({required Uri? appArchiveUrl, DesktopUpdateLocalization? localization, bool allowUnsignedMacOSUpdates = false, String channel = "stable", String? installationIdentity, UpdatePreferences? preferences, UpdateRecoveryStore? recoveryStore, String? diagnosticsLogPath, DesktopUpdaterTelemetry? telemetry, MinimumOSSupportChecker? isMinimumOSSupported, UpdateDiagnosticsRecorder? diagnosticsRecorder, Future<
void> onProblemReport(UpdateProblemReport report)?, FutureOr<void> onCleanupReport(UpdateCleanupReport report)?, bool skipInitialVersionCheck = false, ReleaseNotesLoader? releaseNotesLoader, Uri? releaseNotesUrl, ReleaseNotesFetcher? releaseNotesFetcher}) - Creates a controller with injected collaborators for unit testing.
Properties
- activeDescriptor → ReleaseDescriptor?
-
Descriptor selected by the latest successful update check, if any.
no setter
- allowUnsignedMacOSUpdates → bool
-
Allows macOS Release installs to bypass native signing, Gatekeeper,
stapler, and Team ID checks.
final
- appArchiveUrl → Uri?
-
Hosted
app-archive.jsonURL used for update checks.no setter - appName → String?
-
Name of the app from the active release descriptor, when available.
no setter
- appVersion → String?
-
Version from the active release descriptor, when available.
no setter
- canLoadReleaseNotes → bool
-
Whether release notes can be loaded for the selected update descriptor.
no setter
- canReportProblem → bool
-
Whether the app supplied an explicit problem-report callback.
no setter
- channel → String
-
Release channel used for update selection and skip preferences.
final
- diagnosticsLogPath → String?
-
Optional app-owned native helper diagnostics log path.
final
- diagnosticsRecorder → UpdateDiagnosticsRecorder
-
In-memory diagnostics recorder used to build failure reports.
no setter
- getLocalization → DesktopUpdateLocalization?
-
Current localization values used by bundled update UI.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- installationIdentity → String?
-
Stable app-owned identity used for deterministic staged rollouts.
final
- isMinimumOSSupported → MinimumOSSupportChecker?
-
Optional app-owned minimum OS support policy.
final
- lastCleanupReport → UpdateCleanupReport?
-
Most recent install scheduling or cleanup report emitted by this
controller.
no setter
- localization ↔ DesktopUpdateLocalization?
-
Optional strings used by bundled update UI.
getter/setter pair
- preferences → UpdatePreferences?
-
Optional app-owned persistence adapter for skipped versions.
final
- recoveryStore → UpdateRecoveryStore?
-
Optional app-owned persistence adapter for pending install recovery.
final
- releaseNotesState → ReleaseNotesState
-
Current release notes loading state.
no setter
- releaseNotesUrl → Uri?
-
Optional URL for hosted release notes JSON.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- skipInitialVersionCheck → bool
-
Whether construction should avoid starting the first automatic check.
no setter
- skipUpdate → bool
-
Whether the user has skipped the currently offered update in this session.
no setter
- state → UpdateState
-
Current update lifecycle state for UI rendering.
no setter
- telemetry → DesktopUpdaterTelemetry?
-
Optional app-owned telemetry callback.
final
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
checkForUpdates(
) → Future< ManualUpdateCheckResult> - Checks for updates for an explicit user action and returns a typed result.
-
checkVersion(
) → Future< void> - Checks for a newer release and updates state.
-
dispose(
) → void -
Discards any resources used by the object.
override
-
downloadUpdate(
) → Future< void> - Downloads, verifies, and stages the active release descriptor.
-
fetchReleaseNotes(
) → Future< ReleaseNotes> - Fetches and returns the hosted release notes.
-
init(
Uri url) → void - Sets the app archive URL and starts the initial update check when enabled.
-
loadReleaseNotes(
{bool forceRefresh = false}) → Future< ReleaseNotes> - Loads release notes for the active update descriptor.
-
makeSkipUpdate(
) → Future< void> - Marks the currently available update as skipped for this controller.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
recoverPendingInstall(
) → Future< void> - Recovers a pending native install marker from the app-owned store.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
reportProblem(
UpdateProblemReport report) → Future< void> - Invokes the app-owned problem-report callback when one was supplied.
-
restartApp(
) → Future< void> - Hands the staged update to the native installer or restart helper.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited