feat: Remove full external storage access (#1381)

This commit is contained in:
Benjamin 2023-10-15 02:44:11 -07:00 committed by GitHub
parent 5d5f311e36
commit f334da95ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,7 +19,6 @@ class NavigationViewModel extends IndexTrackingViewModel {
Future<void> initialize(BuildContext context) async { Future<void> initialize(BuildContext context) async {
locator<Toast>().initialize(context); locator<Toast>().initialize(context);
final SharedPreferences prefs = await SharedPreferences.getInstance(); final SharedPreferences prefs = await SharedPreferences.getInstance();
await requestManageExternalStorage();
if (prefs.getBool('permissionsRequested') == null) { if (prefs.getBool('permissionsRequested') == null) {
await Permission.storage.request(); await Permission.storage.request();
@ -60,17 +59,6 @@ class NavigationViewModel extends IndexTrackingViewModel {
); );
} }
Future<void> requestManageExternalStorage() async {
final manageExternalStorageStatus =
await Permission.manageExternalStorage.status;
if (manageExternalStorageStatus.isDenied) {
await Permission.manageExternalStorage.request();
}
if (manageExternalStorageStatus.isPermanentlyDenied) {
await openAppSettings();
}
}
Widget getViewForIndex(int index) { Widget getViewForIndex(int index) {
switch (index) { switch (index) {
case 0: case 0: