AutoUpdaterStandalone class

Standalone auto-updater service using Flutter's built-in ValueNotifier.

This adapter wraps AutoUpdaterCore and provides reactive state management without any external dependencies like GetX, Provider, or Riverpod.

Usage:

// Create the service
final updater = AutoUpdaterStandalone(
  config: AutoUpdaterConfig(
    baseUrl: 'https://your-server.com',
    appId: 'com.example.app',
  ),
);

// Initialize (call once at app startup)
await updater.initialize();

// Listen to state changes
updater.isDownloading.addListener(() {
  print('Downloading: ${updater.isDownloading.value}');
});

// Or use ValueListenableBuilder in your widgets
ValueListenableBuilder<bool>(
  valueListenable: updater.isDownloading,
  builder: (context, isDownloading, child) {
    return isDownloading ? CircularProgressIndicator() : Container();
  },
)

Constructors

AutoUpdaterStandalone({required AutoUpdaterConfig config, AutoUpdaterStandaloneUI? ui})

Properties

config AutoUpdaterConfig
Access to the underlying configuration
no setter
core AutoUpdaterCore
Access to the core service (for debugging)
no setter
currentVersion CurrentVersionInfo?
Current app version info
no setter
deviceArchitecture String?
Device architecture (Android only)
no setter
downloadProgress ValueNotifier<double>
Reactive state: download progress (0.0 to 1.0)
final
downloadStatus ValueNotifier<String>
Reactive state: download status message
final
hashCode int
The hash code for this object.
no setterinherited
isCheckingForUpdate ValueNotifier<bool>
Reactive state: whether currently checking for updates
final
isDownloading ValueNotifier<bool>
Reactive state: whether currently downloading
final
isInitialized bool
Whether the service has been initialized
no setter
lastCheckResult ValueNotifier<UpdateCheckResult?>
Reactive state: last update check result
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
ui AutoUpdaterStandaloneUI?
final

Methods

cancelDownload() → void
Cancel an ongoing download
checkForUpdate({bool silent = true, BuildContext? context}) Future<UpdateCheckResult>
Check for updates.
cleanupDownloads() Future<void>
Clean up downloaded APK files
dispose() → void
Dispose of resources. Call when the service is no longer needed.
downloadAndInstall(VersionInfo versionInfo, {BuildContext? context}) Future<void>
Start the download and installation flow for a version.
initialize() Future<void>
Initialize the service. Must be called before using other methods.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited