uploadMultiple method

Future<List<String?>?> uploadMultiple({
  1. dynamic progress(
    1. double
    )?,
  2. Function? complete,
  3. int compressQuality = 80,
  4. String? type,
  5. double maxHeight = 1024,
  6. double maxWidth = 1024,
})

Implementation

Future<List<String?>?> uploadMultiple({
  Function(double)? progress,
  Function? complete,
  int compressQuality = 80,
  String? type,
  double maxHeight = 1024,
  double maxWidth = 1024,
}) async {
  final pickedFiles = await ImagePicker().pickMultiImage(
    imageQuality: 100,
    maxHeight: maxHeight,
    maxWidth: maxWidth,
  );
  List<XFile> xFilePicks = pickedFiles;

  if (xFilePicks.isEmpty) return null;
  List<Future<String?>> uploads = [];
  for (XFile xFilePick in xFilePicks) {
    uploads.add(uploadFile(
      path: xFilePick.path,
      progress: progress,
      complete: complete,
      compressQuality: compressQuality,
      type: type,
    ));
  }
  return Future.wait(uploads);
}