i using extention file_picker in flutter width extention filter
try {
result = await FilePicker.platform.pickFiles(
type: FileType.custom,
allowedExtensions: ['jpeg', 'jpg', 'heic', 'pdf'],
);
} catch (e) {
print('fileSelector ****${e}***');
}
but in Android i can select all files width any extension. In IOS work this filter fine. Is it a bug in file_picker or do I have to do something additional?
onPressed: () async {
String? outputFile =
await FilePicker.platform.saveFile(
allowedExtensions: null,
type: FileType.any,
dialogTitle:
'Please select an output file:',
fileName: 'show',
);
if (outputFile == null) return;
if (!outputFile.endsWith('.pdf')) {
outputFile = '$outputFile.pdf';
}
},
Just put a custom check if the outputFile doesn't have it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With