FetchingCityState method

dynamic FetchingCityState({
  1. dynamic pincode,
  2. dynamic context,
})

Implementation

FetchingCityState({pincode, context}) async {
  var decodedResponse;
  final apibody = {
    "pincode": pincode.toString(),
  };
  try {
    http.Response response = await http
        .post(Uri.parse('${SDK_BASE_URL}pincode_state_city'), body: apibody);
    decodedResponse = json.decode(response.body);

    if (decodedResponse['status'] == 200) {
      Get.back();
      // showDialog(
      //     context: context,
      //     barrierDismissible: false,
      //     builder: (BuildContext context) {
      //       return PinCodePopUp(
      //         messag: "${decodedResponse['message']}",
      //         image: '${LottiePath}Upload_Successful.json',
      //       );
      //     });
      FetchingStateCity = await decodedResponse['data'];
    }
  } catch (e) {
    errorListner(
        apiname: 'pincode_state_city',
        responsed: "${decodedResponse}",
        request: '${apibody}',
        app_error: '${e}');
  }
}