callCheckStockPorductApi method

Future<List<CheckStockContentModel>> callCheckStockPorductApi(
  1. String filterStatus,
  2. String userId,
  3. String filterId
)

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,
        userId: userId,
        xUserId: storage.read("XUSER_ID"));
    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 [];
  }
}