Flutter Exclude file path not working while getting files
i am getting all pdf from device storage and working fine but in Android 12 permission denied errno 13 and asking to exclude Android/data folder im trying but the exclude is not working code to get files and exclude path
void getFiles() async {
if (await Permission.storage.request().isGranted) {
// Either the permission was already granted before or the user just granted it.
}
//asyn function to get list of files
List<StorageInfo> storageInfo = await PathProviderEx.getStorageInfo();
var root = storageInfo[0]
.rootDir; //storageInfo[1] for SD card, geting the root directory
var fm = FileManager(root: Directory(root)); //
files = await fm.filesTree(
excludedPaths: ["/storage/emulated/0/Android/data"],
extensions: ["开发者_运维技巧pdf"] //optional, to filter files, list only pdf files
);
setState(() {}); //update the UI
}
精彩评论