uploadMultiple method
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);
}