callCheckStockPorductApi method
Implementation
Future<List<CheckStockContentModel>> callCheckStockPorductApi(
String filterStatus, String userId, String filterId) async {
BuildContext context = Get.context!;
//Helper.progressDialog(context, "Please wait..");
try {
String requestTime = "";
String responseTime = "";
CheckStockProductModel model = await ApiClient(
baseUrl: ApiConstant.armBaseUrl,
onFetchRequestTime: (time) {
requestTime = time;
},
onFetchResponseTime: (time) {
responseTime = time;
},
screenName: "checkStock",
).getScanInTransactions(
filterPogId: filterId,
filterStatus: filterStatus,
filterIncludeAllProducts: true,
filterRetailerOnly: true,
userId: userId,
xUserId: SecureStorageService.readSecureData(
SecureStorageService.xUserId,
),
);
Helper.logEvent(
"RESPONSE_EVENT",
success: true,
endPoint: Api.getScanInTransactions,
responseDate: responseTime,
screenName: "checkStock",
requestDate: requestTime,
);
if (model.status == true) {
if (model.data != null) {
productList = model.data!.content ?? [];
searchedProductList.value = productList;
}
} else {
productList = [];
searchedProductList.value = productList;
}
//Get.back();
return productList;
} catch (e) {
//Get.back();
return [];
}
}