Android permission dialog updates

merge-requests/598/head
haroon amjad 4 years ago
parent 887303fcde
commit aae48f2555

@ -5,8 +5,8 @@
"displayName": "Sulaiman Al Habib",
"merchantCapabilities": [
"3DS",
"credit",
"debit"
"debit",
"credit"
],
"supportedNetworks": [
"visa",

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

@ -392,7 +392,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnar
var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 7.3;
var VERSION_ID = 7.6;
var SETUP_ID = '91877';
var LANGUAGE = 2;
var PATIENT_OUT_SA = 0;
@ -711,6 +711,9 @@ var GET_DENTAL_APPOINTMENT_INVOICE =
var SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL =
"Services/Notifications.svc/REST/SendInvoiceForDental";
var GET_TAMARA_PLAN =
'https://mdlaboratories.com/tamara/Home/GetInstallments';
class AppGlobal {
static var context;

@ -278,8 +278,14 @@ const Map localizedValues = {
"viewAll": {"en": "View All", 'ar': 'عرض الكل'},
"view": {"en": "View", 'ar': 'عرض'},
"ContactUs": {"en": "Contact Us", 'ar': 'الوصول إلينا'},
"contactUsLocation": {"en": "P.O.Box: 91877 - Riyadh 11643, King Fahad Road - Olaya - Kingdom of Saudi Arabia", 'ar': 'صندوق بريد: 91877 - الرياض 11643 ، طريق الملك فهد - العليا - المملكة العربية السعودية'},
"contactUsTime": {"en": "Saturday - Wednesday 8:00 AM - 10 PM, Thursday 8:00 AM- 8:00 PM, Friday 2:00 PM - 8:00 PM", 'ar': " السبت الأربعاء 08:00 ص 10:00 م , الخميس 08:00 ص 08:00 م, الجمعة 02:00 م - 08:00 م"},
"contactUsLocation": {
"en": "P.O.Box: 91877 - Riyadh 11643, King Fahad Road - Olaya - Kingdom of Saudi Arabia",
'ar': 'صندوق بريد: 91877 - الرياض 11643 ، طريق الملك فهد - العليا - المملكة العربية السعودية'
},
"contactUsTime": {
"en": "Saturday - Wednesday 8:00 AM - 10 PM, Thursday 8:00 AM- 8:00 PM, Friday 2:00 PM - 8:00 PM",
'ar': " السبت الأربعاء 08:00 ص 10:00 م , الخميس 08:00 ص 08:00 م, الجمعة 02:00 م - 08:00 م"
},
"ViewAllWaysReachUs": {"en": "View All Ways Reach Us", 'ar': 'جميع طرق الاتصال بنا'},
"medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'},
"consultation": {"en": "Consultation", "ar": "استشارة"},
@ -615,6 +621,7 @@ const Map localizedValues = {
"shippingAddress": {"en": "SHIPPING ADDRESS", "ar": "عنوان الشحن"},
"changeAddress": {"en": "Change Address", "ar": "تغيير العنوان"},
"selectPaymentOption": {"en": "Select Payment Option", "ar": "حدد طريقة الدفع"},
"selectTamaraPlan": {"en": "Select Tamara Payment Plan", "ar": "حدد خطة الدفع تمارا"},
"changeMethod": {"en": "Change Method", "ar": "تغيير طريقة الدفع"},
"reviewOrder": {"en": "Review Order", "ar": "مراجعة الطلب"},
"active": {"en": "ACTIVE", "ar": "فعال"},
@ -879,10 +886,7 @@ const Map localizedValues = {
},
"failedToAccessHmgServices": {"en": "Connected with HMG Network,\n\nBut failed to access HMG services", "ar": "Connected with HMG Network,\n\nBut failed to access HMG services"},
"offerAndPackages": {"en": "Offers and Packages", "ar": "العروض والباقات"},
"offerAndPackagesDetails": {
"en": "This service allows you to view all HMG Offers:",
"ar": "This service allows you to view all HMG Offers:"
},
"offerAndPackagesDetails": {"en": "This service allows you to view all HMG Offers:", "ar": "This service allows you to view all HMG Offers:"},
"InvoiceNo": {"en": "Invoice No", "ar": "رقم الفاتورة"},
"InvoiceDate": {"en": "Invoice Date", "ar": "تاريخ الفاتورة"},
"SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"},
@ -958,8 +962,10 @@ const Map localizedValues = {
"iAcceptTermsConditions": {"en": "I Accept the Terms and Conditions", "ar": "أوافق على الشروط والأحكام"},
"YouCanPayByTheFollowingOptions": {"en": "You can pay by the following options:", "ar": "يمكنك الدفع عن طريق الخيارات التالية:"},
"RRTDDetails": {
"en": "The Rapid response team provides a comprehensive medical service for all sorts of urgent and stable cases of all ages, including adult and paediatric patients, the service is covered by a fully equipped and highly trained medical team capable of providing the best medical care at the patients home.",
"ar": "فريق الاستجابة السريعة يقوم بتقديم رعاية صحية متكاملة لجميع الحالات الطارئة و المستقرة، الخدمة تشمل جميع الأعمار بما في ذلك حالات الأطفال، تشمل الخدمة إرسال فريق طبي كامل الجاهزية و على مستوى عالي من التدريب قادر على تقديم أفضل رعاية صحية من داخل المنزل."
"en":
"The Rapid response team provides a comprehensive medical service for all sorts of urgent and stable cases of all ages, including adult and paediatric patients, the service is covered by a fully equipped and highly trained medical team capable of providing the best medical care at the patients home.",
"ar":
"فريق الاستجابة السريعة يقوم بتقديم رعاية صحية متكاملة لجميع الحالات الطارئة و المستقرة، الخدمة تشمل جميع الأعمار بما في ذلك حالات الأطفال، تشمل الخدمة إرسال فريق طبي كامل الجاهزية و على مستوى عالي من التدريب قادر على تقديم أفضل رعاية صحية من داخل المنزل."
},
"rrtService": {"en": "RRT Service", "ar": "خدمة RRT"},
"bill-amount": {"en": "Bill Amount", "ar": "مبلغ الفاتورة"},
@ -1632,28 +1638,41 @@ const Map localizedValues = {
"medicalFileSubtitle": {"en": "Details", "ar": "ملفي الطبي"},
"healthConvertersTitle": {"en": "Health", "ar": "تحويل"},
"healthConvertersSubtitle": {"en": "Converters", "ar": "القياسات"},
"syncHealthData": { "en": "Sync Health Data", "ar": "مزامنة البيانات الصحية" },
"steps": { "en": "Steps", "ar": "الخطوات" },
"avgSteps": { "en": "Average Steps", "ar": "متوسط الخطوات" },
"avgDistance": { "en": "Average Distance", "ar": "متوسط المسافة" },
"syncHealthData": {"en": "Sync Health Data", "ar": "مزامنة البيانات الصحية"},
"steps": {"en": "Steps", "ar": "الخطوات"},
"avgSteps": {"en": "Average Steps", "ar": "متوسط الخطوات"},
"avgDistance": {"en": "Average Distance", "ar": "متوسط المسافة"},
"enterDetails": {"en": "Enter Details", "ar": "أدخل التفاصيل"},
"avgHeartRate": { "en": "Average Heart Rate", "ar": "متوسط معدل ضربات القلب" },
"alreadySynced": { "en": "Already Synced", "ar": "متزامنة" },
"sync-instructions-intro1": { "en": "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", "ar": "يبدو أنك لم تقم بمزامنة بياناتك الصحية مع تطبيق Dr. Alhabib App من قبل. للمتابعة ، تحتاج إلى مزامنة بياناتك الصحية مع تطبيق Dr. Alhabib" },
"sync-instructions-intro2": { "en": "Before syncing data, please make sure that you have followed the instructions properly", "ar": "قبل مزامنة البيانات ، يرجى التأكد من اتباع التعليمات بشكل صحيح." },
"sync-instructions-intro3": { "en": "Before syncing data, please make sure that following instructions are met:", "ar": "قبل مزامنة البيانات ، يرجى التأكد من تلبية الإرشادات التالية:" },
"ios-instructions-1": { "en": "Make sure that you have installed 'Health' App & 'Watch' App from Apple Store.", "ar": "تأكد من أنك قمت بتثبيت تطبيق 'Health' App & 'Watch' من متجر Apple." },
"ios-instructions-2": { "en": "Make sure that your Apple Watch is connected with the Watch & Health Apps.", "ar": "تأكد من اتصال Apple Watch بتطبيقات Watch & Health." },
"ios-instructions-3": { "en": "Make sure that data like heart rate, steps, distance etc. are being shown on your health app.", "ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق صحتك." },
"supportedWatches": { "en": "Supported SmartWatches", "ar": "الساعات الذكية المدعومة" },
"watchInstructions": { "en": "View watch instructions", "ar": "عرض تعليمات الساعة" },
"avgHeartRate": {"en": "Average Heart Rate", "ar": "متوسط معدل ضربات القلب"},
"alreadySynced": {"en": "Already Synced", "ar": "متزامنة"},
"sync-instructions-intro1": {
"en": "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App",
"ar": "يبدو أنك لم تقم بمزامنة بياناتك الصحية مع تطبيق Dr. Alhabib App من قبل. للمتابعة ، تحتاج إلى مزامنة بياناتك الصحية مع تطبيق Dr. Alhabib"
},
"sync-instructions-intro2": {"en": "Before syncing data, please make sure that you have followed the instructions properly", "ar": "قبل مزامنة البيانات ، يرجى التأكد من اتباع التعليمات بشكل صحيح."},
"sync-instructions-intro3": {"en": "Before syncing data, please make sure that following instructions are met:", "ar": "قبل مزامنة البيانات ، يرجى التأكد من تلبية الإرشادات التالية:"},
"ios-instructions-1": {"en": "Make sure that you have installed 'Health' App & 'Watch' App from Apple Store.", "ar": "تأكد من أنك قمت بتثبيت تطبيق 'Health' App & 'Watch' من متجر Apple."},
"ios-instructions-2": {"en": "Make sure that your Apple Watch is connected with the Watch & Health Apps.", "ar": "تأكد من اتصال Apple Watch بتطبيقات Watch & Health."},
"ios-instructions-3": {
"en": "Make sure that data like heart rate, steps, distance etc. are being shown on your health app.",
"ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق صحتك."
},
"supportedWatches": {"en": "Supported SmartWatches", "ar": "الساعات الذكية المدعومة"},
"watchInstructions": {"en": "View watch instructions", "ar": "عرض تعليمات الساعة"},
"monthlyTab": {"en": "Monthly", "ar": "شهري"},
"moreSupportedWatches": {"en": "More Supported Smartwatches...", "ar": "المزيد من الساعات الذكية المدعومة..."},
"android-instructions-1": { "en": "Make sure that you have installed 'WearOS' & 'Google Fit' apps from Google PlayStore.", "ar": "تأكد من تثبيت تطبيقات 'WearOS' و 'Google Fit' من متجر Google PlayStore." },
"android-instructions-2": { "en": "Make sure that you have installed your watch related apps from Google PlayStore.", "ar": "تأكد من أنك قمت بتثبيت التطبيقات المتعلقة بالساعات من Google PlayStore." },
"android-instructions-3": { "en": "Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", "ar": "تأكد من أن ساعتك الذكية متصلة بتطبيق WearOS وتطبيقات ساعتك." },
"android-instructions-4": { "en": "Make sure that your smart watch apps are linked/associated with Google Fit App.", "ar": "تأكد من أن تطبيقات ساعتك الذكية مرتبطة / مرتبطة بتطبيق Google Fit." }, "android-instructions-5": { "en": "Make sure that data like heart rate, steps, distance etc. are being shown on your watch app & on Google Fit app & both are in sync.", "ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق الساعة وعلى تطبيق Google Fit وكلاهما في حالة مزامنة." },
"tamaraInstPlan" : { "en": "Select the tamara installment plan", "ar": "حدد خطة تقسيط تمارة" },
"android-instructions-1": {
"en": "Make sure that you have installed 'WearOS' & 'Google Fit' apps from Google PlayStore.",
"ar": "تأكد من تثبيت تطبيقات 'WearOS' و 'Google Fit' من متجر Google PlayStore."
},
"android-instructions-2": {"en": "Make sure that you have installed your watch related apps from Google PlayStore.", "ar": "تأكد من أنك قمت بتثبيت التطبيقات المتعلقة بالساعات من Google PlayStore."},
"android-instructions-3": {"en": "Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", "ar": "تأكد من أن ساعتك الذكية متصلة بتطبيق WearOS وتطبيقات ساعتك."},
"android-instructions-4": {"en": "Make sure that your smart watch apps are linked/associated with Google Fit App.", "ar": "تأكد من أن تطبيقات ساعتك الذكية مرتبطة / مرتبطة بتطبيق Google Fit."},
"android-instructions-5": {
"en": "Make sure that data like heart rate, steps, distance etc. are being shown on your watch app & on Google Fit app & both are in sync.",
"ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق الساعة وعلى تطبيق Google Fit وكلاهما في حالة مزامنة."
},
"tamaraInstPlan": {"en": "Select the tamara installment plan", "ar": "حدد خطة تقسيط تمارة"},
"onlineTag": {"en": "Online", "ar": "مفتوح"},
"offlineTag": {"en": "Offline", "ar": "مغلق"},
"viewDocList": {"en": "View List of Doctors", "ar": "عرض قائمة الأطباء"},
@ -1665,7 +1684,7 @@ const Map localizedValues = {
"RRTTitle": {"en": "RRT", "ar": "خدمة فريق"},
"RRTSubTitle": {"en": "Service", "ar": "الاستجابة السريع"},
"transportation": {"en": "Transportation", "ar": "النقل"},
"installments": {"en": "Installments", "ar": "أقساط"},
"neck": {"en": "Neck", "ar": "رقبه"},
"waist": {"en": "Waist", "ar": "وسط"},
"hip": {"en": "Hip", "ar": "ورك او نتوء"},
@ -1674,47 +1693,56 @@ const Map localizedValues = {
"babyAge": {"en": "Baby Age", "ar": "عمر الطفل الآن:"},
"babyAgeAvail": {"en": "baby age is not available", "ar": "عمر الطفل غير متوفر"},
"deliveryDue": {"en": "The delivery due date is estimated to be on the", "ar": "من المقدر أن يكون تاريخ استحقاق التسليم في"},
"almostInactive": {"en": "Almost Inactive(Little or no exercises)", "ar": "شبه غير نشط (تمارين قليلة أو معدومة)"},
"lightActive1": {"en": "Lighty Active (1-3) days per week", "ar": "Lighty Active (1-3) أيام في الأسبوع"},
"veryActive": {"en": "very Active(6-7) days per week", "ar": "نشط جدا (6-7) أيام في الأسبوع"},
"superActive": {"en": "Super Active(very hard exercises)", "ar": "سوبر نشط (تمارين صعبة للغاية)"},
"dailyIntake": {"en": "Daily intake is", "ar": "المدخول اليومي"},
"calculateAmount": {"en": "Calculates the amount of energy that the persons body expends in a day", "ar": "تحسب كمية الطاقة التي يبذلها جسم الشخص في اليوم"},
"bodyWillBurn": {"en": "This means the body will burn", "ar": "هذا يعني أن الجسم سوف يحترق"},
"caloriesEachDay": {"en": "calories each day, if engaged in no activity for the entire day.. Note: Daily calorie requirement is", "ar": "السعرات الحرارية في كل يوم ، إذا لم تمارس أي نشاط طوال اليوم .. ملاحظة: متطلبات السعرات الحرارية اليومية هي"},
"caloriesEachDay": {
"en": "calories each day, if engaged in no activity for the entire day.. Note: Daily calorie requirement is",
"ar": "السعرات الحرارية في كل يوم ، إذا لم تمارس أي نشاط طوال اليوم .. ملاحظة: متطلبات السعرات الحرارية اليومية هي"
},
"maintainWeight": {"en": "calories, to maintain the current weight.", "ar": "السعرات الحرارية للحفاظ على الوزن الحالي."},
"mediumFinger": {"en": "Medium(fingers touch)", "ar": "متوسطة (لمسة الأصابع)"},
"smallFinger": {"en": "Small(fingers overlap)", "ar": "صغير (أصابع متداخلة)"},
"largeFinger": {"en": "Large(fingers don\'n touch)", "ar": "كبير (لا تلمس الأصابع)"},
"idealBodyWeight": {"en": "Calculates the ideal body weight based on height, Weight, and Body Size", "ar": "يحسب وزن الجسم المثالي بناءً على الطول والوزن وحجم الجسم"},
"bodyFrameSize": {"en": "Body Frame Size", "ar": "حجم إطار الجسم"},
"idealWeightRange": {"en": "Ideal weight range is", "ar": "نطاق الوزن المثالي هو"},
"currentWeightPerfect": {"en": "Congratulations! The current weight is perfect and considered healthy", "ar": "تهانينا! الوزن الحالي مثالي ويعتبر صحي"},
"littleBitWeightMore": {"en": "This means that the weight is a little bit more than ideal weight by", "ar": "هذا يعني أن الوزن أكثر قليلاً من الوزن المثالي به"},
"consultWithDoctor": {"en": "May wish to consult with the doctor for medical help. Click to view our list of Doctors", "ar": "قد ترغب في استشارة الطبيب للحصول على مساعدة طبية. انقر لعرض قائمة الأطباء لدينا"},
"consultWithDoctor": {
"en": "May wish to consult with the doctor for medical help. Click to view our list of Doctors",
"ar": "قد ترغب في استشارة الطبيب للحصول على مساعدة طبية. انقر لعرض قائمة الأطباء لدينا"
},
"excessiveObesity": {"en": "Means that you suffer from excessive obesity by", "ar": "يعني أنك تعاني من السمنة المفرطة بها"},
"mayWish": {"en": "May wish to consult with the doctor for medical help. Click to view our list of\n Doctors", "ar": "قد ترغب في استشارة الطبيب للحصول على مساعدة طبية. انقر لعرض قائمة الأطباء \ n الخاصة بنا"},
"mayWish": {
"en": "May wish to consult with the doctor for medical help. Click to view our list of\n Doctors",
"ar": "قد ترغب في استشارة الطبيب للحصول على مساعدة طبية. انقر لعرض قائمة الأطباء \ n الخاصة بنا"
},
"essential": {"en": "The category falls under essential", "ar": "الفئة تندرج تحت الأساسية"},
"athlete": {"en": "The category falls under athlete", "ar": "فئة تندرج تحت رياضي"},
"fitness": {"en": "The category falls under fitness", "ar": "الفئة تندرج تحت اللياقة البدنية"},
"acceptable": {"en": "The category falls under acceptable", "ar": "الفئة تندرج تحت مقبول"},
"underObese": {"en": "The category falls under obese", "ar": "تندرج الفئة تحت السمنة"},
"crossedLimits": {"en": "Please check the value you have entered, since the body fat percentage has crosed the limits.", "ar": "يرجى التحقق من القيمة التي أدخلتها ، لأن نسبة الدهون في الجسم تجاوزت الحدود."},
"lowLimits": {"en": "Please check the value you have entered, since the body fat percentage cannot be this low.", "ar": "يرجى التحقق من القيمة التي أدخلتها ، حيث لا يمكن أن تكون نسبة الدهون في الجسم منخفضة."},
"crossedLimits": {
"en": "Please check the value you have entered, since the body fat percentage has crosed the limits.",
"ar": "يرجى التحقق من القيمة التي أدخلتها ، لأن نسبة الدهون في الجسم تجاوزت الحدود."
},
"lowLimits": {
"en": "Please check the value you have entered, since the body fat percentage cannot be this low.",
"ar": "يرجى التحقق من القيمة التي أدخلتها ، حيث لا يمكن أن تكون نسبة الدهون في الجسم منخفضة."
},
"estimates": {"en": "Estimates the total body fat based on\nthe size", "ar": "تقدير إجمالي الدهون في الجسم بناءً على \ n الحجم"},
"myCart": {"en": "My Cart", "ar": "عربة التسوق"},
"browseOffers": {"en": "Browse offers by clinic", "ar": "تصفح العروض حسب العيادة"},
"inactiveAct":{"en":"Almost inactive (little or no exercise)","ar":"غير نشط تقريبا (ممارسة الرياضة قليلة أو منعدمة)"},
"light":{"en":"Lightly active (1-3) days per week","ar":"خفيف النشاط (1-3 أيام في الأسبوع)"},
"moderate":{"en":"Moderately active (3-5) days per week)","ar":"معتدل النشاط (3-5 أيام في الأسبوع)"},
"very":{"en":"Very active (6-7) days per week)","ar":"نشط جداُ (6-7 أيام في الأسبوع)"},
"super":{"en":"Super active (very hard exercise)","ar":"عالي النشاط (ممارسة الرياضة الصعبة)"},
"inactiveAct": {"en": "Almost inactive (little or no exercise)", "ar": "غير نشط تقريبا (ممارسة الرياضة قليلة أو منعدمة)"},
"light": {"en": "Lightly active (1-3) days per week", "ar": "خفيف النشاط (1-3 أيام في الأسبوع)"},
"moderate": {"en": "Moderately active (3-5) days per week)", "ar": "معتدل النشاط (3-5 أيام في الأسبوع)"},
"very": {"en": "Very active (6-7) days per week)", "ar": "نشط جداُ (6-7 أيام في الأسبوع)"},
"super": {"en": "Super active (very hard exercise)", "ar": "عالي النشاط (ممارسة الرياضة الصعبة)"},
"resultCalories": {"en": "Daily intake is (#) calories", "ar": "الإحتياج اليومي (#) سعرة حرارية"},
"bmrDesc": {"en": "Calculates the amount of energy that the persons body expends in a day", "ar": "معدل الأيض القاعدي: هو حساب كمية الطاقة التي يحتاجها الجسم في اليوم الواحد"},
"idealWeightDesc": {"en": "Calculates the ideal body weight based on height, Weight, and Body Size", "ar": "حساب الوزن المثالي والوزن الصحي للجسم على أساس الطول، والوزن ،والجسم"},
@ -1723,20 +1751,28 @@ const Map localizedValues = {
"bodyFrameMedium": {"en": "Medium (fingers touch)", "ar": "متوسط (الأصابع تتلامس)"},
"bodyFrameLarge": {"en": "Large (fingers don't touch)", "ar": "عريض (الأصابع لا تتلامس)"},
"bodyFatDesc": {"en": "Estimates the total body fat based on the size", "ar": "حساب الدهون في الجسم بناءاً على الحجم"},
"obeseBodyFat":{"en":"The category falls under Obese.","ar":"تندرج تحت فئة دهون جسم سمين"},
"invalid":{"en":"Invalid input for calculation.","ar":"البيانات المدخلة غير صالحة للحساب"},
"more":{"en":"Please check the value you have entered, since the body fat percentage has crossed the limits.","ar":"يرجى التحقق من القيمة التي أدخلتها ، نظرًا لأن نسبة الدهون في الجسم قد تجاوزت الحدود"},
"less":{"en":"Please check the value you have entered, since the body fat percentage cannot be this low.","ar":"يرجى التحقق من القيمة التي أدخلتها ، نظرًا لأن نسبة الدهون في الجسم لا يمكن أن تكون منخفضة"},
"carbProteinDesc": {"en": "Calculates carbohydrate protein and fat ratio in calories and grams according to a pre-set ratio", "ar": "حساب نسب الكربوهيدرات و البروتينات و الدهون بالسعرات الحرارية والغرامات وفقا لنسب محددة مسبقا"},
"obeseBodyFat": {"en": "The category falls under Obese.", "ar": "تندرج تحت فئة دهون جسم سمين"},
"invalid": {"en": "Invalid input for calculation.", "ar": "البيانات المدخلة غير صالحة للحساب"},
"more": {
"en": "Please check the value you have entered, since the body fat percentage has crossed the limits.",
"ar": "يرجى التحقق من القيمة التي أدخلتها ، نظرًا لأن نسبة الدهون في الجسم قد تجاوزت الحدود"
},
"less": {
"en": "Please check the value you have entered, since the body fat percentage cannot be this low.",
"ar": "يرجى التحقق من القيمة التي أدخلتها ، نظرًا لأن نسبة الدهون في الجسم لا يمكن أن تكون منخفضة"
},
"carbProteinDesc": {
"en": "Calculates carbohydrate protein and fat ratio in calories and grams according to a pre-set ratio",
"ar": "حساب نسب الكربوهيدرات و البروتينات و الدهون بالسعرات الحرارية والغرامات وفقا لنسب محددة مسبقا"
},
"calDay": {"en": "Calories Per Day", "ar": "السعرات الحرارية في اليوم الواحد"},
"notSure": {"en": "Not sure? click here", "ar": "غير متأكد؟ اضغط هنا"},
"selectDiet": {"en": "Select Diet Type", "ar": "حدد نوع النظام الغذائي"},
"dietVeryLow":{"en":"Very Low Carb","ar":"حمية منخفضة جدا في الكربوهيدرات"},
"dietLow":{"en":"Low Carb","ar":"حمية منخفضة الكربوهيدرات"},
"dietModerate":{"en":"Moderate Carb","ar":"حمية معتدلة الكربوهيدرات"},
"dietUSDA":{"en":"USDA Guidelines","ar":"ارشادات وزارة الزراعة الأمريكية"},
"dietZone":{"en":"Zone Diet","ar":"حمية زون"},
"dietVeryLow": {"en": "Very Low Carb", "ar": "حمية منخفضة جدا في الكربوهيدرات"},
"dietLow": {"en": "Low Carb", "ar": "حمية منخفضة الكربوهيدرات"},
"dietModerate": {"en": "Moderate Carb", "ar": "حمية معتدلة الكربوهيدرات"},
"dietUSDA": {"en": "USDA Guidelines", "ar": "ارشادات وزارة الزراعة الأمريكية"},
"dietZone": {"en": "Zone Diet", "ar": "حمية زون"},
"Protein": {"en": "Protein", "ar": "بروتين"},
"Cals": {"en": "Cals", "ar": "كالس"},
"gramsPerDay": {"en": "Grams Per Day", "ar": "غرام في اليوم"},
@ -1758,7 +1794,20 @@ const Map localizedValues = {
"ancillaryOrderPaymentSuccess": {"en": "Your payment for selected orders has been made successfully.", "ar": "تم سداد دفعتك للطلبات المحددة بنجاح."},
"connectTitle": {"en": "Connect", "ar": "تواصل"},
"connectSubtitle": {"en": "With us", "ar": "معنا"},
"covidConsent": {"en": "Covid-19 Test feature allows you to book an appointment for the Covid-19 Lab test within HMG branches, where a swab sample will be collected & processed. Once the result has been processed, we shall notify you via SMS on your registered mobile number & the test result will also be available in the Lab Results section of this app. Please note that this result is only available to you & not publicly available to anyone else. Also we are using below permissions:\n\n GPS Location to show the nearest hospitals & ER Locations from your location.\n Bluetooth permission to connect blood pressure & blood sugar devices with the app to analyze the data.\n Camera permission to enable virtual consultation between patient & doctor.\n Calendar permission to set reminders for Virtual & Normal Appointments.\n Audio permission to access voice command features.\n Wifi state permission to connect to HMG Wifi when you visit the hospital.\n Read & write external storage to upload images & documents in E-Referral function.\n\n Please accept to confirm & proceed.", "ar": "تتيح لك ميزة اختبار كوفيد19 حجز موعد في احد فروع مجموعة الحبيب الطبية ، حيث سيتم اخذ عينة المسحة ومعالجتها. بمجرد معالجة النتيجة ، سنخطرك عبر رسالة نصية قصيرة على رقم هاتفك المحمول المسجل وستكون نتيجة الاختبار متاحة أيضًا على التطبيق في قسم نتائج المختبر. يرجى ملاحظة أن هذه النتيجة متاحة لك فقط وليست متاحة للجمهور او اي شخص آخر. الرجاء الموافقة للتأكيد والمتابعة."},
"covidConsent": {
"en":
"Covid-19 Test feature allows you to book an appointment for the Covid-19 Lab test within HMG branches, where a swab sample will be collected & processed. Once the result has been processed, we shall notify you via SMS on your registered mobile number & the test result will also be available in the Lab Results section of this app. Please note that this result is only available to you & not publicly available to anyone else.",
"ar":
"تتيح لك ميزة اختبار كوفيد19 حجز موعد في احد فروع مجموعة الحبيب الطبية ، حيث سيتم اخذ عينة المسحة ومعالجتها. بمجرد معالجة النتيجة ، سنخطرك عبر رسالة نصية قصيرة على رقم هاتفك المحمول المسجل وستكون نتيجة الاختبار متاحة أيضًا على التطبيق في قسم نتائج المختبر. يرجى ملاحظة أن هذه النتيجة متاحة لك فقط وليست متاحة للجمهور او اي شخص آخر. الرجاء الموافقة للتأكيد والمتابعة."
},
"covidConsentHeader": {"en": "User Consent", "ar": "موافقة المستخدم"},
"drawOverAppsPermission": {"en": "Please allow the Al-Habib Medical Group application to appear on the top of the screen when receiving the call from the doctor for LiveCare service.", "ar": "الرجاء السماح لتطبيق مجموعة الحبيب الطبية للظهورعلى سطح الشاشة عند استلام الاتصال من الطبيب لخدمة اللايف كير"},
};
"cameraPermissionDialog": { "en": "Dr. Al Habib app needs to access Camera to enable virtual consultation between patient & doctor, attach images and scan QR for parking service.", "ar": "يحتاج تطبيق دكتور الحبيب الى صلاحية الوصول إلى الكاميرا لخدمة الاستشارة الافتراضية بين المريض والطبيب وإرفاق الصور ومسح رمز الاستجابة السريع لخدمة مواقف السيارات." },
"galleryPermission": { "en": "Dr. Al Habib app needs to access Read & write external storage to upload images & documents in the E-Referral module and renew and update the insurance cards.", "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول إلى معرض الصور وذلك لتحميل الصور والمستندات لخدمة الإحالة الإلكترونية وكذلك لخدمة تجديد بطاقات التأمين وتحديثها." },
"locationPermissionDialog": { "en": "Dr. Al Habib app collects location data to show the nearest HMG hospitals and ER Locations and provides health care services to your location and Health weather indicators service and the medication delivery.", "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول الى الموقع لإظهار أقرب مستشفيات المجموعة، مواقع الطوارئ، تقديم خدمات الرعاية الصحية إلى موقعك، خدمة مؤشرات الطقس الصحية وكذلك خدمة توصيل الأدوية." },
"calendarPermission": { "en": "Dr. Al Habib app collects calendar data to modify and set reminders for Appointments", "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول الى التقويم وذلك لاضافة تذكيرات بالمواعيد في التقويم." },
"recordAudioPermission": { "en": "Dr. Al Habib app needs audio permission to enable voice command features.", "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول الى الصوت لتفعيل خدمة الأوامر الصوتية." },
"wifiPermission": { "en": "Dr. Al Habib app needs to access WiFi state permission to connect to the HMG WiFi network from within the app when you visit the hospital.", "ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى الواي فاي للاتصال بشبكة الواي فاي في المجموعة عند زيارة المستشفى." },
"physicalActivityPermission": { "en": "Dr. Al Habib app collects physical activity data to read heart rate, steps & distance from your smartwatch & send it to your doctor.", "ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى بيانات النشاط البدني لقراءة معدل ضربات القلب والخطوات والمسافة من ساعتك الذكية وتحميلها على ملفك الطبي حتى يتمكن الطبيب من الاطلاع عليها." },
"bluetoothPermission": { "en": "Dr. Al Habib app needs to access Bluetooth permission to connect blood pressure & blood sugar devices with the app to analyze the data", "ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى البلوتوث لربط أجهزة ضغط الدم وسكر الدم بالتطبيق لتحليل البيانات وتحميلها على ملفك الطبي حتى يتمكن الطبيب من الاطلاع عليها." }
};

@ -0,0 +1,97 @@
class TamaraInstallmentDetails {
String name;
String description;
MinLimit minLimit;
MinLimit maxLimit;
List<SupportedInstalments> supportedInstalments;
TamaraInstallmentDetails(
{this.name,
this.description,
this.minLimit,
this.maxLimit,
this.supportedInstalments});
TamaraInstallmentDetails.fromJson(Map<String, dynamic> json) {
name = json['name'];
description = json['description'];
minLimit = json['minLimit'] != null
? new MinLimit.fromJson(json['minLimit'])
: null;
maxLimit = json['maxLimit'] != null
? new MinLimit.fromJson(json['maxLimit'])
: null;
if (json['supportedInstalments'] != null) {
supportedInstalments = <SupportedInstalments>[];
json['supportedInstalments'].forEach((v) {
supportedInstalments.add(new SupportedInstalments.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['name'] = this.name;
data['description'] = this.description;
if (this.minLimit != null) {
data['minLimit'] = this.minLimit.toJson();
}
if (this.maxLimit != null) {
data['maxLimit'] = this.maxLimit.toJson();
}
if (this.supportedInstalments != null) {
data['supportedInstalments'] =
this.supportedInstalments.map((v) => v.toJson()).toList();
}
return data;
}
}
class MinLimit {
String currency;
int amount;
MinLimit({this.currency, this.amount});
MinLimit.fromJson(Map<String, dynamic> json) {
currency = json['currency'];
amount = json['amount'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['currency'] = this.currency;
data['amount'] = this.amount;
return data;
}
}
class SupportedInstalments {
int instalments;
MinLimit minLimit;
MinLimit maxLimit;
SupportedInstalments({this.instalments, this.minLimit, this.maxLimit});
SupportedInstalments.fromJson(Map<String, dynamic> json) {
instalments = json['instalments'];
minLimit = json['minLimit'] != null
? new MinLimit.fromJson(json['minLimit'])
: null;
maxLimit = json['maxLimit'] != null
? new MinLimit.fromJson(json['maxLimit'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['instalments'] = this.instalments;
if (this.minLimit != null) {
data['minLimit'] = this.minLimit.toJson();
}
if (this.maxLimit != null) {
data['maxLimit'] = this.maxLimit.toJson();
}
return data;
}
}

@ -128,8 +128,8 @@ class BaseAppClient {
// body['IdentificationNo'] = 2076117163;
// body['MobileNo'] = "966503109207";
// body['PatientID'] = 3114694; //3844083
// body['TokenID'] = "@dm!n";
body['PatientID'] = 3628809; //3844083
body['TokenID'] = "@dm!n";
// Patient ID: 3027574
// Mobile no.: 0502303285

@ -1,8 +1,15 @@
import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:progress_hud_v2/generated/i18n.dart';
class HospitalService extends BaseService {
List<HospitalsModel> _hospitals = List();
@ -13,26 +20,46 @@ class HospitalService extends BaseService {
double _longitude;
_getCurrentLocation() async {
await Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
_latitude = 0;
});
if (await PermissionService.isLocationEnabled()) {
Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
_latitude = 0;
});
} else {
if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(AppGlobal.context, TranslationBase.of(AppGlobal.context).locationPermissionDialog, () {
Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
_latitude = 0;
});
});
} else {
Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
_latitude = 0;
});
}
}
}
Future getHospitals({bool isResBasedOnLoc = true}) async {
if(isResBasedOnLoc)
await _getCurrentLocation();
if (isResBasedOnLoc) await _getCurrentLocation();
Map<String, dynamic> body = Map();
body['Latitude'] = await this.sharedPref.getDouble(USER_LAT);
body['Longitude'] = await this.sharedPref.getDouble(USER_LONG);
body['IsOnlineCheckIn'] = isResBasedOnLoc;
body['PatientOutSA'] = 0;
await baseAppClient.post(GET_PROJECT,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_PROJECT, onSuccess: (dynamic response, int statusCode) {
_hospitals.clear();
response['ListProject'].forEach((hospital) {
_hospitals.add(HospitalsModel.fromJson(hospital));
@ -42,5 +69,4 @@ class HospitalService extends BaseService {
super.error = error;
}, body: body);
}
}

@ -1,11 +1,16 @@
import 'dart:convert';
import 'dart:io';
import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/qr/qr_parking_model.dart';
import 'package:diplomaticquarterapp/core/service/qr_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import '../../locator.dart';
@ -16,7 +21,7 @@ class QrViewModel extends BaseViewModel {
readQr() async {
//TODO fix the barcode scan
String result = (await BarcodeScanner.scan())?.rawContent;
String result = await readQR();
var data = json.decode(result);
var qRParkingID = data['QRParkingID'];
setState(ViewState.BusyLocal);
@ -37,6 +42,20 @@ class QrViewModel extends BaseViewModel {
}
}
readQR() async {
if (await PermissionService.isCameraEnabled()) {
return (await BarcodeScanner.scan())?.rawContent;
} else {
if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(AppGlobal.context, TranslationBase.of(AppGlobal.context).cameraPermissionDialog, () async {
return (await BarcodeScanner.scan())?.rawContent;
});
} else {
return (await BarcodeScanner.scan())?.rawContent;
}
}
}
getIsSaveParking() async {
setState(ViewState.Busy);
var parking = await sharedPref.getObject(IS_GO_TO_PARKING);

@ -59,7 +59,7 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
_controller = new PageController();
_getCurrentLocation();
// _getCurrentLocation();
}
_getCurrentLocation() async {

@ -1,14 +1,16 @@
import 'dart:async';
import 'dart:io';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/app_map/google_huawei_map.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
@ -20,7 +22,6 @@ import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'cmc_location_page.dart';
import 'new_cmc_step_three_page.dart';
@ -61,24 +62,31 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
currentPostion = LatLng(lat, long);
setMap();
} else {
if (await Permission.location.request().isGranted) {
var position = await GeolocatorPlatform.instance.getCurrentPosition(desiredAccuracy: LocationAccuracy.low);
currentPostion = LatLng(position.latitude, position.longitude);
latitude = position.latitude;
longitude = position.longitude;
setMap();
if (await PermissionService.isLocationEnabled()) {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
longitude = value.longitude;
currentPostion = LatLng(latitude, longitude);
setMap();
});
} else {
requestPermissions().then(
(value) async {
if (value[Permission.location].isGranted) {
var position = await GeolocatorPlatform.instance.getCurrentPosition(desiredAccuracy: LocationAccuracy.low);
currentPostion = LatLng(position.latitude, position.longitude);
latitude = position.latitude;
longitude = position.longitude;
if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
longitude = value.longitude;
currentPostion = LatLng(latitude, longitude);
setMap();
}
},
);
});
});
} else {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
longitude = value.longitude;
currentPostion = LatLng(latitude, longitude);
setMap();
});
}
}
}
}

@ -328,7 +328,6 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
ImageOptions.showImageOptions(context, (String image, File file) {
setState(() {
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image);
insuredPatientImages = [eReferralAttachment];
});
});

