Less restrictive install permission requests (#488)

This commit is contained in:
Imran Remtulla
2023-04-30 00:02:23 -04:00
parent 392554123b
commit 81f66683d2
4 changed files with 10 additions and 12 deletions

View File

@@ -120,7 +120,7 @@ class SettingsProvider with ChangeNotifier {
return result;
}
Future<void> getInstallPermission() async {
Future<void> getInstallPermission({bool enforce = false}) async {
while (!(await Permission.requestInstallPackages.isGranted)) {
// Explicit request as InstallPlugin request sometimes bugged
Fluttertoast.showToast(
@@ -129,6 +129,9 @@ class SettingsProvider with ChangeNotifier {
PermissionStatus.granted) {
break;
}
if (!enforce) {
break;
}
}
}