Some of my codes is as following:
File? _file;
PlatformFile? _platformFile;
selectFile() async {
final file = await FilePicker.platform.pickFiles(
type: FileType.custom,
allowedExtensions: ['mp3', 'm4a']
);
if (file != null) {
setState(() {
_file = File(file.files.single.path!);
_platformFile = file.files.first;
print("Size: ");
print(_platformFile?.size);
});
}
loadingController.forward();
}
When calling selectFile
, there should be a list full of .mp3
and .m4a
files. However, there is no files shown in the list. The picture is as following.enter image description here
I wondered that if it is beacuse that some varibles have not be set? Or some other details I have not noticed?
Thanks for your help.