Install button, better indication when not ready

This commit is contained in:
franzap
2024-12-09 14:57:04 -03:00
parent 28b2576877
commit bcf7e736d5
+6 -2
View File
@@ -61,13 +61,15 @@ class InstallButton extends HookConsumerWidget {
builder: (context) => InstallAlertDialog(app: app),
);
}
} else {
} else if (app.canUpdate) {
app.install().catchError((e) {
if (context.mounted) {
context.showError(
title: 'Could not install', description: e.message);
}
});
} else {
// no action
}
},
ErrorInstallProgress(:final e, :final info, :final actions) => () {
@@ -93,7 +95,9 @@ class InstallButton extends HookConsumerWidget {
backgroundColor: switch (progress) {
ErrorInstallProgress() => Colors.red,
IdleInstallProgress() =>
app.hasCertificateMismatch ? Colors.grey : kUpdateColor,
(!app.canInstall && !app.canUpdate || app.hasCertificateMismatch)
? Colors.grey
: kUpdateColor,
_ => kUpdateColor,
},
progressColor: Colors.blue[800],