submitScannedAssets method
Future<void>
submitScannedAssets(
- 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>>[];
productDataScannedList.forEach((prodct) {
if (prodct.scannedQty > 0) {
prodct.scannedserialNums!.forEach((element) {
ScanSubmitRequest req = ScanSubmitRequest(
productCode: prodct.productCode,
serialNumber: element.toString());
var reqData = req.toJson();
scannedAssetList.add(reqData);
});
}
});
ConditionalLogs().customLog("$scannedAssetList");
if (scannedAssetList.isNotEmpty) {
Helper.close();
await callReservecreditSaleAPI(amount, scannedAssetList);
}
}