Prepare Lunaris 1.1.2 experimental
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user