fix: update download dialog blocking the UI

This commit is contained in:
Kingkor Roy Tirtho 2022-12-08 10:07:54 +06:00
parent 3386dac78e
commit 3925f74395

View File

@ -53,7 +53,11 @@ void useUpdateChecker(WidgetRef ref) {
final latestVersion = value.last;
if (currentVersion == null || latestVersion == null) return;
if (latestVersion <= currentVersion) return;
showPlatformAlertDialog(context, builder: (context) {
showPlatformAlertDialog(
context,
barrierDismissible: true,
barrierColor: Colors.black26,
builder: (context) {
const url =
"https://spotube.netlify.app/other-downloads/stable-downloads";
return PlatformAlertDialog(
@ -66,11 +70,11 @@ void useUpdateChecker(WidgetRef ref) {
),
],
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text("Spotube v${value.last} has been released"),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const PlatformText("Read the latest "),
AnchorButton(
@ -86,7 +90,8 @@ void useUpdateChecker(WidgetRef ref) {
],
),
);
});
},
);
});
return null;
}, [packageInfo, isCheckUpdateEnabled]);