fix: request external storage for api level >= 33

This commit is contained in:
Orangerot 2025-01-08 12:13:05 +01:00
parent 856949ceef
commit f589cf8e92
2 changed files with 6 additions and 0 deletions

View file

@ -1,5 +1,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The following permission is related to the eSense library -->
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission
android:name="android.permission.BLUETOOTH"
android:maxSdkVersion="30" />

View file

@ -2,6 +2,7 @@ import 'dart:io';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:sense_the_rhythm/esense_connect_dialog.dart';
import 'package:sense_the_rhythm/esense_input.dart';
import 'package:sense_the_rhythm/simfile.dart';
@ -43,6 +44,7 @@ class _LevelSelectionState extends State<LevelSelection> {
}
Future<void> selectFolder() async {
await Permission.manageExternalStorage.request();
String? selectedFolder = await FilePicker.platform.getDirectoryPath();
if (selectedFolder != null) {