Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file_picker: ^8.1.6 ,FilePickerResult always return null,but 8.1.4 is ok #1652

Open
superluo opened this issue Dec 19, 2024 · 2 comments
Open
Labels
new issue An issue that hasn't yet been seen from the maintainer

Comments

@superluo
Copy link

problem: FilePickerResult always return null
code:FilePickerResult? result = await FilePicker.platform.pickFiles( allowMultiple: true );
version:file_picker: ^8.1.6

console log :[ ] I/FilePickerDelegate(24128): User cancelled the picker request

but
file_picker: 8.1.4 is ok

env:
flutter doctor -v
[✓] Flutter (Channel stable, 3.27.1, on macOS 15.2 24C101 darwin-arm64, locale en-US)
• Flutter version 3.27.1 on channel stable at /Users/abc/install/dev/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 17025dd882 (2 days ago), 2024-12-17 03:23:09 +0900
• Engine revision cb4b5fff73
• Dart version 3.6.0
• DevTools version 2.40.2

@superluo superluo added the new issue An issue that hasn't yet been seen from the maintainer label Dec 19, 2024
@abdelaziz-mahdy
Copy link
Contributor

looking at the difference in code it looks like a permission error, i am not sure but it may lead you to a fix 4083ae4

since the checks for permission got removed

@superluo
Copy link
Author

according:4083ae4

[android]
problem:file_picker: ^8.1.6
1.only support video and images ,others return null
demo code:
`
PermissionStatus status = await Permission.photos.request();
LogE("PermissionStatus.photos:${status.isGranted}"); // true
status = await Permission.videos.request();
LogE("PermissionStatus.videos:${status.isGranted}"); // true
status = await Permission.audio.request();
LogE("PermissionStatus.audio:${status.isGranted}"); // true
status = await Permission.manageExternalStorage.request();
LogE("PermissionStatus.manageExternalStorage:${status.isGranted}"); // true

FilePickerResult? result = await FilePicker.platform.pickFiles(
  allowCompression: false,
  allowMultiple: true,
  type: FileType.video,//  FileType.image, FileType.audio
);

2.[allowedExtensions] 2.1.works well code:
type: FileType.custom,
allowedExtensions: ['jpg', 'png', 'mp4', 'mov'],
2.2.return null
type: FileType.custom,// FileType.any
allowedExtensions: ['pdf','docx'],
`
2.3.console log:return null
[ ] I/FilePickerDelegate(20648): User cancelled the picker request

3.file_picker: ^8.1.4

always works well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new issue An issue that hasn't yet been seen from the maintainer
Projects
None yet
Development

No branches or pull requests

2 participants