getGrnTransationList method

void getGrnTransationList()

Implementation

void getGrnTransationList() async {
  try {
    String requestTime = "";
    String responseTime = "";
    Helper.progressDialog(Get.context!, "Please wait..");
    await ApiClient(
      baseUrl: ApiConstant.armBaseUrl,
      onFetchRequestTime: (time) {
        requestTime = time;
      },
      onFetchResponseTime: (time) {
        responseTime = time;
      },
      screenName: "grnTransactionList",
    )
        .getGrnTransactions(
            filterStatus: "IN_TRANSIT",
            filterPartnerId: storage.read("PARTNER_ID_LOGIN"),
            sort: "id",
            orderBy: "ASC",
            pageNo: 0,
            perPageCount: 10)
        .then((value) {
      Get.back();
      Helper.logEvent(
        "RESPONSE_EVENT",
        success: true,
        endPoint: Api.grnTransactions,
        responseDate: responseTime,
        screenName: "grnTransactionList",
        requestDate: requestTime,
      );
      grnTransactionList.value = value.data?.content ?? [];
    }).catchError((onError) {
      Get.back();
      GenericResponse res = GenericResponse.fromJson(onError?.response?.data);
      Helper.messageDialog(
        Get.context!,
        res.responseCode ?? "Try again!!",
        res.responseMessage ?? "Something went wrong",
      );
    });
  } catch (e) {
    Get.back();
  }
}