refactor : better logic
This commit is contained in:
@@ -161,11 +161,9 @@ class InspectionPoultryScienceLogic extends GetxController {
|
|||||||
Future<void> submitInspectionReport({required int id}) async {
|
Future<void> submitInspectionReport({required int id}) async {
|
||||||
isOnUpload.value = true;
|
isOnUpload.value = true;
|
||||||
|
|
||||||
var tmpFiles = [];
|
final tmpFiles = await Future.wait(
|
||||||
|
pickedImages.map((element) => MultipartFile.fromFile(element.path, filename: element.name)),
|
||||||
for (var element in pickedImages) {
|
);
|
||||||
tmpFiles.add(await MultipartFile.fromFile(element.path, filename: element.name));
|
|
||||||
}
|
|
||||||
|
|
||||||
var data = FormData.fromMap({
|
var data = FormData.fromMap({
|
||||||
'file': tmpFiles,
|
'file': tmpFiles,
|
||||||
|
|||||||
Reference in New Issue
Block a user