submitScannedAssets method

Future<void> submitScannedAssets(
  1. dynamic amount
)

Implementation

Future<void> submitScannedAssets(amount) async {
  BuildContext context = Get.context!;
  Helper.progressDialog(context, "Please wait, preparing the submit");
  var scannedAssetList = <Map<String, dynamic>>[];
  for (var prodct in productDataScannedList) {
    if (prodct.scannedQty > 0) {
      for (var element in prodct.scannedserialNums!) {
        ScanSubmitRequest req = ScanSubmitRequest(
            productCode: prodct.productCode,
            serialNumber: element.toString());
        var reqData = req.toJson();
        scannedAssetList.add(reqData);
      }
    }
  }
  if (kDebugMode) {
    print(scannedAssetList.toString());
  }
  if (scannedAssetList.isNotEmpty) {
    Get.back();
    await callReservecreditSaleAPI(amount, scannedAssetList);
  }
}