start method
Implementation
Future<void> start() async {
// Use the navigator's overlay context so `showDialog` always finds a
// Navigator, regardless of where ShorebirdUpdaterWidget sits in the tree.
final context = manager.navigatorKey.currentState?.overlay?.context;
if (context == null || !context.mounted) {
return;
}
_showChecking(context);
final available = await manager.checkForUpdates();
if (!context.mounted) return;
Navigator.of(context, rootNavigator: true).pop();
if (!available) return;
final update = await _showUpdateDialog(context);
if (!update) return;
_showDownloading(context);
final downloaded = await manager.downloadUpdate();
if (!context.mounted) return;
Navigator.of(context, rootNavigator: true).pop();
// Only prompt to restart if the patch was actually downloaded and staged.
if (!downloaded) return;
_showRestart(context);
}