fix: Request permissions a single time at boot

This commit is contained in:
Alberto Ponces 2022-09-16 17:29:32 +01:00
parent a3dca8c142
commit 9c3626c8ed

View File

@ -31,9 +31,12 @@ class NavigationViewModel extends IndexTrackingViewModel {
: Brightness.light,
),
);
RootAPI().hasRootPermissions();
Permission.requestInstallPackages.request();
Permission.ignoreBatteryOptimizations.request();
if (prefs.getBool('permissionsRequested') == null) {
await prefs.setBool('permissionsRequested', true);
RootAPI().hasRootPermissions();
Permission.requestInstallPackages.request();
Permission.ignoreBatteryOptimizations.request();
}
}
Widget getViewForIndex(int index) {