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