picker static method

Future<List<PlatformFile>?> picker({
  1. FastPickerType type = FastPickerType.image,
  2. List<String>? accept,
  3. bool multiple = false,
  4. bool allowCompression = false,
  5. int compressionQuality = 0,
  6. String? dialogTitle,
  7. String? initialDirectory,
  8. bool lockParentWindow = false,
  9. dynamic onFileLoading(
    1. FilePickerStatus
    )?,
  10. bool readSequential = false,
  11. bool withData = false,
  12. 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;
}