Bugfix for prev. commit

This commit is contained in:
Imran Remtulla
2023-04-30 00:15:53 -04:00
parent 81f66683d2
commit 04b3c8ad7d
3 changed files with 28 additions and 28 deletions

View File

@@ -120,19 +120,20 @@ class SettingsProvider with ChangeNotifier {
return result;
}
Future<void> getInstallPermission({bool enforce = false}) async {
Future<bool> getInstallPermission({bool enforce = false}) async {
while (!(await Permission.requestInstallPackages.isGranted)) {
// Explicit request as InstallPlugin request sometimes bugged
Fluttertoast.showToast(
msg: tr('pleaseAllowInstallPerm'), toastLength: Toast.LENGTH_LONG);
if ((await Permission.requestInstallPackages.request()) ==
PermissionStatus.granted) {
break;
return true;
}
if (!enforce) {
break;
return false;
}
}
return true;
}
bool get showAppWebpage {