feat: fix debug updater

This commit is contained in:
2026-07-30 04:46:03 +02:00
parent 715aa529d4
commit 217be08231
9 changed files with 616 additions and 91 deletions
+5 -22
View File
@@ -344,7 +344,7 @@ class _SettingsScreenViewState extends State<SettingsScreenView> {
showDialog(
context: context,
barrierDismissible: !update.mandatory,
builder: (context) => AlertDialog(
builder: (dialogContext) => AlertDialog(
title: const Text("Update available"),
content: Column(
mainAxisSize: MainAxisSize.min,
@@ -358,30 +358,13 @@ class _SettingsScreenViewState extends State<SettingsScreenView> {
actions: [
if (!update.mandatory)
TextButton(
onPressed: () => Navigator.pop(context),
onPressed: () => Navigator.pop(dialogContext),
child: const Text("Later"),
),
FilledButton(
onPressed: () async {
Navigator.pop(context);
try {
await context.read<SettingsViewModel>().installUpdate(
update,
onProgress: (progress) {
debugPrint(
"Download ${(progress * 100).toStringAsFixed(0)}%",
);
},
);
} catch (e, stack) {
Sentry.captureException(e, stackTrace: stack);
if (!mounted) return;
ScaffoldMessenger.of(
context,
).showSnackBar(SnackBar(content: Text("Update failed: $e")));
}
onPressed: () {
Navigator.pop(dialogContext);
context.push('/update-progress', extra: update);
},
child: const Text("Update"),
),