picker static method
Future<List<PlatformFile> ?>
picker({
- FastPickerType type = FastPickerType.image,
- List<
String> ? accept, - bool multiple = false,
- bool allowCompression = false,
- int compressionQuality = 0,
- String? dialogTitle,
- String? initialDirectory,
- bool lockParentWindow = false,
- dynamic onFileLoading()?,
- bool readSequential = false,
- bool withData = false,
- bool withReadStream = false,
Implementation
static Future<List<PlatformFile>?> picker({
FastPickerType type = FastPickerType.image,
List<String>? accept,
bool multiple = false,
bool allowCompression = false,
int compressionQuality = 0,
String? dialogTitle,
String? initialDirectory,
bool lockParentWindow = false,
dynamic Function(FilePickerStatus)? onFileLoading,
bool readSequential = false,
bool withData = false,
bool withReadStream = false,
}) async {
try {
final result = await FilePicker.platform.pickFiles(
allowMultiple: multiple,
type: type._picker,
allowedExtensions: accept,
allowCompression: allowCompression,
compressionQuality: compressionQuality,
dialogTitle: dialogTitle,
initialDirectory: initialDirectory,
lockParentWindow: lockParentWindow,
onFileLoading: onFileLoading,
readSequential: readSequential,
withData: withData,
withReadStream: withReadStream
);
if (result != null) {
return result.files;
}
} on UnimplementedError {
throw 'Unimplemented method channel -> please, uninstall your app and install again.';
} catch (e) {
rethrow;
}
return null;
}