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

returns null when having allowedExtensions: ['jpg', 'png', 'pdf'] #1700

Closed
3 tasks
jtavio opened this issue Feb 6, 2025 · 6 comments
Closed
3 tasks

returns null when having allowedExtensions: ['jpg', 'png', 'pdf'] #1700

jtavio opened this issue Feb 6, 2025 · 6 comments
Labels
new issue An issue that hasn't yet been seen from the maintainer

Comments

@jtavio
Copy link

jtavio commented Feb 6, 2025

Describe the bug
when I configure my filepicker with what I want it to filter and either when selecting image or pdf the return is null, but when I define in the allowedExtensions only images or only pdf it brings me the correct answer, so I don't know why it doesn't work when I put images and pdf to select?

Platform

  • [x ] Android
  • iOS
  • Web
  • Desktop

Platform OS version
Android 15 (SDK 35) running physical phone.

How are you picking?

                    FilePickerResult? getBill;
                    getBill = await FilePicker.platform.pickFiles(
                      type: FileType.custom,
                      allowMultiple: true,
                      allowedExtensions: ['jpg', 'png', 'pdf'],
                    );

Details to reproduce the issue
test in this way

                    FilePickerResult? getBill;
                    getBill = await FilePicker.platform.pickFiles(
                      type: FileType.custom,
                      allowMultiple: true,
                      allowedExtensions: ['jpg', 'png', 'pdf'],
                    );

and it will return null, whatever you select, either image or pdf.

and thus returns the selected information

                    FilePickerResult? getBill;
                    getBill = await FilePicker.platform.pickFiles(
                      type: FileType.custom,
                      allowMultiple: true,
                      allowedExtensions: ['jpg', 'png'] // or allowedExtensions: ['pdf'],
                    );

Error Log
I/FilePickerDelegate(21258): User cancelled the picker request

Flutter Version details
✓] Flutter (Channel stable, 3.27.1, on macOS 13.6 22G120 darwin-arm64, locale en-VE)
• Flutter version 3.27.1 on channel stable at /Users/gregspinetti/Development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 17025dd882 (hace 7 semanas), 2024-12-17 03:23:09 +0900
• Engine revision cb4b5fff73
• Dart version 3.6.0
• DevTools version 2.40.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/gregspinetti/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15C500b
• CocoaPods version 1.15.2

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.96.2)
• VS Code at /Users/gregspinetti/Desktop/Visual Studio Code.app/Contents
• Flutter extension version 3.104.0

[✓] Connected device (4 available)
• 23129RA5FL (mobile) • ab52f82 • android-arm64 • Android 15 (API 35)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.6 22G120 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 13.6 22G120 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 132.0.6834.160

[✓] Network resources
• All expected network resources are available.

• No issues found!

@jtavio jtavio added the new issue An issue that hasn't yet been seen from the maintainer label Feb 6, 2025
@Jaehyeon0415
Copy link

same issue.

  • flutter: 3.27.4
  • file_picker: 8.1.7
  • Galaxy S21 / Android 13

@dipakravalVH
Copy link

Has same issue in android 14.

@joma1021
Copy link

joma1021 commented Feb 7, 2025

up

@jay-k98
Copy link
Contributor

jay-k98 commented Feb 7, 2025

A fix was merged. Can you confirm it works? @jtavio @Jaehyeon0415

MrCsabaToth referenced this issue in TrackMyIndoorWorkout/TrackMyIndoorWorkout Feb 9, 2025
…, package_info_plus, syncfusion_flutter_charts

Transitive upgrade audioplayers_android, audioplayers_linux, device_info_plus_platform_interface, syncfusion_flutter_core
@Jaehyeon0415
Copy link

A fix was merged. Can you confirm it works? @jtavio @Jaehyeon0415

@jay-k98
file_picker 8.3.3 It work!! Thank you :)

@jtavio
Copy link
Author

jtavio commented Feb 10, 2025

Good afternoon @jay-k98 version 8.3.3 It work Thank you 👍🏼

@jtavio jtavio closed this as completed Feb 10, 2025
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

5 participants