@ -1,14 +1,16 @@
import 'dart:async';
import 'dart:io';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/app_map/google_huawei_map.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
@ -20,7 +22,6 @@ import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:permission_handler/permission_handler.dart';
import 'location_page.dart';
@ -78,24 +79,30 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
currentPostion = LatLng(lat, long);
setMap();
} else {
if (await Permission.location.request().isGranted) {
var position = await GeolocatorPlatform.instance.getCurrentPosition(desiredAccuracy: LocationAccuracy.low);
currentPostion = LatLng(position.latitude, position.longitude);
latitude = position.latitude;
longitude = position.longitude;
setMap();
if (await PermissionService.isLocationEnabled()) {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
longitude = value.longitude;
currentPostion = LatLng(latitude, longitude);
setMap();
});
} else {
requestPermissions().then(
(value) async {
if (value[Permission.location].isGranted) {
var position = await GeolocatorPlatform.instance.getCurrentPosition(desiredAccuracy: LocationAccuracy.low);
currentPostion = LatLng(position.latitude, position.longitude);
latitude = position.latitude;
longitude = position.longitude;
if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
longitude = value.longitude;
currentPostion = LatLng(latitude, longitude);
setMap();
}
},
);
});
});
} else {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
longitude = value.longitude;
setMap();
});
}
}
}
}

