From 3a648589059ea273624fdaac6c6f4a7995ccc741 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 6 Jun 2024 17:26:13 +0300 Subject: [PATCH] Invalid NFC Scan check added --- .../EROnlineCheckIn/EROnlineCheckInHome.dart | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInHome.dart b/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInHome.dart index 64df1b23..94bff23c 100644 --- a/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInHome.dart +++ b/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInHome.dart @@ -344,10 +344,14 @@ class _EROnlineCheckInHomePageState extends State with GifLoaderDialogUtils.showMyDialog(context); ClinicListService ancillaryOrdersService = new ClinicListService(); ancillaryOrdersService.getProjectIDFromNFC(nfcID).then((response) { - print(response["GetProjectByNFC"]); - int projectID = response['GetProjectByNFC'][0]["ProjectID"]; - GifLoaderDialogUtils.hideDialog(context); - Navigator.push(context, FadePage(page: EROnlineCheckInPaymentDetails(projectID: projectID))); + if (response["GetProjectByNFC"].length != 0) { + print(response["GetProjectByNFC"]); + int projectID = response['GetProjectByNFC'][0]["ProjectID"]; + GifLoaderDialogUtils.hideDialog(context); + Navigator.push(context, FadePage(page: EROnlineCheckInPaymentDetails(projectID: projectID))); + } else { + AppToast.showErrorToast(message: "Invalid NFC Card Scanned."); + } }).catchError((err) { AppToast.showErrorToast(message: err.toString()); GifLoaderDialogUtils.hideDialog(context);