picker static method

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