@ -1,9 +1,12 @@
import 'dart:io';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -36,17 +39,47 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
void initState() {
super.initState();
_controller = new PageController();
_getCurrentLocation();
// _getCurrentLocation();
}
_getCurrentLocation() async {
await Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
_latitude = 0;
});
if (await PermissionService.isLocationEnabled()) {
Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
_latitude = 0;
});
} else {
if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () {
Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
_latitude = 0;
});
});
} else {
Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
_latitude = 0;
});
}
}
// await Geolocator.getLastKnownPosition().then((value) {
// _latitude = value.latitude;
// _longitude = value.longitude;
// }).catchError((e) {
// _longitude = 0;
// _latitude = 0;
// });
}
@override

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/weather_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -5,10 +7,12 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/hmg_services.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -40,10 +44,22 @@ class _AllHabibMedicalSevicePage2State extends State<AllHabibMedicalSevicePage2>
super.initState();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => {Geolocator.getLastKnownPosition().then((value) => setLocation(value))});
WidgetsBinding.instance.addPostFrameCallback((_) async => {
if (await PermissionService.isLocationEnabled())
{Geolocator.getLastKnownPosition().then((value) => setLocation(value))}
else
{
if (Platform.isAndroid)
{
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () {
Geolocator.getLastKnownPosition().then((value) => setLocation(value));
})
}
else
{Geolocator.getLastKnownPosition().then((value) => setLocation(value))}
}
});
});
// getPatientAppointmentHistory1();
// getFamilyFiles();
}
initialiseHmgServices(bool isLogin) {

@ -506,7 +506,7 @@ class _BookSuccessState extends State<BookSuccess> {
appo.projectName = widget.patientShareResponse.projectName;
appo.appointmentNo = widget.patientShareResponse.appointmentNo;
Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) {
Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
}))).then((value) {
if (value != null) {
@ -516,7 +516,7 @@ class _BookSuccessState extends State<BookSuccess> {
});
}
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, double amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
widget.browser.openPaymentBrowser(
@ -525,7 +525,7 @@ class _BookSuccessState extends State<BookSuccess> {
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo),
appo.projectID.toString(),
authenticatedUser.emailAddress,
paymentMethod,
paymentMethod[0],
authenticatedUser.patientType,
authenticatedUser.firstName,
authenticatedUser.patientID,
@ -537,7 +537,8 @@ class _BookSuccessState extends State<BookSuccess> {
widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.clinicID,
widget.patientShareResponse.doctorID);
widget.patientShareResponse.doctorID,
paymentMethod[1]);
// }
}
@ -575,7 +576,8 @@ class _BookSuccessState extends State<BookSuccess> {
String amount = res['Amount'];
String payment_method = res['PaymentMethod'];
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed';
projectViewModel.analytics.appointment.payment_success(appointment_type: 'regular', payment_method: payment_method, clinic: appo.clinicName, hospital: appo.projectName, txn_amount: "$amount", txn_currency: currency, txn_number: txn_ref);
projectViewModel.analytics.appointment.payment_success(
appointment_type: 'regular', payment_method: payment_method, clinic: appo.clinicName, hospital: appo.projectName, txn_amount: "$amount", txn_currency: currency, txn_number: txn_ref);
createAdvancePayment(res, appo);
} else {
GifLoaderDialogUtils.hideDialog(context);

@ -1,8 +1,12 @@
import 'dart:io';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:flutter/material.dart';
@ -17,16 +21,23 @@ Future<Map<Permission, PermissionStatus>> requestPermissions() async {
showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted,
{Function onSuccess, String title, String description, Function(int) onMultiDateSuccess}) async {
if (await Permission.calendar.request().isGranted) {
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted,
onSuccess: onSuccess, title: title, description: description, onMultiDateSuccess: onMultiDateSuccess);
if (Platform.isAndroid) {
if (await PermissionService.isCameraEnabled()) {
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted,
onSuccess: onSuccess, title: title, description: description, onMultiDateSuccess: onMultiDateSuccess);
} else {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).calendarPermission, () async {
if (await Permission.calendar.request().isGranted) {
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted,
onSuccess: onSuccess, title: title, description: description, onMultiDateSuccess: onMultiDateSuccess);
}
});
}
} else {
requestPermissions().then((results) {
if (results[Permission.calendar].isGranted) {
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted,
onSuccess: onSuccess, title: title, description: description, onMultiDateSuccess: onMultiDateSuccess);
}
});
if (await Permission.calendar.request().isGranted) {
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted,
onSuccess: onSuccess, title: title, description: description, onMultiDateSuccess: onMultiDateSuccess);
}
}
}

