TestorderPreview method
Future
TestorderPreview({
- dynamic otpverify,
- dynamic city_valid,
- dynamic checkbox,
- dynamic emailid,
- dynamic address,
- dynamic landmark,
- dynamic pincode,
- dynamic city,
- dynamic visitdate,
- dynamic visittime,
- dynamic pkhtestdataarray,
- dynamic userpackageId,
Implementation
Future TestorderPreview(
{otpverify,
city_valid,
checkbox,
emailid,
address,
landmark,
pincode,
city,
visitdate,
visittime,
pkhtestdataarray,
userpackageId}) async {
var body;
var decodedResponse;
try {
Map data = {
"user_data": {
"otp_verify": "${otpverify}",
"city_valid": "${city_valid}",
"email_id": "${emailid}",
"address": "${address}",
"landmark": "${landmark}",
"pincode": "${pincode}",
"city": "${city}",
"visit_date": "${visitdate}",
"visit_time": "${visittime}",
},
"package_data": pkhtestdataarray,
"check_use_wallet": "${checkbox}",
"user_package_id": "${userpackageId}",
};
body = jsonEncode(data);
final response = await http.post(
Uri.parse('${SDK_BASE_URL}diagnostics_api/preview_order'),
headers: {'Authorization': SignUpController.currentUserToken},
body: body,
);
decodedResponse = json.decode(response.body);
Testorderid = await decodedResponse['data']['insert_id'];
TestPreviewDetails = await decodedResponse;
} catch (e) {
errorListner(
apiname: 'diagnostics_api/preview_order',
responsed: "${decodedResponse}",
request: '${body}',
app_error: '${e}');
}
}