Prepare Lunaris 1.1.2 experimental

This commit is contained in:
2026-05-26 11:43:25 +03:00
parent 369dee02be
commit 9cff9e5307
42 changed files with 2041 additions and 303 deletions
@@ -435,14 +435,11 @@ class _SettingsContent extends ConsumerWidget {
),
FilledButton.icon(
onPressed: () async {
final url = Uri.tryParse(info.htmlUrl);
if (url != null) {
await launchUrl(url, mode: LaunchMode.externalApplication);
}
await _downloadUpdate(ref, info);
if (context.mounted) Navigator.pop(context);
},
icon: const Icon(Icons.open_in_new_rounded),
label: const Text('Update'),
icon: const Icon(Icons.download_rounded),
label: const Text('Download & open'),
),
],
),
@@ -450,6 +447,23 @@ class _SettingsContent extends ConsumerWidget {
ref.invalidate(settingsControllerProvider);
}
Future<void> _downloadUpdate(WidgetRef ref, AppUpdateInfo info) async {
final updateService = ref.read(updateServiceProvider);
final assetUrl = updateService.assetUrlForCurrentPlatform(info);
if (assetUrl == null) {
final url = Uri.tryParse(info.htmlUrl);
if (url != null) {
await launchUrl(url, mode: LaunchMode.externalApplication);
}
return;
}
await ref.read(downloadManagerServiceProvider).startUrl(
url: assetUrl,
fileName: updateService.assetFileName(info, assetUrl),
openAfterDownload: true,
);
}
Future<void> _showChangelog(BuildContext context) {
return showDialog<void>(
context: context,