diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 63619f59..cc91b2af 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1901,4 +1901,5 @@ const Map localizedValues = { "habibCallCenter": {"en": "Please contact AlHabib call center to update your insurance manually.", "ar": "يرجى الاتصال بمركز اتصال الحبيب لتحديث التأمين الخاص بك يدوياً."}, "cashAmountUpdateInsurance": {"en": "Please note that this is the cash amount, If you want to update your insurance, Please tap below:", "ar": "يرجى ملاحظة أن هذا هو المبلغ النقدي، إذا كنت ترغب في تحديث التأمين الخاص بك، يرجى النقر أدناه:"}, "validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"}, + "checkInViaLocation": {"en": "Check-In Via Location", "ar": "تسجيل الوصول عبر الموقع"}, }; \ No newline at end of file diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index e9d88d7b..99f5ce3a 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -17,6 +17,7 @@ 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/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart'; @@ -49,6 +50,7 @@ class _QRCodeState extends State { BuildContext _context; ProjectViewModel projectViewModel; + LocationUtils locationUtils; @override void initState() { @@ -90,6 +92,15 @@ class _QRCodeState extends State { } else {} } + startLocationCheckIn() async { + String onlineCheckInQRCode = ""; + locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); + locationUtils.getCurrentLocation(callBack: (value) { + print(value); + // sendNfcCheckInRequest(onlineCheckInQRCode); + }); + } + @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -228,6 +239,24 @@ class _QRCodeState extends State { ), ); + optionsList.add( + InkWell( + onTap: () { + if (projectViewModel.havePrivilege(79)) { + startLocationCheckIn(); + } + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).checkInViaLocation, + imagePath: 'qr_code.svg', + subTitle: "", + isEnable: projectViewModel.havePrivilege(79), + width: 80.0, + height: 80.0, + ), + ), + ); + return optionsList; } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 7af2010a..ae885739 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2910,6 +2910,7 @@ class TranslationBase { String get habibCallCenter => localizedValues["habibCallCenter"][locale.languageCode]; String get cashAmountUpdateInsurance => localizedValues["cashAmountUpdateInsurance"][locale.languageCode]; String get validInsurance => localizedValues["validInsurance"][locale.languageCode]; + String get checkInViaLocation => localizedValues["checkInViaLocation"][locale.languageCode]; }