@ -27,6 +27,7 @@ class CovidPaymentSummary extends StatefulWidget {
PatientShareResponse patientShareResponse;
String selectedPaymentMethod;
String selectedInstallmentPlan;
MyInAppBrowser browser;
AuthenticatedUser authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences();
@ -104,8 +105,9 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
InkWell(
onTap: () {
showDraggableDialog(context, PaymentMethod(
onSelectedMethod: (String metohd) {
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
widget.selectedPaymentMethod = metohd;
widget.selectedInstallmentPlan = selectedInstallmentPlan;
setState(() {});
},
));
@ -226,7 +228,9 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.clinicID,
widget.patientShareResponse.doctorID);
widget.patientShareResponse.doctorID,
widget.selectedInstallmentPlan
);
}
onBrowserLoadStart(String url) {
@ -352,6 +356,9 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
case "ApplePay":
return 'assets/images/new/payment/Apple_Pay.png';
break;
case "TAMARA":
return 'assets/images/new/payment/tamara.png';
break;
}
return 'assets/images/new/payment/Mada.png';

@ -130,263 +130,270 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
controller: _tabController,
children: <Widget>[
Container(
child: widget.appoList.length != 0 ? ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: widget.appoList.length,
itemBuilder: (context, index) {
return Container(
width: double.infinity,
margin: EdgeInsets.only(left: 12.0, right: 12.0, top: 12.0),
decoration: cardRadius(12),
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 4.0),
child: widget.appoList[index].clinicID == 265
? Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0),
)
: widget.appoList[index].isLiveCareAppointment
? SvgPicture.asset("assets/images/new/virtual.svg")
: SvgPicture.asset("assets/images/new/hospital-visit.svg"),
// SvgPicture.asset("assets/images/new/virtual.svg"),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text(
widget.appoList[index].clinicID == 265
? TranslationBase.of(context).covidTestTodo
: widget.appoList[index].isLiveCareAppointment
? TranslationBase.of(context).liveCareAppo
: TranslationBase.of(context).walkinAppo,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: CountdownTimer(
controller: new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime time) {
return time != null
? Text(
'${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} ' +
TranslationBase.of(context).upcomingTimeLeft,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48))
: Container();
},
child: widget.appoList.length != 0
? ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: widget.appoList.length,
itemBuilder: (context, index) {
return Container(
width: double.infinity,
margin: EdgeInsets.only(left: 12.0, right: 12.0, top: 12.0),
decoration: cardRadius(12),
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 4.0),
child: widget.appoList[index].clinicID == 265
? Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0),
)
: widget.appoList[index].isLiveCareAppointment
? SvgPicture.asset("assets/images/new/virtual.svg")
: SvgPicture.asset("assets/images/new/hospital-visit.svg"),
// SvgPicture.asset("assets/images/new/virtual.svg"),
),
),
],
),
],
),
Container(
child: InkWell(
onTap: () {
performNextAction(widget.appoList[index]);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: getNextActionButtonColor(widget.appoList[index].nextAction),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(6),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text(
widget.appoList[index].clinicID == 265
? TranslationBase.of(context).covidTestTodo
: widget.appoList[index].isLiveCareAppointment
? TranslationBase.of(context).liveCareAppo
: TranslationBase.of(context).walkinAppo,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: CountdownTimer(
controller:
new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime time) {
return time != null
? Text(
'${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} ' +
TranslationBase.of(context).upcomingTimeLeft,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48))
: Container();
},
),
),
],
),
],
),
child: Text(
getNextActionText(widget.appoList[index].nextAction),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
Container(
child: InkWell(
onTap: () {
performNextAction(widget.appoList[index]);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: getNextActionButtonColor(widget.appoList[index].nextAction),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(6),
),
child: Text(
getNextActionText(widget.appoList[index].nextAction),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
),
),
),
],
),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
),
),
],
),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
LargeAvatar(
name: widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
url: widget.appoList[index].doctorImageURL,
width: 52,
height: 52,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", widget.appoList[index].clinicName, projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, widget.appoList[index].projectName, projectViewModel.isArabic),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: widget.appoList[index].actualDoctorRate.toDouble(),
size: 16.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
],
LargeAvatar(
name: widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
url: widget.appoList[index].doctorImageURL,
width: 52,
height: 52,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", widget.appoList[index].clinicName, projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, widget.appoList[index].projectName, projectViewModel.isArabic),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: widget.appoList[index].actualDoctorRate.toDouble(),
size: 16.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
],
),
],
),
),
],
),
),
],
),
Padding(
padding: const EdgeInsets.only(top: 12.0),
child: Text(
getNextActionDescription(widget.appoList[index].nextAction),
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16),
),
),
InkWell(
onTap: () {
navigateToAppointmentDetails(context, widget.appoList[index]);
},
child: Padding(
padding: const EdgeInsets.only(top: 0.0),
child: Text(
TranslationBase.of(context).moreDetails,
style: TextStyle(
fontSize: 10, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48, height: 25 / 16, decoration: TextDecoration.underline),
),
),
),
],
),
);
},
) : getNoDataWidget(context),
),
Container(
child: widget.obGyneAppoList.length != 0 ? ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: widget.obGyneAppoList.length,
itemBuilder: (context, index) {
return Container(
width: double.infinity,
margin: EdgeInsets.only(left: 12.0, right: 12.0, top: 12.0),
decoration: cardRadius(12),
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 0.0),
child: Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: SvgPicture.asset("assets/images/new/ultrasound.svg", width: 20.0, height: 20.0),
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text(TranslationBase.of(context).walkinAppo,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
),
],
Padding(
padding: const EdgeInsets.only(top: 12.0),
child: Text(
getNextActionDescription(widget.appoList[index].nextAction),
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16),
),
],
),
Container(
child: InkWell(
),
InkWell(
onTap: () {
getOBGyneDoctorsList(widget.obGyneAppoList[index].projectID, widget.obGyneAppoList[index].setupID, widget.obGyneAppoList[index]);
navigateToAppointmentDetails(context, widget.appoList[index]);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: CustomColors.green,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(6),
),
child: Padding(
padding: const EdgeInsets.only(top: 0.0),
child: Text(
TranslationBase.of(context).bookNow,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
TranslationBase.of(context).moreDetails,
style: TextStyle(
fontSize: 10, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48, height: 25 / 16, decoration: TextDecoration.underline),
),
),
),
),
],
),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
],
),
),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
LargeAvatar(
name: TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName,
url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
width: 52,
height: 52,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
);
},
)
: getNoDataWidget(context),
),
Container(
child: widget.obGyneAppoList.length != 0
? ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: widget.obGyneAppoList.length,
itemBuilder: (context, index) {
return Container(
width: double.infinity,
margin: EdgeInsets.only(left: 12.0, right: 12.0, top: 12.0),
decoration: cardRadius(12),
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 0.0),
child: Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: SvgPicture.asset("assets/images/new/ultrasound.svg", width: 20.0, height: 20.0),
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text(TranslationBase.of(context).walkinAppo,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
),
],
),
],
),
Container(
child: InkWell(
onTap: () {
getOBGyneDoctorsList(widget.obGyneAppoList[index].projectID, widget.obGyneAppoList[index].setupID, widget.obGyneAppoList[index]);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: CustomColors.green,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(6),
),
child: Text(
TranslationBase.of(context).bookNow,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
),
),
),
],
),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", widget.obGyneAppoList[index].clinicDescription, projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).orderDate + ": ",
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.obGyneAppoList[index].orderDate)).split(" ")[0], projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, widget.obGyneAppoList[index].projectDescription, projectViewModel.isArabic),
LargeAvatar(
name: TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName,
url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
width: 52,
height: 52,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", widget.obGyneAppoList[index].clinicDescription, projectViewModel.isArabic),
MyRichText(
TranslationBase.of(context).orderDate + ": ",
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.obGyneAppoList[index].orderDate)).split(" ")[0],
projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, widget.obGyneAppoList[index].projectDescription, projectViewModel.isArabic),
],
),
),
],
),
),
],
),
],
),
);
},
) : getNoDataWidget(context),
],
),
);
},
)
: getNoDataWidget(context),
),
],
),
@ -701,7 +708,15 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}
navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital, OBGyneProcedureListResponse obGyneProcedureListResponse) {
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, isObGyneAppointment: true, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital, obGyneProcedureListResponse: obGyneProcedureListResponse)));
Navigator.push(
context,
FadePage(
page: SearchResults(
isLiveCareAppointment: false,
isObGyneAppointment: true,
doctorsList: docList,
patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital,
obGyneProcedureListResponse: obGyneProcedureListResponse)));
}
getPatientAppointmentHistory() {
@ -821,7 +836,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
});
}
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) {
openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, double amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
widget.browser.openPaymentBrowser(
@ -830,7 +845,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo),
appo.projectID.toString(),
authenticatedUser.emailAddress,
paymentMethod,
paymentMethod[0],
authenticatedUser.patientType,
authenticatedUser.firstName,
authenticatedUser.patientID,
@ -842,12 +857,14 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
appo.appointmentDate,
appo.appointmentNo,
appo.clinicID,
appo.doctorID);
appo.doctorID,
paymentMethod[1]);
}
onBrowserLoadStart(String url) {
print("onBrowserLoadStart");
print(url);
// Uri myUri = Uri.parse(url);
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
@ -929,13 +946,13 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}
Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) {
Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
}))).then((value) {
print(value);
getPatientAppointmentHistory();
if (value != null){
if (value != null) {
final appType = appo.isLiveCareAppointment ? 'livecare' : 'regular';
projectViewModel.analytics.appointment.payment_method(appointment_type: appType, clinic: appo.clinicName, payment_method: value, payment_type: 'appointment');
openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);

@ -1,14 +1,14 @@
import 'dart:io';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/tamara_installment_details.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:pay/pay.dart';
class PaymentMethod extends StatefulWidget {
Function onSelectedMethod;
@ -22,6 +22,8 @@ class PaymentMethod extends StatefulWidget {
class _PaymentMethodState extends State<PaymentMethod> {
String selectedPaymentMethod = "MADA";
TamaraInstallmentDetails tamaraInstallmentDetails;
String selectedInstallmentPlan;
@override
Widget build(BuildContext context) {
@ -190,6 +192,55 @@ class _PaymentMethodState extends State<PaymentMethod> {
),
),
),
Container(
width: double.infinity,
child: InkWell(
onTap: () {
updateSelectedPaymentMethod("TAMARA");
},
child: Card(
elevation: 0.0,
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "TAMARA" ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0),
),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
children: [
Container(
width: 24,
height: 24,
decoration: containerColorRadiusBorderWidth(selectedPaymentMethod == "TAMARA" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5),
),
mWidth(12),
Container(
height: 60.0,
padding: EdgeInsets.all(0.0),
width: 60,
child: Image.asset("assets/images/new/payment/tamara.png"),
),
mFlex(1),
if (selectedPaymentMethod == "TAMARA")
Container(
decoration: containerRadius(CustomColors.green, 200),
padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12),
child: Text(
TranslationBase.of(context).paymentSelected,
style: TextStyle(
color: Colors.white,
fontSize: 11,
),
),
),
],
),
),
),
),
),
if (widget.isShowInstallments)
Container(
width: double.infinity,
@ -303,12 +354,113 @@ class _PaymentMethodState extends State<PaymentMethod> {
bottomSheet: Container(
padding: EdgeInsets.all(16),
color: Colors.white,
child:
Container(
child: selectedPaymentMethod == "TAMARA"
? Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(TranslationBase.of(context).selectTamaraPlan, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
Container(
height: 60.0,
padding: EdgeInsets.all(0.0),
width: 60,
child: Image.asset("assets/images/new/payment/tamara.png"),
),
],
),
),
Column(
children: [
...List.generate(
tamaraInstallmentDetails.supportedInstalments.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 1,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
selectedInstallmentPlan = tamaraInstallmentDetails.supportedInstalments[index].instalments.toString();
// getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID);
});
},
child: Row(
children: [
Radio(
value: tamaraInstallmentDetails.supportedInstalments[index].instalments.toString(),
groupValue: selectedInstallmentPlan,
activeColor: Colors.red[800],
toggleable: true,
onChanged: (value) {
setState(() {
selectedInstallmentPlan = value;
print(selectedInstallmentPlan);
});
},
),
Text(
tamaraInstallmentDetails.supportedInstalments[index].instalments.toString() + " " + TranslationBase.of(context).installments,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
),
),
)
],
),
],
),
),
Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
color: Colors.white,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.height * 0.1,
height: 45.0,
child: RaisedButton(
color: CustomColors.green,
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
elevation: 0,
onPressed: () {
widget.onSelectedMethod(selectedPaymentMethod, selectedInstallmentPlan);
Navigator.pop(context, [selectedPaymentMethod, selectedInstallmentPlan]);
},
child: Text(TranslationBase.of(context).confirm.toUpperCase(),
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
)),
),
),
),
],
),
],
)
: Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
color: Colors.white,
// margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
@ -322,8 +474,8 @@ class _PaymentMethodState extends State<PaymentMethod> {
disabledColor: new Color(0xFFbcc2c4),
elevation: 0,
onPressed: () {
widget.onSelectedMethod(selectedPaymentMethod);
Navigator.pop(context, selectedPaymentMethod);
widget.onSelectedMethod(selectedPaymentMethod, selectedInstallmentPlan);
Navigator.pop(context, [selectedPaymentMethod, selectedInstallmentPlan]);
},
child: Text(TranslationBase.of(context).confirm.toUpperCase(),
style: TextStyle(
@ -341,5 +493,23 @@ class _PaymentMethodState extends State<PaymentMethod> {
setState(() {
selectedPaymentMethod = selectedMethod;
});
if (selectedMethod == "TAMARA") {
getTamaraPaymentDetails();
}
}
getTamaraPaymentDetails() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getTamaraPaymentDetails(context).then((res) {
tamaraInstallmentDetails = TamaraInstallmentDetails.fromJson(res);
print(tamaraInstallmentDetails.name);
selectedInstallmentPlan = tamaraInstallmentDetails.supportedInstalments[0].instalments.toString();
GifLoaderDialogUtils.hideDialog(context);
setState(() {});
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
}

@ -70,7 +70,6 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
print("");
initialiseHmgServices(false);
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
var userProvider = Provider.of<ToDoCountProviderModel>(context);

@ -1,5 +1,3 @@
import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
@ -12,11 +10,9 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page_2.dart';
import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
@ -25,21 +21,17 @@ import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/HMGNetworkConnectivity.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/SignalRUtil.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:diplomaticquarterapp/uitl/push-notification-handler.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/covid_consent_dialog.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -51,7 +43,6 @@ import 'package:provider/provider.dart';
import '../../locator.dart';
import '../../routes.dart';
class LandingPage extends StatefulWidget {
static LandingPage shared;
_LandingPageState state;
@ -100,10 +91,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
void _requestIOSPermissions() {
flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()?.requestPermissions(
alert: true,
badge: true,
sound: true,
);
alert: true,
badge: true,
sound: true,
);
}
bool isPageNavigated = false;
@ -117,9 +108,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
DateTime now = DateTime.now();
if (currentBackPressTime == null || now.difference(currentBackPressTime) > Duration(seconds: 2)) {
currentBackPressTime = now;
AppToast.showToast(message: TranslationBase
.of(context)
.pressAgain);
AppToast.showToast(message: TranslationBase.of(context).pressAgain);
return Future.value(false);
}
return Future.value(true);
@ -146,18 +135,13 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
Navigator.push(
context,
MaterialPageRoute(
builder: (cxt) =>
NotAutPage(
title: TranslationBase
.of(context)
.myFamilyFiles,
description: TranslationBase
.of(context)
.familyInfo,
infoList: [],
imagesInfo: imagesInfo,
icon: "assets/images/new/bottom_nav/family_files.svg",
),
builder: (cxt) => NotAutPage(
title: TranslationBase.of(context).myFamilyFiles,
description: TranslationBase.of(context).familyInfo,
infoList: [],
imagesInfo: imagesInfo,
icon: "assets/images/new/bottom_nav/family_files.svg",
),
),
);
return;
@ -170,18 +154,13 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
Navigator.push(
context,
MaterialPageRoute(
builder: (cxt) =>
NotAutPage(
title: TranslationBase
.of(context)
.todoList,
description: TranslationBase
.of(context)
.infoTodo,
infoList: [],
imagesInfo: imagesInfo,
icon: "assets/images/new/bottom_nav/todo.svg",
),
builder: (cxt) => NotAutPage(
title: TranslationBase.of(context).todoList,
description: TranslationBase.of(context).infoTodo,
infoList: [],
imagesInfo: imagesInfo,
icon: "assets/images/new/bottom_nav/todo.svg",
),
),
);
return;
@ -259,7 +238,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
pageController = PageController(keepPage: true);
_firebaseMessaging.setAutoInitEnabled(true);
locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context);
// locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectViewModel.isLogin && !projectViewModel.isLoginChild) {
familyFileProvider.getSharedRecordByStatus();
@ -269,49 +248,18 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// HMG (Guest/Internet) Wifi Access [Zohaib Kambrani]
// for now commented to reduce this call will enable it when needed
HMGNetworkConnectivity(context).start();
requestPermissions().then((results) {
locationUtils.getCurrentLocation();
_firebaseMessaging.getToken().then((String token) {
print("Firebase Token: " + token);
sharedPref.setString(PUSH_TOKEN, token);
if (token != null) {
DEVICE_TOKEN = token;
if (!projectViewModel.isLoginChild) {
checkUserStatus(token);
}
_firebaseMessaging.getToken().then((String token) {
print("Firebase Token: " + token);
sharedPref.setString(PUSH_TOKEN, token);
if (token != null) {
DEVICE_TOKEN = token;
if (!projectViewModel.isLoginChild) {
checkUserStatus(token);
}
});
if (results[Permission.location].isGranted) {}
// if (results[Permission.storage].isGranted) ;
// if (results[Permission.camera].isGranted) ;
// if (results[Permission.photos].isGranted) ;
// if (results[Permission.accessMediaLocation].isGranted) ;
// if (results[Permission.calendar].isGranted) ;
}
});
}
Future<Map<Permission, PermissionStatus>> requestPermissions() async {
var permissionResults = [
Permission.location,
Permission.locationAlways,
// Permission.storage,
// Permission.camera,
// Permission.photos,
// Permission.notification,
// Permission.accessMediaLocation,
// Permission.calendar,
// Permission.activityRecognition
].request();
// var permissionsGranted = await deviceCalendarPlugin.hasPermissions();
// if (permissionsGranted.isSuccess && !permissionsGranted.data) {
// permissionsGranted = await deviceCalendarPlugin.requestPermissions();
// if (!permissionsGranted.isSuccess || !permissionsGranted.data) {}
// }
return permissionResults;
}
void setUserValues(value) async {
if (value != null) sharedPref.setObject(IMEI_USER_DATA, value);
}
@ -377,18 +325,17 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
if (await sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) {
authService.getDashboard().then((value) =>
{
if (value != null)
{
setState(() {
notificationCount =
value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
})
}
});
authService.getDashboard().then((value) => {
if (value != null)
{
setState(() {
notificationCount =
value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
})
}
});
}
}
}
@ -401,102 +348,90 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
return Scaffold(
appBar: currentTab == 0
? PreferredSize(
preferredSize: Size.fromHeight(currentTab == 0 ? 45 : 0.0),
child: AppBar(
elevation: 0,
backgroundColor: CustomColors.backgroudGreyColor,
textTheme: TextTheme(
headline6: TextStyle(color: Theme
.of(context)
.textTheme
.headline1
.color, fontWeight: FontWeight.bold),
),
title: Text(
getText(currentTab).toUpperCase(),
style: TextStyle(
fontWeight: FontWeight.bold,
color: currentTab == 0 ? CustomColors.backgroudGreyColor : Theme
.of(context)
.textTheme
.headline1
.color,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
// bold: true,
),
leading: Builder(
builder: (BuildContext context) {
return new Stack(
children: <Widget>[
currentTab == 0
? IconButton(
icon: SvgPicture.asset("assets/images/new/menu.svg"),
color: Theme
.of(context)
.textTheme
.headline1
.color,
onPressed: () => Scaffold.of(context).openDrawer(),
)
: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {
setState(() {
currentTab = 0;
});
pageController.jumpToPage(0);
},
),
projectViewModel.isLogin && model.notificationsCount != null && !projectViewModel.isLoginChild
? new Positioned(
right: projectViewModel.isArabic ? 35 : 0,
top: 5,
child: new Container(
padding: EdgeInsets.all(4),
decoration: new BoxDecoration(
color: CustomColors.accentColor,
borderRadius: BorderRadius.circular(20),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: new Text(
model.notificationsCount.toString(),
style: new TextStyle(
color: Colors.white,
fontSize: projectViewModel.isArabic ? 8 : 9,
),
textAlign: TextAlign.center,
),
),
)
: SizedBox()
preferredSize: Size.fromHeight(currentTab == 0 ? 45 : 0.0),
child: AppBar(
elevation: 0,
backgroundColor: CustomColors.backgroudGreyColor,
textTheme: TextTheme(
headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold),
),
title: Text(
getText(currentTab).toUpperCase(),
style: TextStyle(
fontWeight: FontWeight.bold,
color: currentTab == 0 ? CustomColors.backgroudGreyColor : Theme.of(context).textTheme.headline1.color,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
// bold: true,
),
leading: Builder(
builder: (BuildContext context) {
return new Stack(
children: <Widget>[
currentTab == 0
? IconButton(
icon: SvgPicture.asset("assets/images/new/menu.svg"),
color: Theme.of(context).textTheme.headline1.color,
onPressed: () => Scaffold.of(context).openDrawer(),
)
: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {
setState(() {
currentTab = 0;
});
pageController.jumpToPage(0);
},
),
projectViewModel.isLogin && model.notificationsCount != null && !projectViewModel.isLoginChild
? new Positioned(
right: projectViewModel.isArabic ? 35 : 0,
top: 5,
child: new Container(
padding: EdgeInsets.all(4),
decoration: new BoxDecoration(
color: CustomColors.accentColor,
borderRadius: BorderRadius.circular(20),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: new Text(
model.notificationsCount.toString(),
style: new TextStyle(
color: Colors.white,
fontSize: projectViewModel.isArabic ? 8 : 9,
),
textAlign: TextAlign.center,
),
),
)
: SizedBox()
],
);
},
),
actions: [
// IconButton(
// //iconSize: 70,
// icon: Icon(
// projectViewModel.isLogin ? Icons.settings : Icons.login,
// color: Theme.of(context).textTheme.headline1.color,
// ),
// onPressed: () {
// if (projectViewModel.isLogin)
// Navigator.of(context).pushNamed(
// SETTINGS,
// );
// else
// login();
// }, //do something,
// )
],
);
},
),
actions: [
// IconButton(
// //iconSize: 70,
// icon: Icon(
// projectViewModel.isLogin ? Icons.settings : Icons.login,
// color: Theme.of(context).textTheme.headline1.color,
// ),
// onPressed: () {
// if (projectViewModel.isLogin)
// Navigator.of(context).pushNamed(
// SETTINGS,
// );
// else
// login();
// }, //do something,
// )
],
centerTitle: true,
),
)
centerTitle: true,
),
)
: null,
drawer: SafeArea(child: AppDrawer()),
extendBody: false,
@ -552,12 +487,12 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: (projectViewModel.havePrivilege(34) && currentTab == 0)
? FloatingButton(
elevation: true,
onTap: () {
projectViewModel.analytics.appointment.book_appointment();
changeCurrentTab(2);
},
)
elevation: true,
onTap: () {
projectViewModel.analytics.appointment.book_appointment();
changeCurrentTab(2);
},
)
: null);
}
@ -568,29 +503,17 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
getText(currentTab) {
switch (currentTab) {
case 0:
return TranslationBase
.of(context)
.home;
return TranslationBase.of(context).home;
case 1:
return TranslationBase
.of(context)
.medicalProfile;
return TranslationBase.of(context).medicalProfile;
case 2:
return TranslationBase
.of(context)
.bookAppo;
return TranslationBase.of(context).bookAppo;
case 5:
return TranslationBase
.of(context)
.bookAppo;
return TranslationBase.of(context).bookAppo;
case 3:
return TranslationBase
.of(context)
.services;
return TranslationBase.of(context).services;
case 4:
return TranslationBase
.of(context)
.bookAppo;
return TranslationBase.of(context).bookAppo;
}
}
@ -601,22 +524,16 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
projectViewModel.analytics.setUser(data);
if (data != null) {
authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {});
authService.getDashboard().then((value) =>
{
setState(() {
if (value != null) {
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
}
}),
});
authService.getDashboard().then((value) => {
setState(() {
if (value != null) {
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
}
}),
});
}
sharedPref.getString(IS_COVID_CONSENT_SHOWN).then((value) {
print(value);
if (value == null)
showUserConsent();
});
} else {
projectViewModel.analytics.setUser(null);
}
@ -624,23 +541,5 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
void showUserConsent() {
sharedPref.setString(IS_COVID_CONSENT_SHOWN, "true");
showDialog(
context: context,
builder: (cxt) =>
CovidConsentDialog(
okTitle: TranslationBase
.of(context)
.acceptLbl,
title: TranslationBase
.of(context)
.covidConsentHeader,
message: TranslationBase
.of(context)
.covidConsent,
onTap: () async {
// Navigator.push(context, FadePage(page: CovidDrivethruLocation()));
},
));
}
}

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
@ -278,16 +280,21 @@ class ServicesView extends StatelessWidget {
}
showCovidDialog(BuildContext context) {
showDialog(
context: context,
builder: (cxt) => CovidConsentDialog(
okTitle: TranslationBase.of(context).acceptLbl,
title: TranslationBase.of(context).covidConsentHeader,
message: TranslationBase.of(context).covidConsent,
onTap: () async {
Navigator.push(context, FadePage(page: CovidDrivethruLocation()));
},
));
if (Platform.isAndroid) {
// Utils.showPermissionConsentDialog(context, "", () {});
showDialog(
context: context,
builder: (cxt) => CovidConsentDialog(
okTitle: TranslationBase.of(context).acceptLbl,
title: TranslationBase.of(context).covidConsentHeader,
message: TranslationBase.of(context).covidConsent,
onTap: () async {
Navigator.push(context, FadePage(page: CovidDrivethruLocation()));
},
));
} else {
Navigator.push(context, FadePage(page: CovidDrivethruLocation()));
}
}
getPharmacyToken(BuildContext context) async {

@ -279,7 +279,7 @@ class _clinic_listState extends State<ClinicList> {
});
}
Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) {
Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
}))).then((value) {
print(value);
@ -290,11 +290,11 @@ class _clinic_listState extends State<ClinicList> {
});
}
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) {
openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod,
authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID.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.toString(), "", "", "", "", paymentMethod[1]);
}
onBrowserLoadStart(String url) {

@ -1,15 +1,16 @@
import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ViewDoctorResponsesPage extends StatelessWidget {
final DoctorResponse doctorResponse;
const ViewDoctorResponsesPage({Key key, this.doctorResponse})
: super(key: key);
const ViewDoctorResponsesPage({Key key, this.doctorResponse}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -17,17 +18,87 @@ class ViewDoctorResponsesPage extends StatelessWidget {
onModelReady: (model) => model.updateReadStatus(transactionNo: doctorResponse.transactionNo),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: Color(0xffF8F8F8),
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).viewDoctorResponses,
baseViewModel: model,
body: SingleChildScrollView(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [],
children: [getResponsesList()],
),
),
),
),
);
}
Widget getResponsesList() {
return ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) {
return Container(
padding: const EdgeInsets.only(left: 20, right: 12, top: 12, bottom: 12),
height: 110,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(width: 1, color: Color(0xffEFEFEF)),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5,
blurRadius: 27,
offset: Offset(0, -3),
),
],
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: Text(
(doctorResponse.doctorName ?? ""),
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.64,
),
),
),
Container(
child: Text(
(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(doctorResponse.createdOn)) ?? ""),
style: TextStyle(
fontSize: 14,
color: Color(0xff2E303A),
letterSpacing: -0.64,
),
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(
doctorResponse.transactions[_index]['DoctorResponse'],
style: TextStyle(
fontSize: 16,
color: Color(0xff2E303A),
letterSpacing: -0.64,
),
),
),
],
),
);
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: doctorResponse.transactions.length);
}
}

@ -71,7 +71,7 @@ class DoctorResponse extends StatelessWidget {
);
},
child: Container(
height: 70,
height: 75,
margin: EdgeInsets.only(top: 8, bottom: 8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
@ -98,9 +98,12 @@ class DoctorResponse extends StatelessWidget {
),
),
),
Icon(projectViewModel.isArabic
? Icons.arrow_forward
: Icons.arrow_back_ios)
Padding(
padding: const EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
child: Icon(projectViewModel.isArabic
? Icons.arrow_back_ios
: Icons.arrow_forward_ios),
)
],
),
),

@ -325,23 +325,24 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
context,
FadePage(
page: PaymentMethod(
onSelectedMethod: (String metohd) {
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
},
isShowInstallments: num.tryParse(amount) >= 1000 ? true : false),
),
).then(
(value) {
projectViewModel.analytics.advancePayments.payment_method(method: value.toString().toLowerCase(), type: 'wallet');
projectViewModel.analytics.advancePayments.payment_method(method: value[0].toString().toLowerCase(), type: 'wallet');
Navigator.push(
context,
FadePage(
page: ConfirmPaymentPage(
advanceModel: advanceModel,
selectedPaymentMethod: value,
selectedPaymentMethod: value[0],
patientInfoAndMobileNumber: model.patientInfoAndMobileNumber,
authenticatedUser: authUser,
installmentPlan: value[1],
),
),
);

@ -24,9 +24,9 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:pay/pay.dart';
import 'package:provider/provider.dart';
import 'new_text_Field.dart';
class ConfirmPaymentPage extends StatefulWidget {
@ -34,8 +34,9 @@ class ConfirmPaymentPage extends StatefulWidget {
final PatientInfoAndMobileNumber patientInfoAndMobileNumber;
final String selectedPaymentMethod;
AuthenticatedUser authenticatedUser;
String installmentPlan;
ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser});
ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser, this.installmentPlan});
@override
_ConfirmPaymentPageState createState() => _ConfirmPaymentPageState();
@ -49,9 +50,15 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
String transID = "";
Pay _payClient = Pay.withAssets([
'applepay.json',
]);
Pay _payClient;
@override
void initState() {
_payClient = Pay.withAssets([
'applepay.json',
]);
super.initState();
}
void submit(MyBalanceViewModel model, code) {
final activationCode = code;
@ -65,7 +72,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
// startApplePay();
// } else {
projectViewModel.analytics.advancePayments.payment_otp_confirmation(method: widget.selectedPaymentMethod.toLowerCase(), type: 'wallet');
openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null);
openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null);
// }
});
}
@ -211,11 +218,11 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
});
// startApplePay();
// if()
GifLoaderDialogUtils.showMyDialog(context);
model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel.fileNumber), projectID: widget.advanceModel.hospitalsModel.iD).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(model);
});
// GifLoaderDialogUtils.showMyDialog(context);
// model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel.fileNumber), projectID: widget.advanceModel.hospitalsModel.iD).then((value) {
// GifLoaderDialogUtils.hideDialog(context);
// if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(model);
// });
},
),
),
@ -225,7 +232,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
}
startApplePay() {
GifLoaderDialogUtils.showMyDialog(context);
// GifLoaderDialogUtils.showMyDialog(context);
ApplePayResponse applePayResponse;
var _paymentItems = [
PaymentItem(
@ -244,6 +251,8 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
print(result);
applePayResponse = ApplePayResponse.fromJson(result);
callPayfortApplePayAPI(applePayResponse);
}).catchError((err) {
print(err);
});
}
@ -325,6 +334,9 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
case "ApplePay":
return 'assets/images/new/payment/Apple_Pay.png';
break;
case "TAMARA":
return 'assets/images/new/payment/tamara.png';
break;
}
return 'assets/images/new-design/mada.png';
@ -336,7 +348,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
transID = Utils.getAdvancePaymentTransID(widget.advanceModel.hospitalsModel.iD, int.parse(widget.advanceModel.fileNumber));
browser.openPaymentBrowser(amount, "Advance Payment", transID, widget.advanceModel.hospitalsModel.iD.toString(), widget.advanceModel.email, paymentMethod,
widget.patientInfoAndMobileNumber.patientType, widget.advanceModel.patientName, widget.advanceModel.fileNumber, authenticatedUser, browser, false, "3", "");
widget.patientInfoAndMobileNumber.patientType, widget.advanceModel.patientName, widget.advanceModel.fileNumber, authenticatedUser, browser, false, "3", "", "", "", "", "", widget.installmentPlan);
}
onBrowserLoadStart(String url) {

@ -1,5 +1,7 @@
import 'dart:async';
import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
@ -10,8 +12,10 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
@ -57,17 +61,47 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
}
_getCurrentLocation() async {
await Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
latitude = value.longitude;
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
}).catchError((e) {
latitude = 24.665011045779107;
latitude = 46.73502189439707;
});
if (await PermissionService.isLocationEnabled()) {
await Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
latitude = value.longitude;
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
}).catchError((e) {
latitude = 24.665011045779107;
latitude = 46.73502189439707;
});
} else {
if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(AppGlobal.context, TranslationBase.of(AppGlobal.context).locationPermissionDialog, () {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
latitude = value.longitude;
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
}).catchError((e) {
latitude = 24.665011045779107;
latitude = 46.73502189439707;
});
});
} else {
await Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
latitude = value.longitude;
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
}).catchError((e) {
latitude = 24.665011045779107;
latitude = 46.73502189439707;
});
}
}
}
@override

