CheckIn By Param added

dev_3.3_faiz_payfort
haroon amjad 2 years ago
parent cb9ced27c2
commit ded6e02663

@ -77,7 +77,7 @@ class _QRCodeState extends State<QRCode> {
Future.delayed(const Duration(milliseconds: 500), () { Future.delayed(const Duration(milliseconds: 500), () {
showNfcReader(context, onNcfScan: (String nfcId) { showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () { Future.delayed(const Duration(milliseconds: 100), () {
sendNfcCheckInRequest(nfcId); sendNfcCheckInRequest(nfcId, 1);
locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment); locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment);
}); });
}, onCancel: () { }, onCancel: () {
@ -90,7 +90,7 @@ class _QRCodeState extends State<QRCode> {
startQRCodeScan() async { startQRCodeScan() async {
String onlineCheckInQRCode = (await BarcodeScanner.scan())?.rawContent; String onlineCheckInQRCode = (await BarcodeScanner.scan())?.rawContent;
if (onlineCheckInQRCode != "") { if (onlineCheckInQRCode != "") {
sendNfcCheckInRequest(onlineCheckInQRCode); sendNfcCheckInRequest(onlineCheckInQRCode, 2);
locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment); locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment);
} else {} } else {}
} }
@ -102,7 +102,7 @@ class _QRCodeState extends State<QRCode> {
double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude), double.parse(projectDetailListModel.longitude)).ceilToDouble() * 1000; double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude), double.parse(projectDetailListModel.longitude)).ceilToDouble() * 1000;
print(dist); print(dist);
if (dist <= projectDetailListModel.geofenceRadius) { if (dist <= projectDetailListModel.geofenceRadius) {
sendNfcCheckInRequest(projectDetailListModel.checkInQrCode); sendNfcCheckInRequest(projectDetailListModel.checkInQrCode, 3);
} else { } else {
AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError); AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError);
} }
@ -341,12 +341,12 @@ class _QRCodeState extends State<QRCode> {
return docSpeciality; return docSpeciality;
} }
sendNfcCheckInRequest(String nfcId) { sendNfcCheckInRequest(String nfcId, int checkInBy) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, widget.patientShareResponse.projectID, context).then((res) { service.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, widget.patientShareResponse.projectID, checkInBy, context).then((res) {
print(res); print(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -1553,13 +1553,14 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, BuildContext context) async { Future<Map> sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, int checkInBy, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {
"AppointmentNo": appointmentNo, "AppointmentNo": appointmentNo,
"NFC_Code": nfcCode, "NFC_Code": nfcCode,
"ProjectID": projectId, "ProjectID": projectId,
"CheckinBy": checkInBy
}; };
dynamic localRes; dynamic localRes;
await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, onSuccess: (response, statusCode) async { await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, onSuccess: (response, statusCode) async {

Loading…
Cancel
Save