refactor : better logic
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user