diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 73f4c1fe..8a9a4c40 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -183,6 +183,7 @@ const Map localizedValues = { 'sitWaitingQR': {'en': 'Sit in the waiting rooms until called by the nurse.', 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.'}, 'attendRegisterCode': {'en': 'Attendance registration code', 'ar': 'رمز تسجيل الحضور'}, 'scanQRHospital': {'en': 'Approach the Online Check-In board in the hospital & scan via NFC to Check-In', 'ar': 'اقترب من لوحة تسجيل الوصول عبر الإنترنت في المستشفى وافحصها عبر NFC لتسجيل الوصول'}, + 'scanNFC': {'en': 'Scan NFC to Check-In', 'ar': 'مسح NFC لتسجيل الوصول'}, "sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"}, "success": {"en": "Done successfully", "ar": "تم تنفذ الطلب بنجاح"}, "EmailSentSuccessfully": {"en": "Email Sent Successfully", "ar": "تم إرسال البريد الإلكتروني بنجاح"}, diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index e4ea7eaa..c1e75b69 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -512,6 +512,7 @@ class _AnicllaryOrdersState extends State with SingleTic "3", // Need to get new Service ID from Ayman for Ancillary Tamara "", + context, model.ancillaryListsDetails[0].appointmentDate, model.ancillaryListsDetails[0].appointmentNo, model.ancillaryListsDetails[0].clinicID, diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart index e5845194..a93861f5 100644 --- a/lib/pages/Blood/confirm_payment_page.dart +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -195,7 +195,7 @@ class ConfirmPaymentPage extends StatelessWidget { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); browser.openPaymentBrowser(amount, "Advance Payment", Utils.getAdvancePaymentTransID(authenticatedUser.projectID, authenticatedUser.patientID), appo.projectID.toString(), - authenticatedUser.emailAddress, paymentMethod, authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", ""); + authenticatedUser.emailAddress, paymentMethod, authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", "", null); } onBrowserLoadStart(String url) { diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 6de4a31c..3ebb827c 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -284,7 +284,7 @@ class _BookSuccessState extends State { ), height: 45.0, child: CustomTextButton( - backgroundColor: Color(0xffc5272d), + backgroundColor: CustomColors.green, elevation: 0, onPressed: () { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); @@ -587,6 +587,7 @@ class _BookSuccessState extends State { widget.patientShareResponse.isLiveCareAppointment, "2", widget.patientShareResponse.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "", + context, widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentNo, widget.patientShareResponse.clinicID, diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index d85f4505..2f861bd3 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -1,4 +1,3 @@ -import 'dart:convert'; import 'dart:typed_data'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; @@ -8,15 +7,18 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -53,159 +55,131 @@ class _QRCodeState extends State { }); WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - Future.delayed(const Duration(milliseconds: 500), () { - showNfcReader(context, onNcfScan: (String nfcId) { - Future.delayed(const Duration(milliseconds: 100), () { - sendNfcCheckInRequest(nfcId); - locator().todoList.to_do_list_nfc(widget.appointment); - }); - }, onCancel: () { - // Navigator.of(context).pop(); - locator().todoList.to_do_list_nfc_cancel(widget.appointment); - }); - }); + startNFCScan(); }); super.initState(); } + startNFCScan() { + Future.delayed(const Duration(milliseconds: 500), () { + showNfcReader(context, onNcfScan: (String nfcId) { + Future.delayed(const Duration(milliseconds: 100), () { + sendNfcCheckInRequest(nfcId); + locator().todoList.to_do_list_nfc(widget.appointment); + }); + }, onCancel: () { + // Navigator.of(context).pop(); + locator().todoList.to_do_list_nfc_cancel(widget.appointment); + }); + }); + } + @override Widget build(BuildContext context) { _context = context; return AppScaffold( - appBarTitle: TranslationBase.of(context).attendRegisterCode, + appBarTitle: TranslationBase.of(context).onlineCheckIn, isShowAppBar: true, showNewAppBar: true, showNewAppBarTitle: true, body: SingleChildScrollView( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Container( - width: double.infinity, - height: MediaQuery.of(context).size.width / 3, - child: Row( - children: [ - Expanded( - flex: 1, - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - InkWell( - child: Container( - margin: EdgeInsets.only(top: 30.0), - alignment: Alignment.center, - padding: EdgeInsets.all(8), - decoration: BoxDecoration( - border: Border.all(color: Colors.black), - borderRadius: BorderRadius.circular(10), - ), - child: SvgPicture.asset("assets/images/nfc/contactless.svg"), - ), - onTap: () { - showNfcReader(context, onNcfScan: (String nfcId) { - Future.delayed(const Duration(milliseconds: 100), () { - sendNfcCheckInRequest(nfcId); - locator().todoList.to_do_list_nfc(widget.appointment); - }); - }, onCancel: () { - // Navigator.of(context).pop(); - locator().todoList.to_do_list_nfc_cancel(widget.appointment); - }); - }, - ), - ], - ), - ), - // Expanded( - // flex: 1, - // child: Container( - // margin: EdgeInsets.only(top: 30.0), - // alignment: Alignment.center, - // child: Image.memory( - // _bytes, - // ), - // ), - // ), - ], - ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + DoctorHeader( + headerModel: HeaderModel( + widget.appointment.doctorTitle + " " + widget.appointment.doctorNameObj, + widget.appointment.doctorID, + widget.appointment.doctorImageURL, + widget.appointment.doctorSpeciality, + "", + widget.appointment.projectName, + DateUtil.convertStringToDate(widget.appointment.appointmentDate), + widget.appointment.isLiveCareAppointment + ? DateUtil.convertStringToDate(widget.appointment.appointmentDate).toString().split(" ")[1].substring(0, 5) + : widget.appointment.startTime.substring(0, 5), + null, + widget.appointment.doctorRate, + widget.appointment.actualDoctorRate, + widget.appointment.noOfPatientsRate, + "", ), - Container( - margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0), - child: Divider( - color: Colors.red[700], - thickness: 0.8, + isShowName: true, + isNeedToShowButton: false, + buttonTitle: '', + onTap: () {}, + onRatingAndReviewTap: () {}, + ), + InkWell( + child: Container( + margin: EdgeInsets.only(top: 30.0), + padding: EdgeInsets.all(8), + child: SvgPicture.asset( + "assets/images/nfc/contactless.svg", + width: 80.0, + height: 80.0, ), ), - Row( - children: [ - Expanded( - child: Container( - width: double.infinity, - margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(TranslationBase.of(context).scanQRHospital, style: TextStyle(color: Colors.red[700], fontSize: 18.0, fontWeight: FontWeight.bold)), - ), + onTap: () { + showNfcReader(context, onNcfScan: (String nfcId) { + Future.delayed(const Duration(milliseconds: 100), () { + sendNfcCheckInRequest(nfcId); + locator().todoList.to_do_list_nfc(widget.appointment); + }); + }, onCancel: () { + // Navigator.of(context).pop(); + locator().todoList.to_do_list_nfc_cancel(widget.appointment); + }); + }, + ), + Row( + children: [ + Expanded( + child: Container( + width: double.infinity, + margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(TranslationBase.of(context).scanQRHospital, + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + )), ), - ], - ), - Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), - child: Divider( - color: Colors.red[700], - thickness: 0.8, ), - ), - Container( - margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(TranslationBase.of(context).appoInfo, style: TextStyle(fontSize: 18.0, color: Colors.grey[700], fontWeight: FontWeight.bold)), - ), - Container( - margin: EdgeInsets.only(left: 20.0, bottom: 20.0, right: 20.0), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.grey[200], - boxShadow: [ - BoxShadow(color: Colors.grey, spreadRadius: 2), - ], + ], + ), + ], + ), + ), + bottomSheet: Container( + color: CustomColors.appBackgroudGreyColor, + padding: EdgeInsets.all(21), + // height: 45.0, + child: Row( + children: [ + Expanded( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(widget.patientShareResponse.doctorNameObj, style: TextStyle(fontSize: 18.0, color: Colors.grey[700], fontWeight: FontWeight.bold)), - ), - if (getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality) != "null\n") - Container( - margin: EdgeInsets.only(bottom: 10.0, left: 20.0, right: 20.0), - child: Text(getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality), style: TextStyle(fontSize: 18.0, color: Colors.grey[700])), - ), - Container( - margin: EdgeInsets.only(top: 0.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(widget.patientShareResponse.projectName, style: TextStyle(fontSize: 18.0, color: Colors.grey[700])), - ), - Container( - margin: EdgeInsets.only(top: 0.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(getDate(widget.patientShareResponse.appointmentDate), style: TextStyle(fontSize: 18.0, color: Colors.grey[700])), - ), - ], + height: 45.0, + child: CustomTextButton( + backgroundColor: CustomColors.green, + elevation: 0, + onPressed: () { + startNFCScan(); + }, + child: Text(TranslationBase.of(context).scanNFC, + style: TextStyle( + fontSize: 18.0, + color: Colors.white, + )), ), ), - // Container( - // margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 15.0), - // alignment: Alignment.bottomCenter, - // child: Column( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // DefaultButton(TranslationBase.of(context).sendEmail.toUpperCase(), () => {sendEmail()}) - // ], - // ), - // ), - ], - ), + ), + ], ), ), ); diff --git a/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart b/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart index 6b313a47..4d6b072e 100644 --- a/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart +++ b/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart @@ -168,7 +168,7 @@ class _EdPaymentInformationPageState extends State { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); transID = Utils.getAdvancePaymentTransID(widget.selectedHospital.iD, projectViewModel.user.patientID); browser.openPaymentBrowser(amount, "ER Online Check-In", transID, appo.projectID.toString(), authenticatedUser.emailAddress, paymentMethod, authenticatedUser.patientType, - authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", ""); + authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", "", context); } onBrowserLoadStart(String url) { diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index b4c0e17f..c6f1e6db 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -960,6 +960,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { appo.isLiveCareAppointment, "2", appo.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "", + context, appo.appointmentDate, appo.appointmentNo, appo.clinicID, diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index f5e9bf53..a3942f22 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -17,6 +17,9 @@ import 'package:provider/provider.dart'; class LiveCareHome extends StatefulWidget { static bool showFooterButton = true; static bool isLiveCareTypeSelected = false; + final bool isPharmacyLiveCare; + + const LiveCareHome({Key key, this.isPharmacyLiveCare = false}) : super(key: key); @override _LiveCareHomeState createState() => _LiveCareHomeState(); @@ -121,6 +124,7 @@ class _LiveCareHomeState extends State with SingleTickerProviderSt isDataLoaded && !hasLiveCareRequest ? ClinicList( getLiveCareHistory: getLiveCareHistory, + isPharmacyLiveCare: widget.isPharmacyLiveCare, ) : isDataLoaded ? LiveCarePendingRequest(getLiveCareHistory: getLiveCareHistory, pendingERRequestHistoryList: pendingERRequestHistoryList) diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 05dd19b1..564a3485 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -39,8 +39,9 @@ import '../live_care_payment_page.dart'; class ClinicList extends StatefulWidget { final Function getLiveCareHistory; + final bool isPharmacyLiveCare; - ClinicList({@required this.getLiveCareHistory}); + ClinicList({@required this.getLiveCareHistory, this.isPharmacyLiveCare = false}); @override _clinic_listState createState() => _clinic_listState(); @@ -316,7 +317,7 @@ class _clinic_listState extends State { this.amount = amount.toString(); browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod[0], - authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID, "", "", "", "", paymentMethod[1]); + authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID, context, "", "", "", "", paymentMethod[1]); } onBrowserLoadStart(String url) { @@ -531,8 +532,12 @@ class _clinic_listState extends State { setState(() { currentSelectedLiveCareType = "immediate"; }); - getLiveCareClinicsList(); - startLiveCare(); + // if(widget.isPharmacyLiveCare) { + // + // } else { + getLiveCareClinicsList(); + startLiveCare(); + // } } else { Navigator.of(context) .push(new MaterialPageRoute( diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index b4d79d49..ab5381c9 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -367,6 +367,7 @@ class _ConfirmPaymentPageState extends State { false, "3", "0", + context, "", "", "", diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 705118e7..95e1e438 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2877,6 +2877,7 @@ class TranslationBase { String get pendingActivation => localizedValues["pendingActivation"][locale.languageCode]; String get awaitingApproval => localizedValues["awaitingApproval"][locale.languageCode]; String get liveCareSupportContact => localizedValues["liveCareSupportContact"][locale.languageCode]; + String get scanNFC => localizedValues["scanNFC"][locale.languageCode]; } diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 79f080a5..180bfe63 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -1,5 +1,3 @@ -import 'dart:io'; - import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/config.dart'; @@ -18,6 +16,7 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStat import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notifications_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/pages/webRTC/call_page.dart'; import 'package:diplomaticquarterapp/routes.dart'; @@ -335,19 +334,19 @@ class _AppDrawerState extends State { } }, ), - // InkWell( - // child: DrawerItem(TranslationBase.of(context).pharmacyLiveCare, SvgPicture.asset("assets/images/new/Live_Care.svg"), - // isImageIcon: true, - // bottomLine: false, - // textColor: Theme.of(context).textTheme.bodyText1.color, - // iconColor: Theme.of(context).textTheme.bodyText1.color, - // sideArrow: true, - // letterSpacing: -0.84, - // projectProvider: projectProvider), - // onTap: () { - // readQRCode(); - // }, - // ), + InkWell( + child: DrawerItem(TranslationBase.of(context).pharmacyLiveCare, SvgPicture.asset("assets/images/new/Live_Care.svg"), + isImageIcon: true, + bottomLine: false, + textColor: Theme.of(context).textTheme.bodyText1.color, + iconColor: Theme.of(context).textTheme.bodyText1.color, + sideArrow: true, + letterSpacing: -0.84, + projectProvider: projectProvider), + onTap: () { + readQRCode(); + }, + ), InkWell( child: Stack( children: [ @@ -505,9 +504,16 @@ class _AppDrawerState extends State { }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); + Navigator.pop(context); + startPharmacyLiveCareProcess(); }); } + startPharmacyLiveCareProcess() { + sharedPref.setString(LIVECARE_CLINIC_DATA, "Pharmacy LiveCare" + "-" + "501" + "-" + "7"); + Navigator.push(context, FadePage(page: LiveCareHome(isPharmacyLiveCare: true,))); + } + drawerNavigator(context, routeName) { Navigator.of(context).pushNamed(routeName); } diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index 5c556efb..2c9bb42a 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -22,6 +22,7 @@ class DoctorHeader extends StatelessWidget { final String buttonTitle; final String buttonIcon; final bool isNeedToShowButton; + final bool isShowName; DoctorHeader( {Key key, @@ -29,6 +30,7 @@ class DoctorHeader extends StatelessWidget { @required this.buttonTitle, @required this.onTap, this.isNeedToShowButton = true, + this.isShowName = false, this.buttonIcon, this.showConfirmMessageDialog = true, @required this.onRatingAndReviewTap}) @@ -44,7 +46,18 @@ class DoctorHeader extends StatelessWidget { color: Colors.white, child: Column( mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, children: [ + if (isShowName) + Padding( + padding: EdgeInsets.only(left: 21, right: 21, bottom: 12), + child: Text( + headerModel.doctorName, + maxLines: 1, + style: TextStyle( + fontSize: 24, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24), + ), + ), Padding( padding: EdgeInsets.only(left: 21, right: 21, bottom: 12), child: Row( diff --git a/lib/widgets/nfc/nfc_reader_sheet.dart b/lib/widgets/nfc/nfc_reader_sheet.dart index 4257501f..8881cb29 100644 --- a/lib/widgets/nfc/nfc_reader_sheet.dart +++ b/lib/widgets/nfc/nfc_reader_sheet.dart @@ -44,6 +44,7 @@ class _NfcLayoutState extends State { } void readNFC() async { + FlutterNfcKit.finish(); FlutterNfcKit.poll(timeout: Duration(seconds: 10), androidPlatformSound: true, androidCheckNDEF: false, iosMultipleTagMessage: "Multiple tags found!").then((value) async { setState(() { _reading = true; @@ -55,6 +56,9 @@ class _NfcLayoutState extends State { Navigator.pop(context); }); nfcId = value.id; + }).catchError((err) { + print(err); + Navigator.of(context).pop(); }); }