getPartnerList method

Future<void> getPartnerList()

Implementation

Future<void> getPartnerList() async {
  try {
    String requestTime = "";
    String responseTime = "";
    isResponseReceived.value = false;

    final value = await ApiClient(
      baseUrl: ApiConstant.baseUrl,
      onFetchRequestTime: (time) {
        requestTime = time;
      },
      onFetchResponseTime: (time) {
        responseTime = time;
      },
      screenName: "onboardingHistory",
    ).onboardingHistory(
      approvalStatus: null,
      status: null,
      fromDate: null,
      toDate: null,
      page: 1,
      keyword: null,
      locationId1: null,
      locationId2: null,
      locationId3: null,
      locationId4: null,
      dealerGrade: null,
      dealerType: null,
      xUserId: SecureStorageService.readSecureData(
        SecureStorageService.xUserId,
      ),
      levelId: null,
      listAll: null,
      parentId: partnerId,
    );

    Helper.logEvent(
      "RESPONSE_EVENT",
      success: true,
      endPoint: Api.onboardingHistory,
      responseDate: responseTime,
      screenName: "onboardingHistory",
      requestDate: requestTime,
    );

    isResponseReceived.value = true;
    partnerList.value = value.content ?? [];
  } catch (err) {
    isResponseReceived.value = false;

    ConditionalLogs().customLog("getSubResellerListByParentId error: $err");
  }
}