refactor : better logic

This commit is contained in:
2025-09-08 10:58:38 +03:30
parent 4ba59c12ec
commit 26c2437240

View File

@@ -161,11 +161,9 @@ class InspectionPoultryScienceLogic extends GetxController {
Future<void> submitInspectionReport({required int id}) async {
isOnUpload.value = true;
var tmpFiles = [];
for (var element in pickedImages) {
tmpFiles.add(await MultipartFile.fromFile(element.path, filename: element.name));
}
final tmpFiles = await Future.wait(
pickedImages.map((element) => MultipartFile.fromFile(element.path, filename: element.name)),
);
var data = FormData.fromMap({
'file': tmpFiles,