You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the allowedExtensions parameter in flutter_file_picker is subject to a predefined list of supported file formats. This restricts the ability of developers to handle completely custom file types that may not be included in the predefined list, such as proprietary formats (e.g., .maso).
This limitation forces developers to either:
Work around the library by post-filtering the files after selection.
Fork the library to support their specific needs.
Proposed Solution
Make allowedExtensions fully customizable by allowing any string as an extension. Instead of validating against a predefined list, the package could directly pass the provided extensions to the underlying platform implementation.
Expected Behavior
Developers should be able to provide any valid string as an extension in the allowedExtensions parameter, such as:
FilePickerResult? result =awaitFilePicker.platform.pickFiles(
type:FileType.custom,
allowedExtensions: ['maso', 'xyz', 'customformat'],
);
This should enable filtering for the specified custom file types without restrictions.
Benefits
Supports proprietary and less common file types.
Enhances flexibility for diverse application scenarios.
Reduces the need for workarounds or modifications to the library.
The text was updated successfully, but these errors were encountered:
I had problems before where I wanted to only import CSV and had to resort to let everything fly: TrackMyIndoorWorkout/TrackMyIndoorWorkout@6157af1
Now I realize that I cannot pick any file whatsoever with that file picker either from my Google Drive or my local Download of my phone.
Yes @MrCsabaToth, I have applied the same solution. Letting the users can select any type of file and handle in Dart to search in the path if it is correct or not.
if (!filePath.endsWith(".csv")) {
throwFileInvalidException("The loaded file is not a CSV file.");
}
But in my opinion this is an avoidable boilerplate. I don't see why there should be a list of supported file formats instead of supporting a custom format that can be dynamically configured by the developer.
Yes @MrCsabaToth, I have applied the same solution. Letting the users can select any type of file and handle in Dart to search in the path if it is correct or not.
if (!filePath.endsWith(".csv")) {
throwFileInvalidException("The loaded file is not a CSV file.");
}
But in my opinion this is an avoidable boilerplate. I don't see why there should be a list of supported file formats instead of supporting a custom format that can be dynamically configured by the developer.
My problem is that now no matter what I do I don't get back any file which was selected. Nada. Nuku. Zilch.
Problem Statement
Currently, the
allowedExtensions
parameter influtter_file_picker
is subject to a predefined list of supported file formats. This restricts the ability of developers to handle completely custom file types that may not be included in the predefined list, such as proprietary formats (e.g.,.maso
).This limitation forces developers to either:
Proposed Solution
Make
allowedExtensions
fully customizable by allowing any string as an extension. Instead of validating against a predefined list, the package could directly pass the provided extensions to the underlying platform implementation.Expected Behavior
Developers should be able to provide any valid string as an extension in the
allowedExtensions
parameter, such as:This should enable filtering for the specified custom file types without restrictions.
Benefits
The text was updated successfully, but these errors were encountered: