BookDentail method
Future
BookDentail({
- dynamic deptid,
- dynamic patientname,
- dynamic age,
- dynamic gender,
- dynamic visitdate,
- dynamic visittime,
- dynamic mobilenumber,
- dynamic emailid,
Implementation
Future BookDentail(
{deptid,
patientname,
age,
gender,
visitdate,
visittime,
mobilenumber,
emailid}) async {
final ApiBody = {
"dept_id": deptid.toString(),
"patient_name": patientname,
"patient_age": age.toString(),
"gender": gender,
"visit_date": visitdate.toString(),
"visit_time": visittime.toString(),
"mobile_number": mobilenumber.toString(),
"email_id": emailid
};
var decodedResponse;
try {
final response = await http.post(
Uri.parse('${SDK_BASE_URL}dental_api/book'),
body: ApiBody,
headers: {"Authorization": SignUpController.currentUserToken});
decodedResponse = json.decode(response.body);
bookdetails.value = decodedResponse;
if (response.statusCode == 200) {
Get.to(PreviewConfirmation(),
duration: Duration(milliseconds: 500),
transition: Transition.cupertinoDialog);
}
} catch (e) {
errorListner(
apiname: 'dental_api/book',
responsed: "${decodedResponse}",
request: '${ApiBody}',
app_error: '${e}');
}
}