Split force update and check for update

This commit is contained in:
2025-09-27 21:49:13 +08:00
parent 113309257e
commit fe33931304
3 changed files with 95 additions and 75 deletions

View File

@@ -211,21 +211,11 @@ class _AboutScreenState extends ConsumerState<AboutScreen> {
icon: Symbols.system_update,
title: 'Check for updates',
onTap: () async {
// Fetch latest release and show the unified sheet
final svc = UpdateService();
// Reuse service fetch + compare to decide content
showLoadingModal(context);
final release = await svc.fetchLatestRelease();
svc.checkForUpdates(context);
if (!context.mounted) return;
hideLoadingModal(context);
if (release != null) {
await svc.showUpdateSheet(context, release);
} else {
showInfoAlert(
'Currently cannot get update from the GitHub.',
'Unable to check for updates',
);
}
},
),
_buildListTile(