verifyPincode method

Future verifyPincode({
  1. dynamic pincode,
  2. dynamic context,
})

Implementation

Future verifyPincode({
  pincode,
  context,
}) async {
  final response = await http.get(
    Uri.parse(
        '${WELLNESS_URL}api/medicine/city/serviceable?pincode=$pincode'),
    headers: {'Authorization': currentUserToken},
  );
  var decodedResponse = json.decode(response.body);
  Get.back();
  getStateCity = decodedResponse;
  if (decodedResponse['success'] == true) {
    Validator().successMessage(
        context: context, message: "${decodedResponse['message']}");
  } else {
    Validator().errorMessage(
        context: context, message: "${decodedResponse['message']}");
  }
}