miguelpruivo / flutter_file_picker

File picker plugin for Flutter, compatible with mobile (iOS & Android), Web, Desktop (Mac, Linux, Windows) platforms with Flutter Go support.
MIT License
1.32k stars 653 forks source link

pickFile() returning null even when file is selected from device #1525

Closed KartikGavhale closed 2 months ago

KartikGavhale commented 3 months ago

bug discription The file_picker is working fine with almost all devices but i have a device Redmi 10A MIUI 12.5.18 global android version 11, here the when i click button the file selector is loaded but when i select the file , the pickFile() return null.

Platform

Platform OS version Android 11

Code to pick file

FilePickerResult? result = await FilePicker.platform.pickFiles( type: FileType.custom, withData: true, allowedExtensions: ['pdf','jpg','png'], ); print('resultPDF ${result}'); if (result != null) { File file = File(result.files.single.path!); int sizeInBytes = file.lengthSync(); double sizeInMb = sizeInBytes / (1024 * 1024); if(sizeInMb<=10) { return file; }else{ CommWidget.showWhiteToast("Please select filesize upto 10mb."); return null; } } else { CommWidget.showWhiteToast("File not selected"); return null; }

Flutter Version details Flutter 3.22

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 7 days with no activity.

github-actions[bot] commented 2 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.