Asks Garage for the newest release of a project, downloads it with resume, checks the sha256, installs it beside the old one and restarts into it. Splash on garage_ui, a native stub and a first time installer for windows, bundle swap on mac, the system installer on android. No-op on web. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KHotisA4hV2xmuZsHTksFX
26 lines
968 B
Dart
26 lines
968 B
Dart
// Auto updates for a flutter app, akin to Discord's. One call at the top of
|
|
// main and the rest happens on its own:
|
|
//
|
|
// Future<void> main(List<String> args) async {
|
|
// await GarageUpdater.launch(
|
|
// args: args,
|
|
// project: "<project id>",
|
|
// build: 12,
|
|
// label: "v2610-1",
|
|
// branding: UpdaterBranding(name: "Garage Stash", logo: "assets/logo.png"),
|
|
// );
|
|
// runApp(const MyApp());
|
|
// }
|
|
//
|
|
// While the app runs, GarageUpdater.instance.ready says when a newer build has
|
|
// been downloaded, and restartToUpdate() moves over to it.
|
|
//
|
|
// On the web every call is a no-op.
|
|
library;
|
|
|
|
export "src/core/models.dart"
|
|
show UpdateInfo, UpdateRelease, UpdateAsset, UpdateStatus, UpdateError, UpdateDriver, DownloadProgress;
|
|
export "src/branding.dart" show UpdaterBranding, UpdateMode;
|
|
export "src/splash.dart" show UpdateSplash, UpdateSplashApp, SplashController, SplashStage;
|
|
export "src/updater.dart" show GarageUpdater;
|