@ -384,9 +384,10 @@ class PrescriptionItemsPage extends StatelessWidget {
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).resendOrder,
((!projectViewModel.havePrivilege(62)) || projectViewModel.user.outSA == 1 || model.isMedDeliveryAllowed == false)
? null
: () => {
// ((!projectViewModel.havePrivilege(62)) || projectViewModel.user.outSA == 1 || model.isMedDeliveryAllowed == false)
// ? null
// :
() => {
Navigator.push(
context,
FadePage(

@ -2,11 +2,13 @@ import 'dart:io';
import 'package:collection/collection.dart';
import 'package:diplomaticquarterapp/models/SmartWatch/HealthData.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.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/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:flutter/material.dart';
import 'package:health/health.dart';
@ -32,6 +34,9 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
int MedCategoryID = 0;
HealthFactory health = HealthFactory();
List<HealthDataType> types = [HealthDataType.STEPS, HealthDataType.HEART_RATE, Platform.isAndroid ? HealthDataType.DISTANCE_DELTA : HealthDataType.DISTANCE_WALKING_RUNNING];
@override
void initState() {
super.initState();
@ -39,7 +44,33 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
@override
Widget build(BuildContext context) {
return DefaultButton(TranslationBase.of(context).syncHealthData, () => readAll()).insideContainer;
return DefaultButton(TranslationBase.of(context).syncHealthData, () => checkPermissions()).insideContainer;
}
checkPermissions() async {
if (Platform.isAndroid) {
if (await PermissionService.isHealthDataPermissionEnabled()) {
await health.requestAuthorization(types).then((value) {
if(value) {
readAll();
}
});
} else {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).physicalActivityPermission, () async {
await health.requestAuthorization(types).then((value) {
if(value) {
readAll();
}
});
});
}
} else {
await health.requestAuthorization(types).then((value) {
if(value) {
readAll();
}
});
}
}
void readAll() async {
@ -51,10 +82,7 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
Med_InsertTransactionsInputsList.clear();
DateTime startDate = DateTime.now().subtract(new Duration(days: 30));
HealthFactory health = HealthFactory();
List<HealthDataType> types = [HealthDataType.STEPS, HealthDataType.HEART_RATE, Platform.isAndroid ? HealthDataType.DISTANCE_DELTA : HealthDataType.DISTANCE_WALKING_RUNNING];
await health.requestAuthorization(types);
await checkPermissions();
try {
List<HealthDataPoint> healthData = await health.getHealthDataFromTypes(startDate, DateTime.now(), types);

@ -329,8 +329,8 @@ class _GeneralSettings extends State<GeneralSettings> with TickerProviderStateMi
// accsibility = mediaQueryData.accessibleNavigation;
//setTheme(blindValue);
}
var camera = await this.permission.isCameraEnabled();
var location = await this.permission.isLocationEnabled();
var camera = await PermissionService.isCameraEnabled();
var location = await PermissionService.isLocationEnabled();
setState(() {
this.camera = camera;
this.location = location;

@ -1409,6 +1409,16 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getTamaraPaymentDetails(BuildContext context) async {
dynamic localRes;
await baseAppClient.get(GET_TAMARA_PLAN, isExternal: true, onSuccess: (response, statusCode) async {
localRes = response[0];
}, onFailure: (String error, int statusCode) {
throw error;
});
return localRes;
}
Future<Map> callPayfortApplePayAPI(ApplePayRequest applePayRequest, BuildContext context) async {
Map<String, dynamic> request;

@ -1,17 +1,10 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:localstorage/localstorage.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:vibration/vibration.dart';
import 'package:geolocator/geolocator.dart' as geo;
// import 'package:open_settings/open_settings.dart';
class PermissionService extends BaseService {
final LocalStorage storage = new LocalStorage("permission");
@ -55,16 +48,32 @@ class PermissionService extends BaseService {
].request();
}
isCameraEnabled() async {
static isCameraEnabled() async {
return await Permission.camera.isGranted;
}
static isExternalStorageEnabled() async {
return await Permission.storage.isGranted;
}
static isHealthDataPermissionEnabled() async {
return await Permission.sensors.isGranted;
}
static isMicrophonePermissionEnabled() async {
return await Permission.microphone.isGranted;
}
static isCalendarPermissionEnabled() async {
return await Permission.calendar.isGranted;
}
setCameraLocationPermission(context) async {
Navigator.pop(context);
openAppSettings();
}
isLocationEnabled() async {
static isLocationEnabled() async {
var permission = await geo.Geolocator.checkPermission();
if (permission == geo.LocationPermission.denied) {
return false;

@ -2,17 +2,17 @@ import 'dart:developer';
import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:wifi/wifi.dart';
import 'gif_loader_dialog_utils.dart';
@ -27,8 +27,13 @@ class HMGNetworkConnectivity {
HMGNetworkConnectivity(this.context);
start(){
checkAndConnectIfNoInternet();
AuthenticatedUser userData;
start() {
getUserData().then((value) {
userData = value;
checkAndConnectIfNoInternet();
});
}
void checkAndConnectIfNoInternet() async {
@ -95,17 +100,22 @@ class HMGNetworkConnectivity {
}).showAlertDialog(context);
}
Future<AuthenticatedUser> getUserData() async {
var userData = AuthenticatedUser.fromJson(await AppSharedPreferences().getObject(MAIN_USER));
return userData;
}
connectForLocalAccess(){
connectForLocalAccess() {
String patientID = userData.patientID.toString();
GifLoaderDialogUtils.showMyDialog(context);
_platformBridge.connectHMGGuestWifi(GUEST_SSID).then((value) async{
if(value == 0){
_platformBridge.connectHMGGuestWifi(GUEST_SSID).then((value) async {
if (value == 0) {
GifLoaderDialogUtils.hideDialog(context);
}else{
getPatientWifiCredentials((username, password) async{
} else {
getPatientWifiCredentials(patientID, (username, password) async {
final result = await _platformBridge.connectHMGInternetWifi(PATIENT_SSID, username, password).catchError((err) => print(err.toString()));
GifLoaderDialogUtils.hideDialog(context);
if(result == 1){
if (result == 1) {
// Success
}
});
@ -113,65 +123,65 @@ class HMGNetworkConnectivity {
});
}
getPatientWifiCredentials(Function(String username, String password) successCallback){
final body = <String, dynamic>{"PatientID" : "1231755"};
locator<BaseAppClient>().post(WIFI_CREDENTIALS, body:body, onSuccess: (dynamic response, int statusCode){
getPatientWifiCredentials(String patientID, Function(String username, String password) successCallback) {
final body = <String, dynamic>{"PatientID": patientID};
locator<BaseAppClient>().post(WIFI_CREDENTIALS, body: body, onSuccess: (dynamic response, int statusCode) {
print(response);
var data = response["Hmg_SMS_Get_By_ProjectID_And_PatientIDList"];
if(data is List && data.first != null){
if (data is List && data.first != null) {
final username = data.first['UserName'];
final password = data.first['Password'];
if(username != null && password != null && username.isNotEmpty && password.isNotEmpty){
if (username != null && password != null && username.isNotEmpty && password.isNotEmpty) {
successCallback(username, password);
}
}
}, onFailure: (String error, int statusCode){
}, onFailure: (String error, int statusCode) {
print(error);
}, bypassConnectionCheck: true);
}
// void next() {
// if (Platform.isIOS) {
// confirmFromUser_iOS();
// } else if (Platform.isAndroid) {
// confirmFromUser();
// }
// }
// void confirmFromUser_iOS() {
// String message = "You don't have internet access, Do you want to connect with HMG Network to use App.\n\nMake sure you are in HMG Network range";
// ConfirmDialog(
// context: context,
// confirmMessage: message,
// okText: "Yes",
// okFunction: () {
// ConfirmDialog.closeAlertDialog(context);
// callBack();
// },
// cancelText: "No",
// cancelFunction: () {
// ConfirmDialog.closeAlertDialog(context);
// }).showAlertDialog(context);
// }
// void connect_Android() {
// // enable the Wifi if its off
// PlatformBridge()
// .enableWifiIfNot()
// .then((value) => {
// if (value == true)
// {
// callBack()
// // Wifi.list(SSID)
// // .then((value1) => {
// // if (value1.length > 0) {callBack()} else {log("No HMG network in range")}
// // })
// // .catchError((e) {
// // log(e);
// // })
// }
// })
// .catchError((error) {
// showFailDailog(error);
// });
// }
// void next() {
// if (Platform.isIOS) {
// confirmFromUser_iOS();
// } else if (Platform.isAndroid) {
// confirmFromUser();
// }
// }
// void confirmFromUser_iOS() {
// String message = "You don't have internet access, Do you want to connect with HMG Network to use App.\n\nMake sure you are in HMG Network range";
// ConfirmDialog(
// context: context,
// confirmMessage: message,
// okText: "Yes",
// okFunction: () {
// ConfirmDialog.closeAlertDialog(context);
// callBack();
// },
// cancelText: "No",
// cancelFunction: () {
// ConfirmDialog.closeAlertDialog(context);
// }).showAlertDialog(context);
// }
// void connect_Android() {
// // enable the Wifi if its off
// PlatformBridge()
// .enableWifiIfNot()
// .then((value) => {
// if (value == true)
// {
// callBack()
// // Wifi.list(SSID)
// // .then((value1) => {
// // if (value1.length > 0) {callBack()} else {log("No HMG network in range")}
// // })
// // .catchError((e) {
// // log(e);
// // })
// }
// })
// .catchError((error) {
// showFailDailog(error);
// });
// }
}

@ -3,6 +3,7 @@ import 'dart:io';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart';
@ -34,19 +35,32 @@ class LocationUtils {
if (permission == LocationPermission.always || permission == LocationPermission.whileInUse) {
Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: Duration(seconds: 10)).then((value) {
setLocation(value);
print(value.latitude);
print(value.longitude);
if (callBack != null) callBack(LatLng(value.latitude, value.longitude));
});
}
if (permission == LocationPermission.denied || permission == LocationPermission.deniedForever) {
if(await Permission.location.request().isGranted) {
getCurrentLocation();
} else {
setZeroLocation();
if (isShowConfirmDialog) showErrorLocationDialog(false);
if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () {
Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: Duration(seconds: 10)).then((value) {
setLocation(value);
if (callBack != null) callBack(LatLng(value.latitude, value.longitude));
});
});
} else {
if (await Permission.location.request().isGranted) {
getCurrentLocation();
} else {
setZeroLocation();
if (isShowConfirmDialog) showErrorLocationDialog(false);
}
}
// if(await Permission.location.request().isGranted) {
// getCurrentLocation();
// } else {
// setZeroLocation();
// if (isShowConfirmDialog) showErrorLocationDialog(false);
// }
}
}).catchError((err) {
print(err);

@ -2835,6 +2835,16 @@ class TranslationBase {
String get covidConsent => localizedValues["covidConsent"][locale.languageCode];
String get covidConsentHeader => localizedValues["covidConsentHeader"][locale.languageCode];
String get drawOverAppsPermission => localizedValues["drawOverAppsPermission"][locale.languageCode];
String get selectTamaraPlan => localizedValues["selectTamaraPlan"][locale.languageCode];
String get installments => localizedValues["installments"][locale.languageCode];
String get cameraPermissionDialog => localizedValues["cameraPermissionDialog"][locale.languageCode];
String get galleryPermission => localizedValues["galleryPermission"][locale.languageCode];
String get locationPermissionDialog => localizedValues["locationPermissionDialog"][locale.languageCode];
String get calendarPermission => localizedValues["calendarPermission"][locale.languageCode];
String get recordAudioPermission => localizedValues["recordAudioPermission"][locale.languageCode];
String get wifiPermission => localizedValues["wifiPermission"][locale.languageCode];
String get physicalActivityPermission => localizedValues["physicalActivityPermission"][locale.languageCode];
String get bluetoothPermission => localizedValues["bluetoothPermission"][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -7,8 +7,10 @@ import 'package:auto_size_text/auto_size_text.dart';
import 'package:badges/badges.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:connectivity/connectivity.dart';
import 'package:crypto/crypto.dart' as crypto;
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -38,6 +40,7 @@ import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/covid_consent_dialog.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -51,10 +54,6 @@ import 'app_shared_preferences.dart';
import 'app_toast.dart';
import 'gif_loader_dialog_utils.dart';
import 'navigation_service.dart';
import 'package:crypto/crypto.dart' as crypto;
import 'dart:convert';
import 'package:convert/convert.dart';
AppSharedPreferences sharedPref = new AppSharedPreferences();
@ -73,8 +72,7 @@ class Utils {
/// Check The Internet Connection
static Future<bool> checkConnection({bool bypassConnectionCheck = false}) async {
if(bypassConnectionCheck)
return true;
if (bypassConnectionCheck) return true;
ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity());
if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) {
@ -98,6 +96,17 @@ class Utils {
FocusScope.of(context).unfocus();
}
static showPermissionConsentDialog(BuildContext context, String message, Function onTap) {
showDialog(
context: context,
builder: (cxt) => CovidConsentDialog(
okTitle: TranslationBase.of(context).acceptLbl,
title: TranslationBase.of(context).covidConsentHeader,
message: message,
onTap: onTap,
));
}
bool isSAUDIIDValid(String id, type) {
if (type == 1) {
if (id == null) {
@ -501,23 +510,13 @@ class Utils {
if (projectViewModel.havePrivilege(32) || true) {
medical.add(InkWell(
onTap: () {
userData().then((userData_) {
if (projectViewModel.isLogin && userData_ != null || true) {
String patientID = userData_.patientID.toString();
GifLoaderDialogUtils.showMyDialog(context);
// projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)}).catchError((err) {
// print(err.toString());
// });
} else {
AlertDialogBox(
context: context,
confirmMessage: "Please login with your account first to use this feature",
okText: "OK",
okFunction: () {
AlertDialogBox.closeAlertDialog(context);
}).showAlertDialog(context);
}
});
if (Platform.isAndroid) {
showPermissionConsentDialog(context, TranslationBase.of(context).wifiPermission, () {
connectWifi(projectViewModel, context);
});
} else {
connectWifi(projectViewModel, context);
}
},
child: MedicalProfileItem(
title: TranslationBase.of(context).internet,
@ -540,6 +539,60 @@ class Utils {
return medical;
}
static getPatientWifiCredentials(String patientID, Function(String username, String password) successCallback) {
final body = <String, dynamic>{"PatientID": patientID};
locator<BaseAppClient>().post(WIFI_CREDENTIALS, body: body, onSuccess: (dynamic response, int statusCode) {
print(response);
var data = response["Hmg_SMS_Get_By_ProjectID_And_PatientIDList"];
if (data is List && data.first != null) {
final username = data.first['UserName'];
final password = data.first['Password'];
if (username != null && password != null && username.isNotEmpty && password.isNotEmpty) {
successCallback(username, password);
}
}
}, onFailure: (String error, int statusCode) {
print(error);
}, bypassConnectionCheck: true);
}
static connectWifi(ProjectViewModel projectViewModel, BuildContext context) {
final String GUEST_SSID = "HMG-MobileApp";
final String PATIENT_SSID = "GUEST-POC";
userData().then((userData_) {
if (projectViewModel.isLogin && userData_ != null || true) {
String patientID = userData_.patientID.toString();
GifLoaderDialogUtils.showMyDialog(context);
// projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)}).catchError((err) {
// print(err.toString());
// });
projectViewModel.platformBridge().connectHMGGuestWifi(GUEST_SSID).then((value) async {
if (value == 0) {
GifLoaderDialogUtils.hideDialog(context);
} else {
getPatientWifiCredentials(patientID, (username, password) async {
final result = await projectViewModel.platformBridge().connectHMGInternetWifi(PATIENT_SSID, username, password).catchError((err) => print(err.toString()));
GifLoaderDialogUtils.hideDialog(context);
if (result == 1) {
// Success
}
});
}
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
});
} else {
AlertDialogBox(
context: context,
confirmMessage: "Please login with your account first to use this feature",
okText: "OK",
okFunction: () {
AlertDialogBox.closeAlertDialog(context);
}).showAlertDialog(context);
}
});
}
static List<Widget> myMedicalListHomePage({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) {
List<Widget> medical = List();

@ -1,14 +1,21 @@
import 'dart:convert';
import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
// import 'package:feather_icons_flutter/feather_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
class ImageOptions {
static showImageOptions(BuildContext context, Function(String,File) image,) {
static showImageOptions(
BuildContext context,
Function(String, File) image,
) {
showModalBottomSheet(
backgroundColor: Colors.transparent,
context: context,
@ -22,13 +29,16 @@ class ImageOptions {
title: TranslationBase.of(context).gallery,
icon: Icons.image,
onTap: () async {
File _image =
File((await ImagePicker.platform.pickImage(source: ImageSource.gallery, imageQuality: 20)).path);
String fileName = _image.path;
final bytes = File(fileName).readAsBytesSync();
String base64Encode = base64.encode(bytes);
if (base64Encode != null) {
image(base64Encode,_image);
if (Platform.isAndroid) {
galleryImageAndroid(image);
} else {
File _image = File((await ImagePicker.platform.pickImage(source: ImageSource.gallery, imageQuality: 20)).path);
String fileName = _image.path;
final bytes = File(fileName).readAsBytesSync();
String base64Encode = base64.encode(bytes);
if (base64Encode != null) {
image(base64Encode, _image);
}
}
},
),
@ -36,21 +46,22 @@ class ImageOptions {
title: TranslationBase.of(context).camera,
icon: Icons.camera_alt,
onTap: () async {
File _image =
File((await ImagePicker.platform.pickImage(source: ImageSource.camera, imageQuality: 20)).path);
String fileName = _image.path;
final bytes = File(fileName).readAsBytesSync();
String base64Encode = base64.encode(bytes);
if (base64Encode != null) {
image(base64Encode,_image);
if (Platform.isAndroid) {
cameraImageAndroid(image);
} else {
File _image = File((await ImagePicker.platform.pickImage(source: ImageSource.camera, imageQuality: 20)).path);
String fileName = _image.path;
final bytes = File(fileName).readAsBytesSync();
String base64Encode = base64.encode(bytes);
if (base64Encode != null) {
image(base64Encode, _image);
}
}
},
),
_BottomSheetItem(
title: TranslationBase.of(context).cancel,
onTap: (){
},
onTap: () {},
)
],
);
@ -58,6 +69,50 @@ class ImageOptions {
}
}
galleryImageAndroid(Function(String, File) image) async {
if(await PermissionService.isExternalStorageEnabled()) {
File _image = File((await ImagePicker.platform.pickImage(source: ImageSource.gallery, imageQuality: 20)).path);
String fileName = _image.path;
final bytes = File(fileName).readAsBytesSync();
String base64Encode = base64.encode(bytes);
if (base64Encode != null) {
image(base64Encode, _image);
}
} else {
Utils.showPermissionConsentDialog(AppGlobal.context, TranslationBase.of(AppGlobal.context).galleryPermission, () async {
File _image = File((await ImagePicker.platform.pickImage(source: ImageSource.gallery, imageQuality: 20)).path);
String fileName = _image.path;
final bytes = File(fileName).readAsBytesSync();
String base64Encode = base64.encode(bytes);
if (base64Encode != null) {
image(base64Encode, _image);
}
});
}
}
cameraImageAndroid(Function(String, File) image) async {
if (await PermissionService.isCameraEnabled()) {
File _image = File((await ImagePicker.platform.pickImage(source: ImageSource.camera, imageQuality: 20)).path);
String fileName = _image.path;
final bytes = File(fileName).readAsBytesSync();
String base64Encode = base64.encode(bytes);
if (base64Encode != null) {
image(base64Encode, _image);
}
} else {
Utils.showPermissionConsentDialog(AppGlobal.context, TranslationBase.of(AppGlobal.context).cameraPermissionDialog, () async {
File _image = File((await ImagePicker.platform.pickImage(source: ImageSource.camera, imageQuality: 20)).path);
String fileName = _image.path;
final bytes = File(fileName).readAsBytesSync();
String base64Encode = base64.encode(bytes);
if (base64Encode != null) {
image(base64Encode, _image);
}
});
}
}
class _BottomSheet extends StatelessWidget {
final List<Widget> children;
@ -67,19 +122,14 @@ class _BottomSheet extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(vertical: 12.0),
decoration: BoxDecoration(
color: Theme.of(context).backgroundColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0))),
decoration: BoxDecoration(color: Theme.of(context).backgroundColor, borderRadius: BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0))),
child: SafeArea(
top: false,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
decoration: BoxDecoration(
color: Theme.of(context).dividerColor,
borderRadius: BorderRadius.circular(3.0)),
decoration: BoxDecoration(color: Theme.of(context).dividerColor, borderRadius: BorderRadius.circular(3.0)),
width: 40.0,
height: 6.0,
),
@ -97,13 +147,7 @@ class _BottomSheetItem extends StatelessWidget {
final String title;
final ITEM_COLOR color;
_BottomSheetItem(
{Key key,
this.onTap,
@required this.title,
this.icon,
this.color = ITEM_COLOR.primary})
: super(key: key);
_BottomSheetItem({Key key, this.onTap, @required this.title, this.icon, this.color = ITEM_COLOR.primary}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -121,18 +165,14 @@ class _BottomSheetItem extends StatelessWidget {
if (icon != null)
Icon(
icon,
color: color == ITEM_COLOR.error
? Theme.of(context).errorColor
: Theme.of(context).primaryColor,
color: color == ITEM_COLOR.error ? Theme.of(context).errorColor : Theme.of(context).primaryColor,
size: 18.0,
),
if (icon != null) SizedBox(width: 24.0),
Texts(
title ?? "",
style: "bodyText2",
color: color == ITEM_COLOR.error
? Theme.of(context).errorColor
: null,
color: color == ITEM_COLOR.error ? Theme.of(context).errorColor : null,
),
],
),

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -28,8 +29,8 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE paymentType;
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWeb/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWeb/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
@ -114,7 +115,6 @@ class MyInAppBrowser extends InAppBrowser {
return Future.value(NavigationActionPolicy.ALLOW);
}
getLanguageID() async {
return await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
}
@ -143,7 +143,7 @@ class MyInAppBrowser extends InAppBrowser {
openPaymentBrowser(double amount, String orderDesc, String transactionID, String projId, String emailId, String paymentMethod, dynamic patientType, String patientName, dynamic patientID,
AuthenticatedUser authenticatedUser, InAppBrowser browser, bool isLiveCareAppo, var servID, var LiveServID,
[var appoDate, var appoNo, var clinicID, var doctorID]) async {
[var appoDate, var appoNo, var clinicID, var doctorID, var installments]) async {
this.browser = browser;
await getPatientData();
if (paymentMethod == "ApplePay") {
@ -192,6 +192,13 @@ class MyInAppBrowser extends InAppBrowser {
if (context != null) GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
});
} else if (paymentMethod == "TAMARA") {
generateTamaraURL(amount, orderDesc, transactionID, projId, emailId, paymentMethod, patientType, patientName, patientID, authenticatedUser, isLiveCareAppo, servID, LiveServID, appoDate, appoNo,
clinicID, doctorID, "", installments)
.then((value) {
paymentType = _PAYMENT_TYPE.PATIENT;
this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value)), options: _InAppBrowserOptions);
});
} else {
generateURL(amount, orderDesc, transactionID, projId, emailId, paymentMethod, patientType, patientName, patientID, authenticatedUser, isLiveCareAppo, servID, LiveServID, appoDate, appoNo,
clinicID, doctorID)
@ -273,6 +280,40 @@ class MyInAppBrowser extends InAppBrowser {
return 'data:text/html;base64,' + base64Str;
}
Future<String> generateTamaraURL(double amount, String orderDesc, String transactionID, String projId, String emailId, String paymentMethod, dynamic patientType, String patientName,
dynamic patientID, AuthenticatedUser authUser, bool isLiveCareAppo, var servID, var LiveServID,
[var appoDate, var appoNo, var clinicID, var doctorID, var patientData, var installments]) async {
getDeviceToken();
String currentLanguageID = await getLanguageID() == 'ar' ? 'AR' : 'EN';
String form = getTamaraForm();
form = form.replaceFirst("EMAIL_VALUE", emailId);
form = form.replaceFirst('AMOUNT_VALUE', amount.toString());
form = form.replaceFirst('ORDER_DESCRIPTION_VALUE', orderDesc);
form = form.replaceFirst('ORDER_ID_VALUE', transactionID);
form = form.replaceFirst('REQUEST_ID_VALUE', transactionID);
form = form.replaceFirst('PROJECT_ID_VALUE', projId);
form = form.replaceFirst('PAYMENT_OPTION_VALUE', paymentMethod);
form = form.replaceFirst('LANG_VALUE', currentLanguageID);
form = form.replaceFirst('SERVICE_URL_VALUE', "https://mdlaboratories.com/tamara/Home/Checkout");
form = form.replaceFirst('INSTALLMENTS_VALUE', installments);
form = form.replaceFirst('CUSTNATIONALID_VALUE', authUser.patientIdentificationNo);
form = form.replaceFirst('CUSTMOBILE_VALUE', authUser.mobileNumber);
form = form.replaceFirst('CUSTDOB_VALUE', DateUtil.getDayMonthYearDateFormatted(authUser.dateofBirthDataTime));
form = form.replaceFirst('CURRENCY_VALUE', authUser.outSA == 0 ? "SAR" : "AED");
form = form.replaceFirst('COUNTRY_CODE_VALUE', authUser.outSA == 0 ? "966" : "971");
form = form.replaceFirst('CUSTNAME_VALUE', patientName);
form = form.replaceFirst('CUSTLASTNAME_VALUE', patientName);
form = form.replaceFirst('CUSTID_VALUE', patientID.toString());
var bytes = utf8.encode(form);
var base64Str = base64.encode(bytes);
return 'data:text/html;base64,' + base64Str;
}
Future<String> generatePharmacyURL(
OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID, AuthenticatedUser authUser) async {
String pharmacyURL = PRESCRIPTION_PAYMENT_WITH_ORDERID + order.orderGuid + '&&CustomerId=' + "${order.customerId}";
@ -288,7 +329,6 @@ class MyInAppBrowser extends InAppBrowser {
'<input type="hidden" name="ProjID" value="PROJECT_ID_VALUE">' +
'<input type="hidden" name="Order_Desc" value="ORDER_DESCRIPTION_VALUE">' +
'<input type="hidden" name="OrderID" value="ORDER_ID_VALUE">' +
// '<input type="hidden" name="reqID" value="REQUEST_ID_VALUE">' +
'<input type="hidden" name="PaymentOption" value="PAYMENT_OPTION_VALUE">' +
'<input type="hidden" name="Email" value="EMAIL_VALUE">' +
'<input type="hidden" name="ServID" value="SERV_ID" >' +
@ -311,6 +351,43 @@ class MyInAppBrowser extends InAppBrowser {
'</html>';
}
String getTamaraForm() {
return '<html> ' +
'<head></head>' +
'<body>' +
'<form id="paymentForm" action="SERVICE_URL_VALUE" method="post">' +
'<input type="hidden" name="totalAmount" value="AMOUNT_VALUE">' +
'<input type="hidden" name="shippingAmount" value="0">' +
'<input type="hidden" name="taxAmount" value="0">' +
'<input type="hidden" name="discountAmount" value="0">' +
'<input type="hidden" name="PaymentType" value="PAY_BY_INSTALMENTS">' +
'<input type="hidden" name="Instalments" value="INSTALLMENTS_VALUE">' +
'<input type="hidden" name="ProjID" value="PROJECT_ID_VALUE">' +
'<input type="hidden" name="description" value="ORDER_DESCRIPTION_VALUE">' +
'<input type="hidden" name="OrderID" value="ORDER_ID_VALUE">' +
'<input type="hidden" name="Currency" value="CURRENCY_VALUE">' +
'<input type="hidden" name="CountryCode" value="COUNTRY_CODE_VALUE">' +
'<input type="hidden" name="Consumer.Email" value="EMAIL_VALUE">' +
'<input type="hidden" name="Lang" value="LANG_VALUE" >' +
'<input type="hidden" name="ReturnURL" value="https://mdlaboratories.com">' +
'<input type="hidden" name="Consumer.NationalId" value="CUSTNATIONALID_VALUE" >' +
'<input type="hidden" name="Consumer.PhoneNumber" value="CUSTMOBILE_VALUE" >' +
'<input type="hidden" name="Consumer.FirstName" value="CUSTNAME_VALUE" >' +
'<input type="hidden" name="Consumer.LastName" value="CUSTLASTNAME_VALUE" >' +
'<input type="hidden" name="Consumer.DateOfBirth" value="CUSTDOB_VALUE" >' +
'<input type="hidden" name="Consumer.IsFirstOrder" value="false" >' +
'<input type="hidden" name="address.Line1" value="">' +
'<input type="hidden" name="address.Line2" value="">' +
'<input type="hidden" name="address.City" value="Riyadh">' +
'<input type="hidden" name="address.CountryCode" value="SA">' +
'<input type="hidden" name="address.PostalCode" value="12626">' +
'<input type="hidden" name="address.Region" value="">'
'</form>' +
'<script type="text/javascript"> document.getElementById("paymentForm").submit(); </script>' +
'</body>' +
'</html>';
}
String getLiveCareForm() {
return '<html> ' +
'<head></head>' +
@ -370,8 +447,6 @@ class MyChromeSafariBrowser extends ChromeSafariBrowser {
onLoadStartCallback("ApplePay");
}
@override
void onClosed() {
print("ChromeSafari browser closed");

@ -48,12 +48,14 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_pa
import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -188,9 +190,21 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
)
: Image.asset('assets/images/gif/robot-idle.gif'),
),
onTap: () {
new RoboSearch(context: context).showAlertDialog(context);
initSpeechState().then((value) => {startVoiceSearch()});
onTap: () async {
if (Platform.isAndroid) {
if (await PermissionService.isMicrophonePermissionEnabled()) {
new RoboSearch(context: context).showAlertDialog(context);
initSpeechState().then((value) => {startVoiceSearch()});
} else {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).recordAudioPermission, () {
new RoboSearch(context: context).showAlertDialog(context);
initSpeechState().then((value) => {startVoiceSearch()});
});
}
} else {
new RoboSearch(context: context).showAlertDialog(context);
initSpeechState().then((value) => {startVoiceSearch()});
}
},
),
Positioned(

@ -45,7 +45,7 @@ dependencies:
flutter_html: ^2.2.1
#Apple Pay
pay: ^1.0.7
pay: ^1.0.8
# Pagnation
pull_to_refresh: ^2.0.0

Loading…
Cancel
Save