From d69b3676a49da0cb89085cebc287ac4776d3516a Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Fri, 4 Dec 2020 08:50:23 +0300 Subject: [PATCH 1/2] weather indicator in progress --- .../all_habib_medical_service_page.dart | 62 +++++++++---------- pubspec.yaml | 4 +- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 88d21bf8..6c03f6ba 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -47,13 +47,13 @@ class _AllHabibMedicalServiceState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUser authUser = new AuthenticatedUser(); LocationUtils locationUtils; - var weather ='--'; + var weather = '--'; @override void initState() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { getAuthUser(); locationUtils = - new LocationUtils(isShowConfirmDialog: true, context: context); + new LocationUtils(isShowConfirmDialog: true, context: context); locationUtils.getCurrentLocation(); }); super.initState(); @@ -83,15 +83,13 @@ class _AllHabibMedicalServiceState extends State { fit: BoxFit.cover, ), borderRadius: BorderRadius.circular(8.0)), - child: Padding( padding: EdgeInsets.symmetric(horizontal: 10.0), child: Row( children: [ Expanded( - flex:3, - child: - Column( + flex: 3, + child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -102,7 +100,8 @@ class _AllHabibMedicalServiceState extends State { fontWeight: FontWeight.w600, ), Texts( - TranslationBase.of(context).healthTipsBasedOnCurrentWeather, + TranslationBase.of(context) + .healthTipsBasedOnCurrentWeather, color: Colors.white, fontSize: 14, ), @@ -110,8 +109,8 @@ class _AllHabibMedicalServiceState extends State { )), Expanded( flex: 2, - child:InkWell( - onTap: (){ + child: InkWell( + onTap: () { Navigator.push( context, FadePage( @@ -125,10 +124,15 @@ class _AllHabibMedicalServiceState extends State { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Image.asset('assets/images/Weather_ico.png',width: 60,height: 60,), - AppText(weather, fontSize: 22, color:Colors.white) - ],), - + Image.asset( + 'assets/images/Weather_ico.png', + width: 60, + height: 60, + ), + AppText(weather, + fontSize: 22, color: Colors.white) + ], + ), Texts( TranslationBase.of(context).moreDetails, color: Colors.white, @@ -147,10 +151,9 @@ class _AllHabibMedicalServiceState extends State { widget.goToMyProfile(); }, imageLocation: - 'assets/images/new-design/my_file_bottom_bar.png', + 'assets/images/new-design/my_file_bottom_bar.png', title: TranslationBase.of(context).myMedicalFile, ), - ServicesContainer( onTap: () => Navigator.push( context, @@ -161,7 +164,7 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: - 'assets/images/new-design/booking_icon_active.png', + 'assets/images/new-design/booking_icon_active.png', title: TranslationBase.of(context).bookAppo, ), ServicesContainer( @@ -172,10 +175,9 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: - 'assets/images/al-habib_online_payment_service_icon.png', + 'assets/images/al-habib_online_payment_service_icon.png', title: TranslationBase.of(context).onlinePaymentService, ), - ServicesContainer( onTap: () { Navigator.push( @@ -190,7 +192,6 @@ class _AllHabibMedicalServiceState extends State { imageLocation: 'assets/images/emergency_service_image.png', title: TranslationBase.of(context).emergencyService, ), - ServicesContainer( onTap: () => Navigator.push( context, @@ -199,10 +200,9 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: - 'assets/images/new-design/family_menu_icon_red.png', + 'assets/images/new-design/family_menu_icon_red.png', title: 'My Family', ), - ServicesContainer( onTap: () => Navigator.push( context, @@ -211,10 +211,9 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: - 'assets/images/new-design/upcoming_icon_bottom_bar.png', + 'assets/images/new-design/upcoming_icon_bottom_bar.png', title: TranslationBase.of(context).todoList, ), - ServicesContainer( onTap: () => Navigator.push( context, @@ -223,27 +222,27 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: - 'assets/images/new-design/parking_system_icon.png', + 'assets/images/new-design/parking_system_icon.png', title: TranslationBase.of(context).parking, ), ServicesContainer( onTap: () => launch( "https://hmgwebservices.com/vt_mobile/html/index.html"), imageLocation: - 'assets/images/new-design/virtual_tour_icon.png', + 'assets/images/new-design/virtual_tour_icon.png', title: 'Virtual Tour', ), ServicesContainer( onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (BuildContext context) => MyWebView( - title: "HMG News", - selectedUrl: - "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", - ))); + title: "HMG News", + selectedUrl: + "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + ))); }, imageLocation: - 'assets/images/new-design/twitter_dashboard_icon.png', + 'assets/images/new-design/twitter_dashboard_icon.png', title: 'Latest News', ), ServicesContainer( @@ -265,7 +264,6 @@ class _AllHabibMedicalServiceState extends State { } getAuthUser() async { - if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson( await this.sharedPref.getObject(USER_PROFILE)); @@ -274,7 +272,7 @@ class _AllHabibMedicalServiceState extends State { }); } var data = await this.sharedPref.getObject(WEATHER); - weather = data !=null ? data['Temperature'].toString() + '\u2103' : '--'; + weather = data != null ? data['Temperature'].toString() + '\u2103' : '--'; print(data); } } diff --git a/pubspec.yaml b/pubspec.yaml index 4f21803d..a3844b2b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -151,7 +151,9 @@ dependencies: wakelock: ^0.1.4 after_layout: ^1.0.7 twilio_programmable_video: ^0.6.3+1 - flutter_tts: ^1.2.6 + flutter_tts: + git: + url: https://github.com/dlutton/flutter_tts.git vibration: ^1.7.2 speech_to_text: path: speech_to_text From f5b7d35f23b4e0ecdbcf6713116da0a6bc3c7127 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Fri, 4 Dec 2020 16:28:14 +0300 Subject: [PATCH 2/2] bug fixes --- lib/config/config.dart | 11 +- lib/config/localized_values.dart | 407 +++++------------- lib/core/service/client/base_app_client.dart | 17 +- .../health-weather-indicator.dart | 153 ++++--- lib/pages/login/confirm-login.dart | 1 - .../authentication/auth_provider.dart | 31 +- lib/widgets/otp/sms-popup.dart | 199 ++++----- pubspec.yaml | 4 +- 8 files changed, 332 insertions(+), 491 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index b8a0efbf..4e2791b1 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -6,8 +6,7 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; const MAX_SMALL_SCREEN = 660; - - // const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; @@ -18,8 +17,10 @@ const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; -const GET_DOCTOR_RATING_NOTES = 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; -const GET_DOCTOR_RATING_DETAILS = 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; +const GET_DOCTOR_RATING_NOTES = + 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; +const GET_DOCTOR_RATING_DETAILS = + 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; ///Prescriptions @@ -253,7 +254,7 @@ const PATIENT_TYPE = 1; const PATIENT_TYPE_ID = 1; var DEVICE_TOKEN = ""; var DeviceTypeID = Platform.isIOS ? 1 : 2; -const LANGUAGE_ID = 2; +const LANGUAGE_ID = 1; const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region"; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; const GET_PAtIENTS_INSURANCE = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index cc0e0566..e6be280b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -111,10 +111,7 @@ const Map localizedValues = { 'login': {'en': 'Login', 'ar': 'تسجيل الدخول'}, 'loginregister': {'en': 'Login / Register', 'ar': 'تسجيل الدخول'}, 'poweredBy': {'en': 'Powered By', 'ar': 'مشغل بواسطة'}, - "welcome": { - "en": "Welcome", - "ar": "مرحبا" - }, + "welcome": {"en": "Welcome", "ar": "مرحبا"}, "welcome_text": { "en": "Dr. Sulaiman Al Habib Mobile Application", "ar": "الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك" @@ -130,12 +127,11 @@ const Map localizedValues = { "ar": "اختر من الخيارات أدناه لتسجيل الدخول إلى ملفك الطبي." }, "registernow": {"en": "Register Now", "ar": "تسجيل الان"}, - "nationalID": { "en": "Enter the Identification Number", - "ar": "أدخل رقم الهوية الوطنية او الاقامة"}, - "national-id": { - "en": "National ID", - "ar": "رقم الهوية" + "nationalID": { + "en": "Enter the Identification Number", + "ar": "أدخل رقم الهوية الوطنية او الاقامة" }, + "national-id": {"en": "National ID", "ar": "رقم الهوية"}, "fileNo": {"en": "File Number", "ar": "رقم الملف"}, "fileno": {"en": "File No", "ar": "رقم الملف"}, "forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"}, @@ -191,8 +187,8 @@ const Map localizedValues = { 'ar': 'الرجائ ادخال اسم الدواء' }, "verification_message": { - "en": "Please enter verification code", - "ar": "الرجاء إدخال رمز التحقق" + "en": "Please enter the Verification Code sent to", + "ar": "الرجاء ادخال رمز التحقق الذي تم إرساله إلى" }, "validation_message": { "en": "The verification code expires in", @@ -876,8 +872,14 @@ const Map localizedValues = { "LiveChat": {"en": "Live Chat", "ar": "محادثة مباشرة"}, "Service": {"en": "Service", "ar": "خدمة"}, "HMGServiceLabel": {"en": "HMG Service", 'ar': 'خدمات الحبيب'}, - "HealthWeatherIndicators": {"en": "Health Weather Indicators", 'ar': ' مؤشرات الطقس الصحية '}, - "HealthTipsBasedOnCurrentWeather": {"en": "Health Tips Based On Current Weather", 'ar': ' نصائح صحية على أساس الطقس الحالي '}, + "HealthWeatherIndicators": { + "en": "Health Weather Indicators", + 'ar': ' مؤشرات الطقس الصحية ' + }, + "HealthTipsBasedOnCurrentWeather": { + "en": "Health Tips Based On Current Weather", + 'ar': ' نصائح صحية على أساس الطقس الحالي ' + }, "MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "}, "SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"}, "ResendOrder": {"en": "Resend order & deliver", "ar": "إعادة طلب و توصيل"}, @@ -886,338 +888,161 @@ const Map localizedValues = { "Average": {"en": "Average", "ar": "المعدل"}, "DailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, "Period": {"en": "Period", "ar": "الفترة"}, - "cm": { - "en": "CM", - "ar": "سم" - }, - "kg": { - "en": "kg", - "ar": "كجم" - }, - "mass": { - "en": "Mass", - "ar": "كتلة" - }, - "temp-c": { - "en": "°C", - "ar": "°س" - }, - "bpm": { - "en": "bpm", - "ar": "نبضة" - }, - "respiration-signs": { - "en": "Respiration", - "ar": "تنفس" - }, - "sys-dias": { - "en": "SBP/DBP", - "ar": "إنقباض/إنبساط" - }, - "body": { - "en": "Body \n Mass", - "ar": "كتلة\nالجسم" - }, - "feedback": { - "en": "Feedback", - "ar": "رأيك يهمنا" - }, - "send": { - "en": "Send", - "ar": "أرسل" - }, - "status": { - "en": "Status", - "ar": "الحالة" - }, + "cm": {"en": "CM", "ar": "سم"}, + "kg": {"en": "kg", "ar": "كجم"}, + "mass": {"en": "Mass", "ar": "كتلة"}, + "temp-c": {"en": "°C", "ar": "°س"}, + "bpm": {"en": "bpm", "ar": "نبضة"}, + "respiration-signs": {"en": "Respiration", "ar": "تنفس"}, + "sys-dias": {"en": "SBP/DBP", "ar": "إنقباض/إنبساط"}, + "body": {"en": "Body \n Mass", "ar": "كتلة\nالجسم"}, + "feedback": {"en": "Feedback", "ar": "رأيك يهمنا"}, + "send": {"en": "Send", "ar": "أرسل"}, + "status": {"en": "Status", "ar": "الحالة"}, "like-to-hear": { - "en": "We would love to hear the feedback, concerns on healthcare services and eServices experience. Please use the below form", - "ar": "يسعدنا سماع ملاحظاتك حول خدمات الرعاية الصحية والخدمات الإلكترونية. يرجى تعبئة الحقول المطلوبة" - }, - "subject": { - "en": "Subject", - "ar": "الموضوع" - }, - "message": { - "en": "Message", - "ar": "رسالة" + "en": + "We would love to hear the feedback, concerns on healthcare services and eServices experience. Please use the below form", + "ar": + "يسعدنا سماع ملاحظاتك حول خدمات الرعاية الصحية والخدمات الإلكترونية. يرجى تعبئة الحقول المطلوبة" }, + "subject": {"en": "Subject", "ar": "الموضوع"}, + "message": {"en": "Message", "ar": "رسالة"}, "empty-subject": { "en": "Please enter the subject", "ar": "يرجى ادخال الموضوع" }, - "empty-message": { - "en": "Please enter message", - "ar": "يرجى ادخال الموضوع" - }, - "select-attachment": { - "en": "Select Attachment", - "ar": "إختر المرفق" - }, - "complain-appo": { - "en": "Complaint for appointment", - "ar": "شكوى على موعد" - }, + "empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الموضوع"}, + "select-attachment": {"en": "Select Attachment", "ar": "إختر المرفق"}, + "complain-appo": {"en": "Complaint for appointment", "ar": "شكوى على موعد"}, "complain-without-appo": { "en": "Complaint without appointment", "ar": "شكوى بدون موعد" }, - "question": { - "en": "Question", - "ar": "سؤال" - }, - "message-type": { - "en": "Message Type", - "ar": "نوع الرسالة" - }, - "compliment": { - "en": "compliment", - "ar": "ثناء" - }, - "suggestion": { - "en": "Suggestion", - "ar": "إقتراح" - }, - "your-feedback": { - "en": "Your feedback was sent", - "ar": "إقتراح" - }, + "question": {"en": "Question", "ar": "سؤال"}, + "message-type": {"en": "Message Type", "ar": "نوع الرسالة"}, + "compliment": {"en": "compliment", "ar": "ثناء"}, + "suggestion": {"en": "Suggestion", "ar": "إقتراح"}, + "your-feedback": {"en": "Your feedback was sent", "ar": "إقتراح"}, "select-part": { "en": "Please select the part that complain about", "ar": "يرجى تحديد الجزء الذي تشكو منه" }, - "number": { - "en": "Number", - "ar": "الرقم" - }, - "not-classified": { - "en": "Not classified", - "ar": "غير محدد" - }, + "number": {"en": "Number", "ar": "الرقم"}, + "not-classified": {"en": "Not classified", "ar": "غير محدد"}, "selectClinic": {"en": "Select Clinic", "ar": " بحث بالعيادة"}, "reviews": {"en": "Reviews", "ar": "تقييمات"}, - "searchItemError": {"en": "Item name should be more than 3 character ", "ar": "يجب أن يكون اسم العنصر أكثر من 3 أحرف"}, + "searchItemError": { + "en": "Item name should be more than 3 character ", + "ar": "يجب أن يكون اسم العنصر أكثر من 3 أحرف" + }, "YouCanFind": {"en": "You Can Find ", "ar": "باستطاعتك العثور على "}, "ItemInSearch": {"en": " Item In Search", "ar": " عنصر في البحث "}, "InvoiceNo": {"en": " Invoice No", "ar": "رقم الفاتورة"}, "SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"}, "GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"}, - "show-more-btn": { - "en": "Flow Chart", - "ar": "النتائج التراكمية" - }, + "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, - "value": { - "en": "Value", - "ar": "القيمة" - }, - "range": { - "en": "Range", - "ar": "المدى" - }, - "out-patient": { - "en": "Out Patient", - "ar": "عيادات خارجية" - }, - "in-patient": { - "en": "In Patient", - "ar": "تنويم" - }, - "report": { - "en": "Radiology Report", - "ar": "تقرير الاشعة" - }, - "open-rad": { - "en": "Open Image", - "ar": "فتح صور الاشعة" - }, - "send-copy": { - "en": "Email the Report", - "ar": "أرسل التقرير" - }, - "appoSurvey": { - "en": "Survey", - "ar": "إستبيان" - }, - "appoSurveySubtitle": { - "en": "Survey", - "ar": "إستبيان" - }, - "labResults": { - "en": "Lab Result", - "ar": "نتيجة المختبر" - }, - "doctorRating": { - "en": "Doctor Rating", - "ar": "تقييم الطبيب" - }, - "good": { - "en": "Good", - "ar": "جيد" - }, - "v-good": { - "en": "Very Good", - "ar": "جيد جدا" - }, - "excellent": { - "en": "Excellent", - "ar": "ممتاز" - }, - "average": { - "en": "Average", - "ar": "متوسط" - }, - "below-average": { - "en": "Below Average", - "ar": "أقل من المتوسط" - }, + "value": {"en": "Value", "ar": "القيمة"}, + "range": {"en": "Range", "ar": "المدى"}, + "out-patient": {"en": "Out Patient", "ar": "عيادات خارجية"}, + "in-patient": {"en": "In Patient", "ar": "تنويم"}, + "report": {"en": "Radiology Report", "ar": "تقرير الاشعة"}, + "open-rad": {"en": "Open Image", "ar": "فتح صور الاشعة"}, + "send-copy": {"en": "Email the Report", "ar": "أرسل التقرير"}, + "appoSurvey": {"en": "Survey", "ar": "إستبيان"}, + "appoSurveySubtitle": {"en": "Survey", "ar": "إستبيان"}, + "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, + "doctorRating": {"en": "Doctor Rating", "ar": "تقييم الطبيب"}, + "good": {"en": "Good", "ar": "جيد"}, + "v-good": {"en": "Very Good", "ar": "جيد جدا"}, + "excellent": {"en": "Excellent", "ar": "ممتاز"}, + "average": {"en": "Average", "ar": "متوسط"}, + "below-average": {"en": "Below Average", "ar": "أقل من المتوسط"}, "info-signs": { - "en": "This service allows you to view all vital signs were performed in the Habib Medical Group, e.x (height, weight, body mass index, heart rate, etc.) as well shows some statistics charts.", - "ar": "خدمة المؤشرات الحيوية: هذه الخدمة تمكنك من الاطلاع على جميع المؤشرات الحيوية على سبيل المثال (الطول، الوزن، مؤشر كتلة الجسم، معدل نبضات القلب الخ..) التي تمت في مجموعة الحبيب الطبية وكذلك رسوم بيانية على مستوى المؤشر." + "en": + "This service allows you to view all vital signs were performed in the Habib Medical Group, e.x (height, weight, body mass index, heart rate, etc.) as well shows some statistics charts.", + "ar": + "خدمة المؤشرات الحيوية: هذه الخدمة تمكنك من الاطلاع على جميع المؤشرات الحيوية على سبيل المثال (الطول، الوزن، مؤشر كتلة الجسم، معدل نبضات القلب الخ..) التي تمت في مجموعة الحبيب الطبية وكذلك رسوم بيانية على مستوى المؤشر." }, "info-advance-payment": { - "en": "This service designed so that you can deposit an amount in advance either in your account or in someone else's account with Al Habib Medical Group.", - "ar": "تم تصميم هذه الخدمة حتى تتمكن من دفع مبلغ مقدما او تحت الحساب سواء في حسابك او في حساب شخص اخر لدى مجموعة الحبيب الطبية." + "en": + "This service designed so that you can deposit an amount in advance either in your account or in someone else's account with Al Habib Medical Group.", + "ar": + "تم تصميم هذه الخدمة حتى تتمكن من دفع مبلغ مقدما او تحت الحساب سواء في حسابك او في حساب شخص اخر لدى مجموعة الحبيب الطبية." }, "info-my-balance": { "en": "This service allows you to check your balance in all branchs", "ar": "هذه الخدمه تتيح لك الاطلاع رصيدك في كل الفروع" }, "er-contant": { - "en": "This service displays nearest branch among all the branches of Al Habib Medical Group based on your current location.", - "ar": "تعرض هذه الخدمة أقرب فرع من بين جميع فروع مجموعة الحبيب الطبية بناءً على موقعك الحالي." - }, - "er": { - "en": "ER", - "ar": "الطوارىء" - }, - "transportation-Service": { - "en": "Ambulance Request", - "ar": "طلب نقل اسعاف" + "en": + "This service displays nearest branch among all the branches of Al Habib Medical Group based on your current location.", + "ar": + "تعرض هذه الخدمة أقرب فرع من بين جميع فروع مجموعة الحبيب الطبية بناءً على موقعك الحالي." }, + "er": {"en": "ER", "ar": "الطوارىء"}, + "transportation-Service": {"en": "Ambulance Request", "ar": "طلب نقل اسعاف"}, "info-ambulance": { - "en": "Through this service, you can request evacuation by ambulance, whether from home or to home, in addition to a set of other services", - "ar": "عن طريق هذه الخدمة يمكنك طلب اخلاء بواسطة سيارة اسعاف سواء من المزل او الى المنزل بالاضافة الى مجموعة من الخدمات الاخرى" + "en": + "Through this service, you can request evacuation by ambulance, whether from home or to home, in addition to a set of other services", + "ar": + "عن طريق هذه الخدمة يمكنك طلب اخلاء بواسطة سيارة اسعاف سواء من المزل او الى المنزل بالاضافة الى مجموعة من الخدمات الاخرى" }, "RRT-transport-heading": { "en": "Select Transportation Method", "ar": "حدد طريقة النقل" }, - "sar": { - "en": "SR", - "ar": "ر.س" - }, - "RRT-direction-heading": { - "en": "Select Direction", - "ar": "حدد الاتجاه" - }, - "to-hospital": { - "en": "To Hospital", - "ar": "الى المستشفى" - }, - "from-hospital": { - "en": "From Hospital", - "ar": "من المستشفى" - }, - "one-direc": { - "en": "One Way", - "ar": "ذهاب" - }, - "two-direc": { - "en": "Two Ways", - "ar": "ذهاب وعودة" - }, - "pickup-location": { - "en": "Pickup Location", - "ar": "نقطة الانطلاق" - }, - "pickup-spot": { - "en": "Pickup Spot", - "ar": "نقطة اللقاء" - }, - "inside-home": { - "en": "Inside Home", - "ar": "داخل المنزل" - }, - "have-appo": { - "en": "Do you have an appointment?", - "ar": "هل لديك موعد؟" - }, - "dropoff-location": { - "en": "Dropoff Location", - "ar": "نقطة الوصول" - }, + "sar": {"en": "SR", "ar": "ر.س"}, + "RRT-direction-heading": {"en": "Select Direction", "ar": "حدد الاتجاه"}, + "to-hospital": {"en": "To Hospital", "ar": "الى المستشفى"}, + "from-hospital": {"en": "From Hospital", "ar": "من المستشفى"}, + "one-direc": {"en": "One Way", "ar": "ذهاب"}, + "two-direc": {"en": "Two Ways", "ar": "ذهاب وعودة"}, + "pickup-location": {"en": "Pickup Location", "ar": "نقطة الانطلاق"}, + "pickup-spot": {"en": "Pickup Spot", "ar": "نقطة اللقاء"}, + "inside-home": {"en": "Inside Home", "ar": "داخل المنزل"}, + "have-appo": {"en": "Do you have an appointment?", "ar": "هل لديك موعد؟"}, + "dropoff-location": {"en": "Dropoff Location", "ar": "نقطة الوصول"}, "select-all": { "en": "Please select all fields", "ar": "يرجى تحديد جميع الحقول" }, - "select-map": { - "en": "Select From Map", - "ar": "حدد من الخريطة" - }, + "select-map": {"en": "Select From Map", "ar": "حدد من الخريطة"}, "no-appointment": { "en": "You don't have any appointments yet", "ar": "ليس لديك أي مواعيد حتى الآن" }, - "patient-share": { - "en": "Amount before tax: ", - "ar": "المبلغ قبل الضريبة:" - }, - "patient-share-tax": { - "en": "Tax amount: ", - "ar": "قيمة الضريبة:" - }, + "patient-share": {"en": "Amount before tax: ", "ar": "المبلغ قبل الضريبة:"}, + "patient-share-tax": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"}, "patient-share-total": { "en": "Total amount payable: ", "ar": "المبلغ الإجمالي المستحق:" }, - "select-ambulate": { - "en": "Select Ambulate", - "ar": "بحاجة للتنقل بواسطة" - }, - "wheelchair": { - "en": "Wheelchair", - "ar": "كرسي متحرك" - }, - "walker": { - "en": "Walker", - "ar": "مشاية" - }, - "stretcher": { - "en": "Stretcher", - "ar": "نقالة" - }, - "none": { - "en": "None", - "ar": "لا شيء" - }, - "RRT-Summary": { - "en": "Summary", - "ar": "ملخص الطلب" - }, - "bill-amount": { - "en": "Bill Amount", - "ar": "مبلغ الفاتورة" - }, - "transport-method": { - "en": "Transportation Method", - "ar": "طريقة النقل" - }, - "directions": { - "en": "Directions", - "ar": "الاتجاهات" - }, + "select-ambulate": {"en": "Select Ambulate", "ar": "بحاجة للتنقل بواسطة"}, + "wheelchair": {"en": "Wheelchair", "ar": "كرسي متحرك"}, + "walker": {"en": "Walker", "ar": "مشاية"}, + "stretcher": {"en": "Stretcher", "ar": "نقالة"}, + "none": {"en": "None", "ar": "لا شيء"}, + "RRT-Summary": {"en": "Summary", "ar": "ملخص الطلب"}, + "bill-amount": {"en": "Bill Amount", "ar": "مبلغ الفاتورة"}, + "transport-method": {"en": "Transportation Method", "ar": "طريقة النقل"}, + "directions": {"en": "Directions", "ar": "الاتجاهات"}, "info-my-appointments": { - "en": "This service allows you to see all the appointment you have visited in Al Habib Medical Group, and through this service:", - "ar": "خدمة مواعيدي: هذه الخدمة تمكنك من الاطلاع على جميع المواعيد التي قمت بزيارتهم في مجموعة الحبيب الطبية, كما تستطيع من خلال هذه الخدمة:" + "en": + "This service allows you to see all the appointment you have visited in Al Habib Medical Group, and through this service:", + "ar": + "خدمة مواعيدي: هذه الخدمة تمكنك من الاطلاع على جميع المواعيد التي قمت بزيارتهم في مجموعة الحبيب الطبية, كما تستطيع من خلال هذه الخدمة:" }, "info-todo": { - "en": "This service is designed to enable you to have a quick link to the list of tasks that need to be done", - "ar": "هذه الخدمة تم تصميمها لتمكنك من الوصول الى رابط سريع لقائمة المهام التي يجب القيام بها" + "en": + "This service is designed to enable you to have a quick link to the list of tasks that need to be done", + "ar": + "هذه الخدمة تم تصميمها لتمكنك من الوصول الى رابط سريع لقائمة المهام التي يجب القيام بها" }, "family-info": { - "en": "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", - "ar": "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." + "en": + "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", + "ar": + "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." } - }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index e288ccb3..0e940a53 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -36,8 +36,7 @@ class BaseAppClient { try { //Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); - var languageID = - await sharedPref.getString(APP_LANGUAGE); + var languageID = await sharedPref.getString(APP_LANGUAGE) ?? 'ar'; var user = await sharedPref.getObject(USER_PROFILE); if (body.containsKey('SetupID')) { body['SetupID'] = body.containsKey('SetupID') @@ -89,7 +88,7 @@ class BaseAppClient { body['PatientTypeID'] = body.containsKey('PatientTypeID') ? body['PatientTypeID'] != null ? body['PatientTypeID'] - :user['PatientType'] != null + : user['PatientType'] != null ? user['PatientType'] : PATIENT_TYPE_ID : PATIENT_TYPE_ID; @@ -140,7 +139,7 @@ class BaseAppClient { parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); } else if (!parsed['IsAuthenticated']) { - // await logout(); + // await logout(); //helpers.showErrorToast('Your session expired Please login agian'); } else { @@ -159,16 +158,18 @@ class BaseAppClient { } } catch (e) { print(e); - onFailure(e.toString(), -1); + onFailure('Failed to connect to the server', -1); + // onFailure(e.toString(), -1); } } logout() async { await sharedPref.remove(LOGIN_TOKEN_ID); await authenticatedUserObject.getUser(); - Provider.of(AppGlobal.context, listen: false).isLogin = false; - _vitalSignService.weightKg =""; - _vitalSignService.heightCm=""; + Provider.of(AppGlobal.context, listen: false).isLogin = + false; + _vitalSignService.weightKg = ""; + _vitalSignService.heightCm = ""; Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); } diff --git a/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart index 95cbdde7..343c6e3e 100644 --- a/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart +++ b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart @@ -11,116 +11,127 @@ import 'package:diplomaticquarterapp/widgets/weather_slider/weather_slider.dart' import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; class HealthWeatherIndicator extends StatefulWidget { @override _HospitalsPageState createState() => _HospitalsPageState(); } - class _HospitalsPageState extends State { var data; LocationUtils locationUtils; AppSharedPreferences sharedPref = AppSharedPreferences(); var weather = '--'; - @override + @override void initState() { locationUtils = - new LocationUtils(isShowConfirmDialog: true, context: context); + new LocationUtils(isShowConfirmDialog: true, context: context); WidgetsBinding.instance .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); getWeather(); super.initState(); } + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getWeatherData(), - allowAny:true, + allowAny: true, builder: (_, mode, widget) => AppScaffold( isShowDecPage: false, appBarTitle: TranslationBase.of(context).healthWeatherIndicators, isShowAppBar: true, - body: mode.weatherIndicatorData.length>0 ? SingleChildScrollView( - child: Column(children: [ - - Container( - margin: EdgeInsets.all(8), - width: double.infinity, - height: 150, - decoration: BoxDecoration( - image: DecorationImage( - image: ExactAssetImage('assets/images/Weather_img.png'), - fit: BoxFit.cover, - ), - borderRadius: BorderRadius.circular(8.0)), - - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.0), - child: Row( - children: [ - Expanded( - flex:3, - child: - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .healthWeatherIndicators, - color: Colors.white, - fontWeight: FontWeight.w600, - ), - AppText( - TranslationBase.of(context).healthTipsBasedOnCurrentWeather, - color: Colors.white, - fontSize: 14, - ), - ], - )), - Expanded( - flex: 2, - child:InkWell( - onTap: (){ - - }, + body: mode.weatherIndicatorData.length > 0 + ? SingleChildScrollView( + child: Column(children: [ + Container( + margin: EdgeInsets.all(8), + width: double.infinity, + height: 150, + decoration: BoxDecoration( + image: DecorationImage( + image: + ExactAssetImage('assets/images/Weather_img.png'), + fit: BoxFit.cover, + ), + borderRadius: BorderRadius.circular(8.0)), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 10.0), + child: Row( + children: [ + Expanded( + flex: 3, child: Column( mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset('assets/images/Weather_ico.png',width: 60,height: 60,), - AppText(weather, fontSize: 22, color:Colors.white) - ],), + AppText( + TranslationBase.of(context) + .healthWeatherIndicators, + color: Colors.white, + fontWeight: FontWeight.w600, + ), + AppText( + TranslationBase.of(context) + .healthTipsBasedOnCurrentWeather, + color: Colors.white, + fontSize: 14, + ), ], )), - ) - ], + Expanded( + flex: 2, + child: InkWell( + onTap: () {}, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/Weather_ico.png', + width: 60, + height: 60, + ), + AppText(weather, + fontSize: 22, color: Colors.white) + ], + ), + ], + )), + ) + ], + ), ), ), - ), - Padding(padding: EdgeInsets.all(15), child:AppText( projectViewModel.isArabic ? mode.weatherIndicatorData[0].cityNameN : mode.weatherIndicatorData[0].cityName, fontSize: 24, fontWeight: FontWeight.bold,)), - - Padding( - padding: EdgeInsets.all(15), - child: Column(children: - mode.weatherIndicatorData - .map((data) { - return WeatherSlider( - data); - }).toList() - - ))])) : Container()), + Padding( + padding: EdgeInsets.all(15), + child: AppText( + projectViewModel.isArabic + ? mode.weatherIndicatorData[0].cityNameN + : mode.weatherIndicatorData[0].cityName, + fontSize: 24, + fontWeight: FontWeight.bold, + )), + Padding( + padding: EdgeInsets.all(15), + child: Column( + children: mode.weatherIndicatorData.map((data) { + return WeatherSlider(data); + }).toList())) + ])) + : Center(child: AppCircularProgressIndicator())), ); } - getWeather() async{ + + getWeather() async { var data = await this.sharedPref.getObject(WEATHER); setState(() { weather = data['Temperature'].toString() + '\u2103' ?? '--'; }); - } } diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index c200fecf..f97c1c42 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -552,7 +552,6 @@ class _ConfirmLogin extends State { } checkIfUserAgreedBefore(CheckActivationCode result) { - print(result); if (result.isNeedUserAgreement == true) { //move to agreement page. } else { diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 4dedb37f..59f51bfc 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -50,6 +50,7 @@ const FORGOT_PATIENT_ID = const DASHBOARD = 'Services/Patients.svc/REST/PatientDashboard'; const PROFILE_SETTING = 'Services/Patients.svc/REST/GetPateintInfoForUpdate'; const SAVE_SETTING = 'Services/Patients.svc/REST/UpdatePateintInfo'; + class AuthProvider with ChangeNotifier { bool isLogin = false; bool isLoading = true; @@ -232,7 +233,7 @@ class AuthProvider with ChangeNotifier { neRequest.channel = CHANNEL; neRequest.iPAdress = IP_ADDRESS; neRequest.generalid = GENERAL_ID; - neRequest.languageID = LANGUAGE_ID; + // neRequest.languageID = LANGUAGE_ID; neRequest.deviceTypeID = DeviceTypeID; neRequest.patientOutSA = neRequest.zipCode == '966' ? 0 : 1; neRequest.projectOutSA = neRequest.zipCode == '966' ? false : true; @@ -458,36 +459,36 @@ class AuthProvider with ChangeNotifier { //return Future.value(error); } } - getSettings() async{ + getSettings() async { dynamic localRes; try { await new BaseAppClient().post(PROFILE_SETTING, onSuccess: (dynamic response, int statusCode) { - localRes = response; //CheckActivationCode.fromJson(); - }, onFailure: (String error, int statusCode) { - localRes = error; - return Future.value(error); - // throw error; - }, body: {}); + localRes = response; //CheckActivationCode.fromJson(); + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + // throw error; + }, body: {}); return Future.value(localRes); } catch (error) { throw error; //return Future.value(error); } } - Future saveSettings(request) async{ + Future saveSettings(request) async { dynamic localRes; try { await new BaseAppClient().post(SAVE_SETTING, onSuccess: (dynamic response, int statusCode) { - localRes = response; //CheckActivationCode.fromJson(); - }, onFailure: (String error, int statusCode) { - localRes = error; - return Future.value(error); - // throw error; - }, body: request); + localRes = response; //CheckActivationCode.fromJson(); + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + // throw error; + }, body: request); return Future.value(localRes); } catch (error) { throw error; diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index 39e41a93..02282c7b 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -54,7 +54,6 @@ class SMSOTP { String displayTime = ''; displayDialog(BuildContext context) async { - return showDialog( context: context, builder: (context) { @@ -80,7 +79,8 @@ class SMSOTP { height: SizeConfig.realScreenHeight * 0.5, width: SizeConfig.realScreenWidth * 0.8, child: Center( - child: Column( + child: SingleChildScrollView( + child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ type == 1 @@ -101,114 +101,117 @@ class SMSOTP { child: Padding( padding: EdgeInsets.only(top: 20), child: Directionality( - textDirection:TextDirection.ltr, - child:Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - width: SizeConfig.realScreenWidth * 0.15, - child: TextFormField( - textInputAction: TextInputAction.next, - style: buildTextStyle(), - autofocus: true, - maxLength: 1, - controller: digit1, - textAlign: TextAlign.center, - keyboardType: TextInputType.number, - decoration: buildInputDecoration(context), - onSaved: (val) {}, - validator: validateCodeDigit, - onFieldSubmitted: (_) { - FocusScope.of(context).requestFocus(focusD2); - }, - onChanged: (val) { - if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD2); - verifyAccountFormValue['digit1'] = - val.trim(); - checkValue(); - } - }, - ), - ), - Container( - width: SizeConfig.realScreenWidth * 0.15, - child: TextFormField( - focusNode: focusD2, - textInputAction: TextInputAction.next, - maxLength: 1, - controller: digit2, - textAlign: TextAlign.center, - style: buildTextStyle(), - keyboardType: TextInputType.number, - decoration: buildInputDecoration(context), - onSaved: (val) {}, - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD3); - }, - onChanged: (val) { - if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD3); - verifyAccountFormValue['digit2'] = - val.trim(); - checkValue(); - } - }, - validator: validateCodeDigit), - ), - Container( - width: SizeConfig.realScreenWidth * 0.15, - child: TextFormField( - focusNode: focusD3, + textDirection: TextDirection.ltr, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( + width: SizeConfig.realScreenWidth * 0.15, + child: TextFormField( textInputAction: TextInputAction.next, + style: buildTextStyle(), + autofocus: true, maxLength: 1, - controller: digit3, + controller: digit1, textAlign: TextAlign.center, - style: buildTextStyle(), keyboardType: TextInputType.number, decoration: buildInputDecoration(context), onSaved: (val) {}, + validator: validateCodeDigit, onFieldSubmitted: (_) { FocusScope.of(context) - .requestFocus(focusD4); + .requestFocus(focusD2); }, onChanged: (val) { if (val.length == 1) { FocusScope.of(context) - .requestFocus(focusD4); - verifyAccountFormValue['digit3'] = + .requestFocus(focusD2); + verifyAccountFormValue['digit1'] = val.trim(); checkValue(); } }, - validator: validateCodeDigit)), - Container( - width: SizeConfig.realScreenWidth * 0.15, - child: TextFormField( - focusNode: focusD4, - maxLength: 1, - textAlign: TextAlign.center, - style: buildTextStyle(), - controller: digit4, - keyboardType: TextInputType.number, - decoration: buildInputDecoration(context), - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD4); - }, - onChanged: (val) { - if (val.length == 1) { - verifyAccountFormValue['digit4'] = - val.trim(); - checkValue(); - } - }, - validator: validateCodeDigit)), - ], - )), + ), + ), + Container( + width: SizeConfig.realScreenWidth * 0.15, + child: TextFormField( + focusNode: focusD2, + textInputAction: TextInputAction.next, + maxLength: 1, + controller: digit2, + textAlign: TextAlign.center, + style: buildTextStyle(), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + onSaved: (val) {}, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD3); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD3); + verifyAccountFormValue['digit2'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit), + ), + Container( + width: SizeConfig.realScreenWidth * 0.15, + child: TextFormField( + focusNode: focusD3, + textInputAction: TextInputAction.next, + maxLength: 1, + controller: digit3, + textAlign: TextAlign.center, + style: buildTextStyle(), + keyboardType: TextInputType.number, + decoration: + buildInputDecoration(context), + onSaved: (val) {}, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + verifyAccountFormValue['digit3'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit)), + Container( + width: SizeConfig.realScreenWidth * 0.15, + child: TextFormField( + focusNode: focusD4, + maxLength: 1, + textAlign: TextAlign.center, + style: buildTextStyle(), + controller: digit4, + keyboardType: TextInputType.number, + decoration: + buildInputDecoration(context), + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + verifyAccountFormValue['digit4'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit)), + ], + )), ), ), Padding( @@ -221,7 +224,7 @@ class SMSOTP { textAlign: TextAlign.center, )) ], - )), + ))), ); }), ); @@ -270,9 +273,11 @@ class SMSOTP { checkValue() { //print(verifyAccountFormValue); if (verifyAccountForm.currentState.validate()) { - onSuccess(digit1.text.toString()+digit2.text.toString()+digit3.text.toString()+digit4.text.toString()); + onSuccess(digit1.text.toString() + + digit2.text.toString() + + digit3.text.toString() + + digit4.text.toString()); } - } getSecondsAsDigitalClock(int inputSeconds) { diff --git a/pubspec.yaml b/pubspec.yaml index a3844b2b..5bd52d75 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -151,9 +151,7 @@ dependencies: wakelock: ^0.1.4 after_layout: ^1.0.7 twilio_programmable_video: ^0.6.3+1 - flutter_tts: - git: - url: https://github.com/dlutton/flutter_tts.git + flutter_tts: any vibration: ^1.7.2 speech_to_text: path: speech_to_text