getCpmDropDown method

dynamic getCpmDropDown({
  1. String? parentId,
  2. required int dropDownMasterId,
})

Implementation

getCpmDropDown({String? parentId, required int dropDownMasterId}) async {
  String requestTime = "";
  String responseTime = "";
  await ApiClient(
    baseUrl: ApiConstant.baseUrl,
    onFetchRequestTime: (time) {
      requestTime = time;
    },
    onFetchResponseTime: (time) {
      responseTime = time;
    },
    screenName: "approval",
  )
      .cpmDropDown(
    dropDownMasterId: dropDownMasterId,
  )
      .then((value) {
    Helper.logEvent(
      "RESPONSE_EVENT",
      success: true,
      endPoint: Api.cpmDropdown,
      responseDate: responseTime,
      screenName: "customerManagement",
      requestDate: requestTime,
    );
    if (value.content != null && value.content!.isNotEmpty) {
      if (dropDownMasterId == 11002) {
        eventDropdowns.clear();

        eventDropdowns.addAll(value.content?.toList() ?? []);
        // for(var state in stateDropdowns){
        //   if()
        // }
      }
    }
  }).catchError((err) {});
}