|
|
|
@ -58,7 +58,7 @@ class AppointmentCheckinBottomSheet extends StatelessWidget {
|
|
|
|
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!) {
|
|
|
|
sendCheckInRequest(projectDetailListModel.checkInQrCode!, context);
|
|
|
|
sendCheckInRequest(projectDetailListModel.checkInQrCode!, 3, context);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
showCommonBottomSheetWithoutHeight(context,
|
|
|
|
showCommonBottomSheetWithoutHeight(context,
|
|
|
|
title: "Error".needTranslation,
|
|
|
|
title: "Error".needTranslation,
|
|
|
|
@ -77,7 +77,7 @@ class AppointmentCheckinBottomSheet extends StatelessWidget {
|
|
|
|
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), () {
|
|
|
|
sendCheckInRequest(nfcId, context);
|
|
|
|
sendCheckInRequest(nfcId, 1, context);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}, onCancel: () {});
|
|
|
|
}, onCancel: () {});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -90,7 +90,7 @@ class AppointmentCheckinBottomSheet extends StatelessWidget {
|
|
|
|
).onPress(() async {
|
|
|
|
).onPress(() async {
|
|
|
|
String onlineCheckInQRCode = (await BarcodeScanner.scan().then((value) => value.rawContent));
|
|
|
|
String onlineCheckInQRCode = (await BarcodeScanner.scan().then((value) => value.rawContent));
|
|
|
|
if (onlineCheckInQRCode != "") {
|
|
|
|
if (onlineCheckInQRCode != "") {
|
|
|
|
sendCheckInRequest(onlineCheckInQRCode, context);
|
|
|
|
sendCheckInRequest(onlineCheckInQRCode, 2, context);
|
|
|
|
} else {}
|
|
|
|
} else {}
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -138,12 +138,12 @@ class AppointmentCheckinBottomSheet extends StatelessWidget {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void sendCheckInRequest(String scannedCode, BuildContext context) async {
|
|
|
|
void sendCheckInRequest(String scannedCode, int checkInType, BuildContext context) async {
|
|
|
|
LoaderBottomSheet.showLoader(loadingText: "Processing Check-In...".needTranslation);
|
|
|
|
LoaderBottomSheet.showLoader(loadingText: "Processing Check-In...".needTranslation);
|
|
|
|
await myAppointmentsViewModel.sendCheckInNfcRequest(
|
|
|
|
await myAppointmentsViewModel.sendCheckInNfcRequest(
|
|
|
|
patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel,
|
|
|
|
patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel,
|
|
|
|
scannedCode: scannedCode,
|
|
|
|
scannedCode: scannedCode,
|
|
|
|
checkInType: 2,
|
|
|
|
checkInType: checkInType,
|
|
|
|
onSuccess: (apiResponse) {
|
|
|
|
onSuccess: (apiResponse) {
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
showCommonBottomSheetWithoutHeight(context, title: "Success".needTranslation, child: Utils.getSuccessWidget(loadingText: LocaleKeys.success.tr()), callBackFunc: () async {
|
|
|
|
showCommonBottomSheetWithoutHeight(context, title: "Success".needTranslation, child: Utils.getSuccessWidget(loadingText: LocaleKeys.success.tr()), callBackFunc: () async {
|
|
|
|
|