GetStateFunction method

Future GetStateFunction()

Implementation

Future GetStateFunction() async {
  var decodedResponse;
  final ApiBody = {
    "tpa_id": getPolicyDetails['policies_listing'][indexvalue]['tpa_id'],
    "policy_details_id":
        getPolicyDetails['policies_listing'][indexvalue]['id'].toString()
  };
  try {
    final response = await http.post(
        Uri.parse(
            '${SDK_BASE_URL}claim_adminpanel/claim_api/tpa_hospital/state'),
        body: ApiBody,
        headers: {"Authorization": SignUpController.currentUserToken});

    decodedResponse = json.decode(response.body);
    StateNameList = decodedResponse['state'];
  } catch (e) {
    errorListner(
        apiname: 'claim_adminpanel/claim_api/tpa_hospital/state',
        responsed: "${decodedResponse}",
        request: '${ApiBody}',
        app_error: '${e}');
  }
}