diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt index 35ce314d..b8a87c8c 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt @@ -1,36 +1,11 @@ package com.cloud.diplomaticquarterapp -import android.content.ContentResolver -import android.content.Context -import android.media.RingtoneManager -import io.flutter.embedding.android.FlutterActivity -import io.flutter.embedding.engine.FlutterEngine -import io.flutter.plugin.common.MethodCall -import io.flutter.plugin.common.MethodChannel -import io.flutter.plugins.GeneratedPluginRegistrant +import androidx.annotation.NonNull; + import io.flutter.embedding.android.FlutterFragmentActivity + import io.flutter.embedding.engine.FlutterEngine + import io.flutter.plugins.GeneratedPluginRegistrant -class MainActivity : FlutterActivity() { - override fun configureFlutterEngine(flutterEngine: FlutterEngine) { - GeneratedPluginRegistrant.registerWith(flutterEngine) - MethodChannel(flutterEngine.dartExecutor, "crossingthestreams.io/resourceResolver").setMethodCallHandler { call: MethodCall, result: MethodChannel.Result -> - if ("drawableToUri" == call.method) { - val resourceId = this@MainActivity.resources.getIdentifier(call.arguments as String, "drawable", this@MainActivity.packageName) - result.success(resourceToUriString(this@MainActivity.applicationContext, resourceId)) - } - if ("getAlarmUri" == call.method) { - result.success(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM).toString()) - } - } - } - - companion object { - private fun resourceToUriString(context: Context, resId: Int): String { - return (ContentResolver.SCHEME_ANDROID_RESOURCE - + "://" - + context.resources.getResourcePackageName(resId) - + "/" - + context.resources.getResourceTypeName(resId) - + "/" - + context.resources.getResourceEntryName(resId)) - } - } +class MainActivity: FlutterFragmentActivity() { + override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { + GeneratedPluginRegistrant.registerWith(flutterEngine); + } } \ No newline at end of file diff --git a/assets/fonts/ar/Cairo-Bold/Cairo-Bold.eot b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.eot new file mode 100644 index 00000000..ed5f0c34 Binary files /dev/null and b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.eot differ diff --git a/assets/fonts/ar/Cairo-Bold/Cairo-Bold.otf b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.otf new file mode 100644 index 00000000..8bc25fbb Binary files /dev/null and b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.otf differ diff --git a/assets/fonts/ar/Cairo-Bold/Cairo-Bold.ttf b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.ttf new file mode 100644 index 00000000..4f026897 Binary files /dev/null and b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.ttf differ diff --git a/assets/fonts/ar/Cairo-Bold/Cairo-Bold.woff b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.woff new file mode 100644 index 00000000..91e3d063 Binary files /dev/null and b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.woff differ diff --git a/assets/fonts/ar/Cairo-Light/Cairo-Light.eot b/assets/fonts/ar/Cairo-Light/Cairo-Light.eot new file mode 100644 index 00000000..d76c5391 Binary files /dev/null and b/assets/fonts/ar/Cairo-Light/Cairo-Light.eot differ diff --git a/assets/fonts/ar/Cairo-Light/Cairo-Light.otf b/assets/fonts/ar/Cairo-Light/Cairo-Light.otf new file mode 100644 index 00000000..f8812a9c Binary files /dev/null and b/assets/fonts/ar/Cairo-Light/Cairo-Light.otf differ diff --git a/assets/fonts/ar/Cairo-Light/Cairo-Light.ttf b/assets/fonts/ar/Cairo-Light/Cairo-Light.ttf new file mode 100644 index 00000000..840cbc3e Binary files /dev/null and b/assets/fonts/ar/Cairo-Light/Cairo-Light.ttf differ diff --git a/assets/fonts/ar/Cairo-Light/Cairo-Light.woff b/assets/fonts/ar/Cairo-Light/Cairo-Light.woff new file mode 100644 index 00000000..9534bb4b Binary files /dev/null and b/assets/fonts/ar/Cairo-Light/Cairo-Light.woff differ diff --git a/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.eot b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.eot new file mode 100644 index 00000000..98bc2468 Binary files /dev/null and b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.eot differ diff --git a/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.otf b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.otf new file mode 100644 index 00000000..73f8bf0a Binary files /dev/null and b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.otf differ diff --git a/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.ttf b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.ttf new file mode 100644 index 00000000..177a3b67 Binary files /dev/null and b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.ttf differ diff --git a/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.woff b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.woff new file mode 100644 index 00000000..8d7013cd Binary files /dev/null and b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.woff differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.eot b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.eot new file mode 100644 index 00000000..9541e418 Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.eot differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.otf b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.otf new file mode 100644 index 00000000..be5e0ac4 Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.otf differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.ttf b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.ttf new file mode 100644 index 00000000..0b010ade Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.ttf differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.woff b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.woff new file mode 100644 index 00000000..12226d75 Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.woff differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Regular.otf b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.otf new file mode 100644 index 00000000..be88832e Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.otf differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Regular.ttf b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.ttf new file mode 100644 index 00000000..0ac4520a Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.ttf differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Regular.woff b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.woff new file mode 100644 index 00000000..89af38b8 Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.woff differ diff --git a/assets/images/SmartWatches/Apple-Watch-6.png b/assets/images/SmartWatches/Apple-Watch-6.png new file mode 100644 index 00000000..1e670506 Binary files /dev/null and b/assets/images/SmartWatches/Apple-Watch-6.png differ diff --git a/assets/images/SmartWatches/apple-watch-1.jpeg b/assets/images/SmartWatches/apple-watch-1.jpeg new file mode 100644 index 00000000..7262e7eb Binary files /dev/null and b/assets/images/SmartWatches/apple-watch-1.jpeg differ diff --git a/assets/images/SmartWatches/apple-watch-2.jpg b/assets/images/SmartWatches/apple-watch-2.jpg new file mode 100644 index 00000000..f688f740 Binary files /dev/null and b/assets/images/SmartWatches/apple-watch-2.jpg differ diff --git a/assets/images/SmartWatches/apple-watch-3.jpg b/assets/images/SmartWatches/apple-watch-3.jpg new file mode 100644 index 00000000..b68c1ced Binary files /dev/null and b/assets/images/SmartWatches/apple-watch-3.jpg differ diff --git a/assets/images/SmartWatches/apple-watch-4.jpg b/assets/images/SmartWatches/apple-watch-4.jpg new file mode 100644 index 00000000..2fc19b67 Binary files /dev/null and b/assets/images/SmartWatches/apple-watch-4.jpg differ diff --git a/assets/images/SmartWatches/apple-watch-5.jpg b/assets/images/SmartWatches/apple-watch-5.jpg new file mode 100644 index 00000000..4c497eac Binary files /dev/null and b/assets/images/SmartWatches/apple-watch-5.jpg differ diff --git a/assets/images/SmartWatches/fossil-sport.png b/assets/images/SmartWatches/fossil-sport.png new file mode 100644 index 00000000..207bbbe3 Binary files /dev/null and b/assets/images/SmartWatches/fossil-sport.png differ diff --git a/assets/images/SmartWatches/heartrate_icon.png b/assets/images/SmartWatches/heartrate_icon.png new file mode 100644 index 00000000..e228bea4 Binary files /dev/null and b/assets/images/SmartWatches/heartrate_icon.png differ diff --git a/assets/images/SmartWatches/huawei-watch-2-classic.png b/assets/images/SmartWatches/huawei-watch-2-classic.png new file mode 100644 index 00000000..0dc44cb6 Binary files /dev/null and b/assets/images/SmartWatches/huawei-watch-2-classic.png differ diff --git a/assets/images/SmartWatches/huawei-watch-2.png b/assets/images/SmartWatches/huawei-watch-2.png new file mode 100644 index 00000000..61530239 Binary files /dev/null and b/assets/images/SmartWatches/huawei-watch-2.png differ diff --git a/assets/images/SmartWatches/lg-watch-sport.jpg b/assets/images/SmartWatches/lg-watch-sport.jpg new file mode 100644 index 00000000..bd2f25ed Binary files /dev/null and b/assets/images/SmartWatches/lg-watch-sport.jpg differ diff --git a/assets/images/SmartWatches/miBand3.jpg b/assets/images/SmartWatches/miBand3.jpg new file mode 100644 index 00000000..c58f85e5 Binary files /dev/null and b/assets/images/SmartWatches/miBand3.jpg differ diff --git a/assets/images/SmartWatches/miBand4.jpg b/assets/images/SmartWatches/miBand4.jpg new file mode 100644 index 00000000..519ef5fb Binary files /dev/null and b/assets/images/SmartWatches/miBand4.jpg differ diff --git a/assets/images/SmartWatches/misfit-vapor-2.jpg b/assets/images/SmartWatches/misfit-vapor-2.jpg new file mode 100644 index 00000000..fe487591 Binary files /dev/null and b/assets/images/SmartWatches/misfit-vapor-2.jpg differ diff --git a/assets/images/SmartWatches/sleep_data.png b/assets/images/SmartWatches/sleep_data.png new file mode 100644 index 00000000..dc6661d6 Binary files /dev/null and b/assets/images/SmartWatches/sleep_data.png differ diff --git a/assets/images/SmartWatches/ticwatche2.png b/assets/images/SmartWatches/ticwatche2.png new file mode 100644 index 00000000..5ad3d308 Binary files /dev/null and b/assets/images/SmartWatches/ticwatche2.png differ diff --git a/assets/images/female_face.png b/assets/images/female_face.png new file mode 100644 index 00000000..be8ed225 Binary files /dev/null and b/assets/images/female_face.png differ diff --git a/assets/images/male_face.png b/assets/images/male_face.png new file mode 100644 index 00000000..7adf335a Binary files /dev/null and b/assets/images/male_face.png differ diff --git a/heartrate_icon.png b/heartrate_icon.png new file mode 100644 index 00000000..e228bea4 Binary files /dev/null and b/heartrate_icon.png differ diff --git a/lib/config/config.dart b/lib/config/config.dart index 20bf9caa..ce8b79de 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://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com//'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; @@ -280,6 +279,10 @@ const GET_COVID_DRIVETHRU_PAYMENT_INFO = const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; +///Smartwatch Integration Services +const GET_PATIENT_LAST_RECORD = + 'Services/Patients.svc/REST/Med_GetPatientLastRecord'; + ///My Trackers const GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4b693fcd..77cb1c44 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -547,18 +547,18 @@ const Map> localizedValues = { "en": "Please enter the verification code send to", "ar": "الرجاء إدخال رمز التحقق المرسل إلى" }, - "EyeMeasurements":{"en":"Eye Measurements","ar":"قياسات النظر"}, - "Measurements":{"en":"Measurements","ar":"قياسات"}, - "Classes":{"en":"Classes","ar":"نظارات"}, - "ContactLens":{"en":"Contact Lens","ar":"العدسات اللاصقة"}, - "RightEye":{"en":"Right Eye","ar":"العين اليمين"}, - "Sphere":{"en":"Sphere","ar":"القوة"}, - "Cylinder":{"en":"Cylinder","ar":"الدائرية"}, - "Axis":{"en":"Axis","ar":"المحاور"}, - "Prism":{"en":"Prism","ar":"موشور"}, - "VA":{"en":"Prism","ar":"المحاور"}, - "LeftEye":{"en":"Left Eye","ar":"العين اليسرى"}, - "Brand":{"en":"Brand","ar":"النوع"}, + "EyeMeasurements": {"en": "Eye Measurements", "ar": "قياسات النظر"}, + "Measurements": {"en": "Measurements", "ar": "قياسات"}, + "Classes": {"en": "Classes", "ar": "نظارات"}, + "ContactLens": {"en": "Contact Lens", "ar": "العدسات اللاصقة"}, + "RightEye": {"en": "Right Eye", "ar": "العين اليمين"}, + "Sphere": {"en": "Sphere", "ar": "القوة"}, + "Cylinder": {"en": "Cylinder", "ar": "الدائرية"}, + "Axis": {"en": "Axis", "ar": "المحاور"}, + "Prism": {"en": "Prism", "ar": "موشور"}, + "VA": {"en": "Prism", "ar": "المحاور"}, + "LeftEye": {"en": "Left Eye", "ar": "العين اليسرى"}, + "Brand": {"en": "Brand", "ar": "النوع"}, "Power": {"en": "Power", "ar": "القوة"}, "Diameter": {"en": "Diameter", "ar": "القطر"}, "Remarks": {"en": "Remarks", "ar": "ملاحضات"}, @@ -590,6 +590,11 @@ const Map> localizedValues = { "en": "View Doctor Responses", "ar": "الاطلاع على ردود الأطباء" }, + "ServiceInformationButton": {"en": "LOGIN / REGISTER", "ar": "دخول / تسجيل"}, + "ServiceInformationTitle": { + "en": "Service Information", + "ar": "معلومات الخدمة" + }, "ServiceInformation": {"en": "Service Information", "ar": "معلومات الخدمة"}, "HomeHealthCare": { "en": "Home Health Care", @@ -601,25 +606,58 @@ const Map> localizedValues = { "ar": "توفر هذه الخدمة مجموعه من خدمات الرعايه الصحيه المنزلية و متابعه مستمره وشامله للذين لا يستطيعون الوصول للمنشات الصحيه في اماكن اقامتهم (التحاليل المخبرية – الاشعة – التطعيمات – العلاج الطبيعي)... " }, - "LoginRegister": { - "en": "Login/Register", - "ar": "دخول / تسجيل" + "LoginRegister": {"en": "Login/Register", "ar": "دخول / تسجيل"}, + "OrderLog": {"en": "Order Log", "ar": " سجل الطلبات"}, + "info-lab": { + "en": + "This service allows you to view the results of all laboratory tests performed in Al Habib Medical Group as well as sending the report via e-mail.", + "ar": + "خدمة نتائج المختبر: هذه الخدمة تمكنك من الاطلاع على نتائج جميع الفحوصات المخبرية التي تمت في مجموعة الحبيب الطبية." }, - "OrderLog": { - "en": "Order Log", - "ar": " سجل الطلبات" + "info-radiology": { + "en": + "This service allows you to view the reports and photos of radiology in Al Habib Medical Group as well as send the report by e-mail.", + "ar": + "خدمة الاشعة: هذه الخدمة تمكنك من الاطلاع على تقارير وصور الاشعة التي تمت في مجموعة الحبيب الطبية وكذلك ارسال التقرير عن طريق الايميل." }, - "ServiceInformationButton":{"en":"LOGIN / REGISTER","ar":"دخول / تسجيل"}, - "ServiceInformationTitle":{"en":"Service Information","ar":"معلومات الخدمة"}, - "info-lab": { - "en": "This service allows you to view the results of all laboratory tests performed in Al Habib Medical Group as well as sending the report via e-mail.", - "ar": "خدمة نتائج المختبر: هذه الخدمة تمكنك من الاطلاع على نتائج جميع الفحوصات المخبرية التي تمت في مجموعة الحبيب الطبية." + "TermsService": {"en": "Terms of Service", "ar": "شروط الخدمه"}, + "Beforeusing": { + "en": "Before using the checkup, please read Terms of Service.", + "ar": "قبل استخدام الفحص ، يرجى قراءة شروط الخدمة" }, - "info-radiology": { - "en": "This service allows you to view the reports and photos of radiology in Al Habib Medical Group as well as send the report by e-mail.", - "ar": "خدمة الاشعة: هذه الخدمة تمكنك من الاطلاع على تقارير وصور الاشعة التي تمت في مجموعة الحبيب الطبية وكذلك ارسال التقرير عن طريق الايميل." + "accept": { + "en": "I read and accept Terms of Service and Privacy Policy", + "ar": "قرأت ووافقت على شروط الخدمة وسياسة الخصوصية" }, + "data-safe-info": { + "en": + "Information that you provide is anonymous and not shared with anyone.", + "ar": "المعلومات التي تقدمها لا تتم مشاركتها مع أي شخص" + }, + "data-safe": {"en": " Your data is safe.", "ar": "بياناتك آمنة"}, + "informational": { + "en": + "Checkup is for informational purposes and is not a qualified medical opinion", + "ar": "الفحص هو لأغراض معلوماتية وليس رأي طبي مؤهل" + }, + "not-use-in-emerbency": { + "en": "Do not use in emergencies.", + "ar": "لا تستخدم في حالات الطوارئ" + }, + "not-use-in-emerbency-details": { + "en": "In case of health emergency, ", + "ar": "في حالة الطوارئ اتصل بأقرب رقم للطوارئ على الفور" + }, + "not-use-in-emerbency-details-call": { + "en": "call the nearest emergency number immediately", + "ar": " اتصل بأقرب رقم للطوارئ على الفور" + }, + "check-diagnosis": { + "en": "Checkup is not a diagnosis.", + "ar": "الفحص ليس تشخيص." + }, + "remeberthat": {"en": "Remember that", "ar": "تذكر ذلك:"}, // pharmacy module "medicationRefill": { @@ -654,4 +692,13 @@ const Map> localizedValues = { "en": "Delete All Items", "ar": "حذف كافة العناصر" }, + "select-gender": {"en": "Select Gender", "ar": "اختر الجنس"}, + "i-am-a": {"en": "I am a ...", "ar": "أنا ..."}, + "select-age": {"en": "Select Your Age", "ar": "حدد العمر"}, + "i-am": {"en": "I am", "ar": "أنا"}, + "years-old": {"en": "years old", "ar": "سنة"}, + "drag-point": { + "en": "Drag point to change your age", + "ar": "اسحب لتغيير عمرك" + }, }; diff --git a/lib/core/enum/OrderService.dart b/lib/core/enum/OrderService.dart index e6ce24eb..833e0919 100644 --- a/lib/core/enum/OrderService.dart +++ b/lib/core/enum/OrderService.dart @@ -1,4 +1,4 @@ -enum OrderService { AMBULANCE } +enum OrderService { AMBULANCE,HOME_HEALTH_CARE,Comprehensive_Medical_Checkup } extension SelectedOrderService on OrderService { int getIdOrderService() { @@ -6,6 +6,13 @@ extension SelectedOrderService on OrderService { case OrderService.AMBULANCE: return 4; break; + case OrderService.Comprehensive_Medical_Checkup: + return 3; + break; + case OrderService.HOME_HEALTH_CARE: + return 2; + break; + } return 4; } @@ -15,6 +22,12 @@ extension SelectedOrderService on OrderService { case 4: return OrderService.AMBULANCE; break; + case 2: + return OrderService.HOME_HEALTH_CARE; + break; + case 3: + return OrderService.Comprehensive_Medical_Checkup; + break; } return OrderService.AMBULANCE; diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart index 198ae285..6987ee44 100644 --- a/lib/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart @@ -18,7 +18,7 @@ class PatientERInsertPresOrderRequestModel { double longitude; int createdBy; int orderServiceID; - List patientERHHCInsertServicesList =List(); + List patientERHHCInsertServicesList = List(); PatientERInsertPresOrderRequestModel( {this.versionID, @@ -38,6 +38,7 @@ class PatientERInsertPresOrderRequestModel { this.longitude, this.createdBy, this.orderServiceID, + this.patientERHHCInsertServicesList }); PatientERInsertPresOrderRequestModel.fromJson(Map json) { diff --git a/lib/core/service/AlHabibMedicalService/cmc_service.dart b/lib/core/service/AlHabibMedicalService/cmc_service.dart index b87f54fb..dffa6683 100644 --- a/lib/core/service/AlHabibMedicalService/cmc_service.dart +++ b/lib/core/service/AlHabibMedicalService/cmc_service.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart'; @@ -99,4 +100,16 @@ class CMCService extends BaseService { super.error = error; }, body: updatePresOrderRequestModel.toJson()); } + + Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { + + hasError = false; + await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, + onSuccess: (dynamic response, int statusCode) { + isOrderUpdated = true; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: order.toJson()); + } } diff --git a/lib/core/service/AlHabibMedicalService/home_health_care_service.dart b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart index 45a871cd..e636321b 100644 --- a/lib/core/service/AlHabibMedicalService/home_health_care_service.dart +++ b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.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 '../base_service.dart'; @@ -68,8 +69,7 @@ class HomeHealthCareService extends BaseService { }, body: body); } - Future updateHHCPresOrder( - UpdatePresOrderRequestModel updatePresOrderRequestModel) async { + Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { hasError = false; await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, onSuccess: (dynamic response, int statusCode) { @@ -79,4 +79,15 @@ class HomeHealthCareService extends BaseService { super.error = error; }, body: updatePresOrderRequestModel.toJson()); } + + Future insertPresPresOrder({PatientERInsertPresOrderRequestModel order}) async { + hasError = false; + await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: order.toJson()); + } } diff --git a/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart index b4c805b7..bf3404a9 100644 --- a/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart @@ -1,6 +1,8 @@ +import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart'; @@ -34,7 +36,7 @@ class CMCViewModel extends BaseViewModel { .getCMCAllServices(); CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: cmcAllServicesList[0].iD); - await getCheckupItems(cMCGetItemsRequestModel); + await getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel,isFirst: true); if (_cMCService.hasError) { error = _cMCService.error; setState(ViewState.Error); @@ -42,13 +44,16 @@ class CMCViewModel extends BaseViewModel { setState(ViewState.Idle); } } - Future getCheckupItems(CMCGetItemsRequestModel cMCGetItemsRequestModel) async { - await _cMCService - .getCheckupItems(cMCGetItemsRequestModel); + Future getCheckupItems({CMCGetItemsRequestModel cMCGetItemsRequestModel, bool isFirst = false}) async { + if(!isFirst) + setState(ViewState.Busy); + await _cMCService.getCheckupItems(cMCGetItemsRequestModel); if (_cMCService.hasError) { error = _cMCService.error; setState(ViewState.Error); } + if(!isFirst) + setState(ViewState.Idle); } Future getCmcAllPresOrders() async { @@ -89,4 +94,17 @@ class CMCViewModel extends BaseViewModel { await _cMCService .getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel); } + //TODO check it in uat + Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { + setState(ViewState.Busy); + order.createdBy = user.patientID; + order.orderServiceID = OrderService.Comprehensive_Medical_Checkup.getIdOrderService(); + await _cMCService.insertPresPresOrder(order: order); + if (_cMCService.hasError) { + error = _cMCService.error; + setState(ViewState.ErrorLocal); + } else { + getCmcAllPresOrders(); + } + } } \ No newline at end of file diff --git a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart index 8a4acd2b..031d0a0c 100644 --- a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart'; @@ -5,6 +6,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.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/service/AlHabibMedicalService/home_health_care_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; @@ -65,8 +67,7 @@ class HomeHealthCareViewModel extends BaseViewModel { } } - Future updateHHCPresOrder( - UpdatePresOrderRequestModel updatePresOrderRequestModel) async { + Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { setState(ViewState.Busy); await _homeHealthCareService.updateHHCPresOrder( updatePresOrderRequestModel); @@ -78,6 +79,19 @@ class HomeHealthCareViewModel extends BaseViewModel { } } + Future insertPresPresOrder({PatientERInsertPresOrderRequestModel order}) async { + setState(ViewState.Busy); + order.createdBy = user.patientID; + order.orderServiceID = OrderService.HOME_HEALTH_CARE.getIdOrderService(); + await _homeHealthCareService.insertPresPresOrder(order: order); + if (_homeHealthCareService.hasError) { + error = _homeHealthCareService.error; + setState(ViewState.ErrorLocal); + } else { + getHHCAllPresOrders(); + } + } + } \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index d8e3307d..9cb5cb78 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -54,6 +54,7 @@ class MyApp extends StatelessWidget { const Locale('en', ''), // English ], theme: ThemeData( + fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans', primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, brightness: Brightness.light, @@ -66,8 +67,7 @@ class MyApp extends StatelessWidget { hintColor: Colors.grey[400], disabledColor: Colors.grey[300], errorColor: Color.fromRGBO(235, 80, 60, 1.0), - scaffoldBackgroundColor: - HexColor('#E9E9E9'), // Colors.grey[100], + scaffoldBackgroundColor: HexColor('#E9E9E9'), // Colors.grey[100], textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), textSelectionHandleColor: Colors.grey, canvasColor: Colors.white, diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart index 494b0920..532396cc 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart @@ -4,14 +4,18 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; import 'new_cmc_step_one_page.dart'; +import 'new_cmc_step_three_page.dart'; +import 'new_cmc_step_tow_page.dart'; class NewCMCPage extends StatefulWidget { NewCMCPage({this.model}); @@ -27,7 +31,9 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { PageController _controller; int _currentIndex = 1; - int pageSelected = 2; + + double _latitude; + double _longitude; CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel; @@ -54,6 +60,18 @@ class _NewCMCPageState extends State : []); _controller = new PageController(); + + _getCurrentLocation(); + } + + _getCurrentLocation() async { + await getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); } @override @@ -94,216 +112,230 @@ class _NewCMCPageState extends State child: SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 0.8, - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - widget.model.cmcAllOrderDetail.length != 0 - ? FractionallySizedBox( - heightFactor: 0.8, - widthFactor: 0.9, - child: Container( - width: double.infinity, - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - border: - Border.all(color: Colors.grey, width: 1), - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - Container( + child: Column( + children: [ + Container( + margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05), + child: StepsWidget( + index: _currentIndex, + changeCurrentTab: changePageViewIndex, + ), + ), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + widget.model.cmcAllOrderDetail.length != 0 + ? FractionallySizedBox( + heightFactor: 0.8, + widthFactor: 0.9, + child: Container( width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), + margin: EdgeInsets.only(top: 15), decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), + border: + Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), color: Colors.white), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( - "Request ID", - bold: false, - fontSize: 13, - ), SizedBox( - height: 4, - ), - Texts( - widget.model.cmcAllOrderDetail[0].iD.toString(), - fontSize: 22, + height: 12, ), - ], - ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Request ID", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + widget.model.cmcAllOrderDetail[0].iD.toString(), + fontSize: 22, + ), + ], ), ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - "Status", - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - "Pending", - fontSize: 22, + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Status", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + "Pending", + fontSize: 22, + ), + ], + ), ), - ], - ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Pickup Date", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate( + widget.model.cmcAllOrderDetail[0] + .createdOn)), + fontSize: 22, + ), + ], ), ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - "Pickup Date", - bold: false, - fontSize: 13, + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Service Name", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + widget.model.cmcAllOrderDetail[0].description + .toString() ?? + widget.model.cmcAllOrderDetail[0] + .descriptionN + .toString(), + fontSize: 22, + ), + ], + ), ), SizedBox( - height: 4, - ), - Texts( - DateUtil.getDayMonthYearDateFormatted( - DateUtil.convertStringToDate( - widget.model.cmcAllOrderDetail[0] - .createdOn)), - fontSize: 22, + height: 12, ), - ], - ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, + Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * + 0.85, + child: SecondaryButton( + label: "Cancel".toUpperCase(), + onTap: () { + showConfirmMessage(widget.model, + widget.model.cmcAllOrderDetail[0]); + } + , + color: Colors.red[800], + disabled: false, + textColor: Theme + .of(context) + .backgroundColor), ), ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - "Service Name", - bold: false, - fontSize: 13, - ), SizedBox( - height: 4, - ), - Texts( - widget.model.cmcAllOrderDetail[0].description - .toString() ?? - widget.model.cmcAllOrderDetail[0] - .descriptionN - .toString(), - fontSize: 22, + height: 12, ), ], ), ), - SizedBox( - height: 12, - ), - Center( - child: Container( - width: MediaQuery - .of(context) - .size - .width * - 0.85, - child: SecondaryButton( - label: "Cancel".toUpperCase(), - onTap: () { - showConfirmMessage(widget.model, - widget.model.cmcAllOrderDetail[0]); - } - , - color: Colors.red[800], - disabled: false, - textColor: Theme - .of(context) - .backgroundColor), - ), - ), - SizedBox( - height: 12, - ), - ], - ), + ) + : NewCMCStepOnePage( + changePageViewIndex: changePageViewIndex, + cMCInsertPresOrderRequestModel: + cMCInsertPresOrderRequestModel, + model: widget.model, + ), + NewCMCStepTowPage( + longitude: _longitude, + latitude: _latitude, + changePageViewIndex: changePageViewIndex, + cmcInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel, + model: widget.model, + ), NewCMCStepThreePage( + changePageViewIndex: changePageViewIndex, + cmcInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel, + model: widget.model, + ), + ], ), - ) - : NewCMCStepOnePage( - changePageViewIndex: changePageViewIndex, - cMCInsertPresOrderRequestModel: - cMCInsertPresOrderRequestModel, - model: widget.model, ), - // NewEReferralStepTowPage( - // changePageViewIndex: changePageViewIndex, - // patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, - // - // ), - // NewEReferralStepThreePage( - // changePageViewIndex: changePageViewIndex, - // patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, - // - // ), ], ), ), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart index 52a64a50..02d099b4 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart @@ -20,12 +20,10 @@ class NewCMCStepOnePage extends StatefulWidget { : super(key: key); @override - _NewCMCStepOnePageState createState() => - _NewCMCStepOnePageState(); + _NewCMCStepOnePageState createState() => _NewCMCStepOnePageState(); } -class _NewCMCStepOnePageState - extends State { +class _NewCMCStepOnePageState extends State { @override void initState() { super.initState(); @@ -34,176 +32,200 @@ class _NewCMCStepOnePageState @override Widget build(BuildContext context) { return AppScaffold( - isShowAppBar: false, - baseViewModel: widget.model, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - margin: EdgeInsets.all(12), - child: Center( - child: Column( - children: [ - FractionallySizedBox( - widthFactor: 0.94, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 20, - ), - Texts( -// TranslationBase.of(context).advancePaymentLabel, - "Select Home Health Care Services", - textAlign: TextAlign.center, - ), - Column( - children: widget.model.cmcAllServicesList.map(( - service) { - return Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - border: - Border.all(color: Colors.grey, width: 1), - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - children: [ - Row( - children: [ - Radio( + isShowAppBar: false, + baseViewModel: widget.model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Center( + child: Column( + children: [ + FractionallySizedBox( + widthFactor: 0.94, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Texts( + "Select Home Health Care Services", + textAlign: TextAlign.center, + ), + Column( + children: + widget.model.cmcAllServicesList.map((service) { + return Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: + Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + children: [ + Row( + children: [ + Radio( value: service.serviceID, activeColor: Colors.red[800], onChanged: (newValue) async { - PatientERCMCInsertServicesList patientERCMCInsertServicesList = - new PatientERCMCInsertServicesList( - price: service.price, - serviceID: service.serviceID - .toString(), - selectedServiceName: service - .description, - selectedServiceNameAR: - service.description, - recordID: 1, - totalPrice: service.totalPrice, - vAT: service.vAT); + PatientERCMCInsertServicesList + patientERCMCInsertServicesList = + new PatientERCMCInsertServicesList( + price: service.price, + serviceID: service.serviceID + .toString(), + selectedServiceName: + service.description, + selectedServiceNameAR: + service.description, + recordID: 1, + totalPrice: + service.totalPrice, + vAT: service.vAT); setState(() { widget .cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList = - [patientERCMCInsertServicesList]; + .patientERCMCInsertServicesList = [ + patientERCMCInsertServicesList + ]; }); - CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel (checkupType:newValue ); - await widget.model.getCheckupItems(cMCGetItemsRequestModel); + CMCGetItemsRequestModel + cMCGetItemsRequestModel = + new CMCGetItemsRequestModel( + checkupType: newValue); + await widget.model.getCheckupItems( + cMCGetItemsRequestModel: + cMCGetItemsRequestModel); }, groupValue: widget - .cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList.length >0?int.parse(widget - .cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList[0] - .serviceID):1), - Expanded( - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Texts( - service.description, - fontSize: 15, - ), + .cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList + .length > + 0 + ? int.parse(widget + .cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList[ + 0] + .serviceID) + : 1), + Expanded( + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Texts( + service.description, + fontSize: 15, ), ), - ], - ), - ], - ), - ); - }).toList(), - ), - ], - ), - ), - SizedBox(height: 30,), - Container( - color: Colors.white, - width: double.infinity, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: widget.model.checkupItems.map((item) { - return Center( - child: FractionallySizedBox( - widthFactor: 0.8, - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - border: - Border.all(color: Colors.grey, width: 1), - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 5, top: 5), - decoration: BoxDecoration( - // border: Border( - // bottom: BorderSide( - // color: Colors.grey, - // width: 1.0, - // ), - // ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - item.itemName, - fontSize: 15, - ), - ], - ), - ), - - SizedBox( - height: 12, ), ], ), - ), + ], ), ); - }).toList()), - ) - ], - ), + }).toList(), + ), + ], + ), + ), + SizedBox( + height: 30, + ), + Container( + color: Colors.white, + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: widget.model.checkupItems.map((item) { + return Center( + child: FractionallySizedBox( + widthFactor: 1, + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration(color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 5, top: 5), + decoration: BoxDecoration( + border: BorderDirectional( + bottom: BorderSide( + style: BorderStyle.solid, + width: 0.5, + color: Colors.grey)), + //borderRadius: , + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + item.itemName, + fontSize: 15, + ), + ], + ), + ), + SizedBox( + height: 12, + ), + ], + ), + ), + ), + ); + }).toList()), + ) + ], ), ), ), - bottomSheet:Container( - height: MediaQuery.of(context).size.height * 0.10, - width: double.infinity, - child: Column( - children: [ - Container( - width: MediaQuery - .of(context) - .size - .width * 0.9, - child: SecondaryButton( - label: "Next", - // disabled: this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length ==0, - textColor: Theme - .of(context) - .backgroundColor), - ), - ], - ), - )); - } + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + label: "Next", + textColor: Theme.of(context).backgroundColor, + onTap: () { + if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length = null) { + int index = widget.model.cmcAllServicesList.length; + PatientERCMCInsertServicesList + patientERCMCInsertServicesList = + new PatientERCMCInsertServicesList( + price: widget.model.cmcAllServicesList[index-1].price, + serviceID: widget.model.cmcAllServicesList[index-1].serviceID.toString(), + selectedServiceName: widget.model.cmcAllServicesList[index-1].description, + selectedServiceNameAR: widget.model.cmcAllServicesList[index-1].description, + recordID: 1, + totalPrice: widget.model.cmcAllServicesList[index-1].totalPrice, + vAT: widget.model.cmcAllServicesList[index-1].vAT); + widget.cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList = [ + patientERCMCInsertServicesList + ]; + widget.changePageViewIndex(1); + } + }, + ), + ), + ], + ), + ), + ); + } } diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart new file mode 100644 index 00000000..e48bb5d5 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart @@ -0,0 +1,165 @@ +import 'dart:async'; + +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; + +class NewCMCStepThreePage extends StatefulWidget { + final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel; + final Function changePageViewIndex; + final CMCViewModel model; + + NewCMCStepThreePage( + {Key key, + this.changePageViewIndex, + this.model, + this.cmcInsertPresOrderRequestModel}); + + @override + _NewCMCStepThreePageState createState() => + _NewCMCStepThreePageState(); +} + +class _NewCMCStepThreePageState + extends State { + Completer _controller = Completer(); + + static CameraPosition _kGooglePlex = CameraPosition( + target: LatLng(37.42796133580664, -122.085749655962), + zoom: 14.4746, + ); + final Set markers = new Set(); + + @override + void initState() { + if (widget.cmcInsertPresOrderRequestModel.latitude != null) { + markers.clear(); + markers.add( + Marker( + markerId: MarkerId( + widget.cmcInsertPresOrderRequestModel.latitude.hashCode + .toString(), + ), + position: LatLng( + widget.cmcInsertPresOrderRequestModel.latitude, + widget.cmcInsertPresOrderRequestModel.longitude)), + ); + _kGooglePlex = CameraPosition( + target: LatLng(widget.cmcInsertPresOrderRequestModel.latitude, + widget.cmcInsertPresOrderRequestModel.longitude), + zoom: 14.4746, + ); + } + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowDecPage: false, + baseViewModel: widget.model, + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + height: 400, + width: double.maxFinite, + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Order Details'), + SizedBox( + height: 12, + ), + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + padding: EdgeInsets.all(8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Location :'), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + height: 200, + child: GoogleMap( + mapType: MapType.normal, + markers: markers, + initialCameraPosition: _kGooglePlex, + onMapCreated: (GoogleMapController controller) { + _controller.complete(controller); + }, + ), + ), + ), + SizedBox( + height: 12, + ), + Texts('Selected Service :'), + ...List.generate( + widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList.length, + (index) => Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Service Name :', + fontSize: 12, + ), + SizedBox( + height: 5, + ), + Texts( + widget + .cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index] + .selectedServiceName, + fontSize: 15, + bold: true, + ), + ], + ), + ), + ) + ], + ), + ) + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + label: "Confirm", + onTap: () async { + await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel); + if (widget.model.state != ViewState.ErrorLocal) { + widget.changePageViewIndex(0); + } + }, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart new file mode 100644 index 00000000..27cddfe3 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -0,0 +1,113 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_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/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/close_back.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:provider/provider.dart'; + +class NewCMCStepTowPage extends StatefulWidget { + final Function(PickResult) onPick; + final double latitude; + final double longitude; + final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel; + final Function changePageViewIndex; + final CMCViewModel model; + + const NewCMCStepTowPage( + {Key key, + this.onPick, + this.latitude, + this.longitude, + this.cmcInsertPresOrderRequestModel, + this.changePageViewIndex, + this.model}) + : super(key: key); + + @override + _NewCMCStepTowPageState createState() => + _NewCMCStepTowPageState(); +} + +class _NewCMCStepTowPageState + extends State { + double latitude = 0; + double longitude = 0; + + @override + void initState() { + if (widget.cmcInsertPresOrderRequestModel.latitude == null) { + latitude = widget.latitude; + longitude = widget.longitude; + } else { + latitude = widget.cmcInsertPresOrderRequestModel.latitude; + longitude = widget.cmcInsertPresOrderRequestModel.longitude; + } + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + isShowDecPage: false, + body: PlacePicker( + apiKey: GOOGLE_API_KEY, + enableMyLocationButton: true, + automaticallyImplyAppBarLeading: false, + autocompleteOnTrailingWhitespace: true, + selectInitialPosition: true, + autocompleteLanguage: projectViewModel.currentLanguage, + enableMapTypeButton: true, + onPlacePicked: (PickResult result) { + print(result.adrAddress); + widget.changePageViewIndex(3); + }, + selectedPlaceWidgetBuilder: + (_, selectedPlace, state, isSearchBarFocused) { + print("state: $state, isSearchBarFocused: $isSearchBarFocused"); + return isSearchBarFocused + ? Container() + : FloatingCard( + bottomPosition: 0.0, + leftPosition: 0.0, + rightPosition: 0.0, + width: 500, + borderRadius: BorderRadius.circular(12.0), + child: state == SearchingState.Searching + ? Center(child: CircularProgressIndicator()) + : Container( + margin: EdgeInsets.all(12), + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.cmcInsertPresOrderRequestModel + .latitude = + selectedPlace.geometry.location.lat; + widget.cmcInsertPresOrderRequestModel + .longitude = + selectedPlace.geometry.location.lng; + }); + widget.changePageViewIndex(3); + }, + label: TranslationBase.of(context).next, + ), + ), + ); + }, + initialPosition: LatLng(latitude, longitude), + useCurrentLocation: true, + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart index 5787af66..fb2b94c6 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart @@ -1,5 +1,3 @@ - - import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart'; import 'package:flutter/material.dart'; @@ -8,7 +6,6 @@ import 'new_e_referral_step_three_page.dart'; import 'new_e_referral_step_two_page.dart'; class StartIndexForNewEReferral extends StatefulWidget { - StartIndexForNewEReferral(); @override @@ -22,8 +19,8 @@ class _StartIndexForNewEReferralState extends State int _currentIndex = 1; int pageSelected = 2; - - CreateEReferralRequestModel createEReferralRequestModel = new CreateEReferralRequestModel(); + CreateEReferralRequestModel createEReferralRequestModel = + new CreateEReferralRequestModel(); @override void initState() { @@ -46,7 +43,7 @@ class _StartIndexForNewEReferralState extends State body: SafeArea( child: SingleChildScrollView( child: Container( - height: MediaQuery.of(context).size.height, + height: MediaQuery.of(context).size.height * 0.9, child: PageView( physics: NeverScrollableScrollPhysics(), controller: _controller, @@ -64,12 +61,10 @@ class _StartIndexForNewEReferralState extends State NewEReferralStepTowPage( changePageViewIndex: changePageViewIndex, createEReferralRequestModel: createEReferralRequestModel, - ), NewEReferralStepThreePage( changePageViewIndex: changePageViewIndex, createEReferralRequestModel: createEReferralRequestModel, - ), ], ), diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart index 6460de03..62799c6d 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart @@ -95,7 +95,7 @@ class _NewEReferralStepOnePageState extends State { margin: EdgeInsets.all(12), child: Center( child: FractionallySizedBox( - widthFactor: 0.94, + widthFactor: 0.9, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart index 2dd64605..1dbee1b5 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -6,8 +6,11 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; class NewHomeHealthCareStepOnePage extends StatefulWidget { final PatientERInsertPresOrderRequestModel @@ -27,135 +30,148 @@ class NewHomeHealthCareStepOnePage extends StatefulWidget { _NewHomeHealthCareStepOnePageState(); } -class _NewHomeHealthCareStepOnePageState - extends State { - @override - void initState() { - if(widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList==null) - widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList = []; +class _NewHomeHealthCareStepOnePageState extends State { + PickResult _result; + + @override + void initState() { + if (widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList == null) + widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList = []; super.initState(); } + @override Widget build(BuildContext context) { return AppScaffold( - isShowAppBar: false, - baseViewModel: widget.model, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - margin: EdgeInsets.only( - left: MediaQuery.of(context).size.width * 0.05, - right: MediaQuery.of(context).size.width * 0.05), - child: Center( - child: FractionallySizedBox( - widthFactor: 1, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - Texts( - "Select Home Health Care Services", - textAlign: TextAlign.center, - ), - Column( - children: widget.model.hhcAllServicesList.map((service) { - return Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - border: Border.all(color: Colors.grey, width: 1), - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - children: [ - Row( - children: [ - Checkbox( - value: isServiceSelected( - service.serviceID), - activeColor: Colors.black38, - onChanged: (bool newValue) { - setState(() { - if(!isServiceSelected(service.serviceID)) - widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.add( PatientERHHCInsertServicesList( - recordID:widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length, - serviceID: service.serviceID, - serviceName: service.description)); - else - removeSelected(service.serviceID); - // widget.patientERInsertPresOrderRequestModel - // isPatientInsured = newValue; - }); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Texts( - service.description, - fontSize: 15, - ), + isShowAppBar: false, + baseViewModel: widget.model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.only( + left: MediaQuery.of(context).size.width * 0.05, + right: MediaQuery.of(context).size.width * 0.05), + child: Center( + child: FractionallySizedBox( + widthFactor: 1, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Texts( + "Select Home Health Care Services", + textAlign: TextAlign.center, + ), + Column( + children: widget.model.hhcAllServicesList.map((service) { + return Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + children: [ + Row( + children: [ + Checkbox( + value: isServiceSelected(service.serviceID), + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() { + if (!isServiceSelected( + service.serviceID)) + widget + .patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList + .add(PatientERHHCInsertServicesList( + recordID: widget + .patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList + .length, + serviceID: service.serviceID, + serviceName: + service.description)); + else + removeSelected(service.serviceID); + // widget.patientERInsertPresOrderRequestModel + // isPatientInsured = newValue; + }); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Texts( + service.description, + fontSize: 15, ), ), - ], - ), - ], - ), - ); - }).toList(), - ) - ], - ), + ), + ], + ), + ], + ), + ); + }).toList(), + ) + ], ), ), ), ), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.10, - width: double.infinity, - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.9, - child: SecondaryButton( - label: "Next", - disabled: this - .widget - .patientERInsertPresOrderRequestModel - .patientERHHCInsertServicesList - .length == - 0, - textColor: Theme.of(context).backgroundColor), - ), - ], - ), - )); + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + label: "Next", + disabled: this + .widget + .patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList + .length == 0, + onTap: (){ + widget.changePageViewIndex(1); + }, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + ), + ); } isServiceSelected(int serviceId) { - Iterable patientERHHCInsertServicesList = widget - .patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList - .where((element) => serviceId == element.serviceID); - if(patientERHHCInsertServicesList.length > 0) { - return true; - } - return false; + Iterable patientERHHCInsertServicesList = + widget + .patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList + .where((element) => serviceId == element.serviceID); + if (patientERHHCInsertServicesList.length > 0) { + return true; + } + return false; } - removeSelected(int serviceId){ - Iterable patientERHHCInsertServicesList = widget - .patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList - .where((element) => serviceId == element.serviceID); + removeSelected(int serviceId) { + Iterable patientERHHCInsertServicesList = + widget + .patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList + .where((element) => serviceId == element.serviceID); - if(patientERHHCInsertServicesList.length > 0) + if (patientERHHCInsertServicesList.length > 0) setState(() { - widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.remove(patientERHHCInsertServicesList); + widget + .patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList + .remove(patientERHHCInsertServicesList.first); }); - - - } } diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart new file mode 100644 index 00000000..aca2f3c2 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart @@ -0,0 +1,172 @@ +import 'dart:async'; + +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; + +class NewHomeHealthCareStepThreePage extends StatefulWidget { + final PatientERInsertPresOrderRequestModel + patientERInsertPresOrderRequestModel; + final Function changePageViewIndex; + final HomeHealthCareViewModel model; + + NewHomeHealthCareStepThreePage( + {Key key, + this.patientERInsertPresOrderRequestModel, + this.changePageViewIndex, + this.model}); + + @override + _NewHomeHealthCareStepThreePageState createState() => + _NewHomeHealthCareStepThreePageState(); +} + +class _NewHomeHealthCareStepThreePageState + extends State { + Completer _controller = Completer(); + + static CameraPosition _kGooglePlex = CameraPosition( + target: LatLng(37.42796133580664, -122.085749655962), + zoom: 14.4746, + ); + final Set markers = new Set(); + + @override + void initState() { + if (widget.patientERInsertPresOrderRequestModel.latitude != null) { + markers.clear(); + markers.add( + Marker( + markerId: MarkerId( + widget.patientERInsertPresOrderRequestModel.latitude.hashCode + .toString(), + ), + position: LatLng( + widget.patientERInsertPresOrderRequestModel.latitude, + widget.patientERInsertPresOrderRequestModel.longitude)), + ); + _kGooglePlex = CameraPosition( + target: LatLng(widget.patientERInsertPresOrderRequestModel.latitude, + widget.patientERInsertPresOrderRequestModel.longitude), + zoom: 14.4746, + ); + } + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowDecPage: false, + baseViewModel: widget.model, + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + width: double.maxFinite, + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Order Details'), + SizedBox( + height: 12, + ), + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + padding: EdgeInsets.all(8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Location :'), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + height: 200, + child: GoogleMap( + mapType: MapType.normal, + markers: markers, + initialCameraPosition: _kGooglePlex, + onMapCreated: (GoogleMapController controller) { + _controller.complete(controller); + }, + ), + ), + ), + SizedBox( + height: 12, + ), + Texts('Selected Service :'), + ...List.generate( + widget.patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList.length, + (index) => Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Service Name :', + fontSize: 12, + ), + SizedBox( + height: 5, + ), + Texts( + widget + .patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList[index] + .serviceName, + fontSize: 15, + bold: true, + ), + ], + ), + ), + ) + ], + ), + ), + SizedBox( + height: 57, + ), + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + label: "Confirm", + disabled: widget.patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList.length == + 0, + onTap: () async { + await widget.model.insertPresPresOrder( + order: widget.patientERInsertPresOrderRequestModel); + if (widget.model.state != ViewState.ErrorLocal) { + widget.changePageViewIndex(0); + } + }, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart new file mode 100644 index 00000000..3f522a1f --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart @@ -0,0 +1,112 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_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/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/close_back.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:provider/provider.dart'; + +class NewHomeHealthCareStepTowPage extends StatefulWidget { + final Function(PickResult) onPick; + final double latitude; + final double longitude; + final PatientERInsertPresOrderRequestModel + patientERInsertPresOrderRequestModel; + final Function changePageViewIndex; + final HomeHealthCareViewModel model; + + const NewHomeHealthCareStepTowPage( + {Key key, + this.onPick, + this.latitude, + this.longitude, + this.patientERInsertPresOrderRequestModel, + this.changePageViewIndex, + this.model}) + : super(key: key); + + @override + _NewHomeHealthCareStepTowPageState createState() => + _NewHomeHealthCareStepTowPageState(); +} + +class _NewHomeHealthCareStepTowPageState + extends State { + double latitude = 0; + double longitude = 0; + + @override + void initState() { + if (widget.patientERInsertPresOrderRequestModel.latitude == null) { + latitude = widget.latitude; + longitude = widget.longitude; + } else { + latitude = widget.patientERInsertPresOrderRequestModel.latitude; + longitude = widget.patientERInsertPresOrderRequestModel.longitude; + } + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + isShowDecPage: false, + body: PlacePicker( + apiKey: GOOGLE_API_KEY, + enableMyLocationButton: true, + automaticallyImplyAppBarLeading: false, + autocompleteOnTrailingWhitespace: true, + selectInitialPosition: true, + autocompleteLanguage: projectViewModel.currentLanguage, + enableMapTypeButton: true, + onPlacePicked: (PickResult result) { + print(result.adrAddress); + widget.changePageViewIndex(3); + }, + selectedPlaceWidgetBuilder: + (_, selectedPlace, state, isSearchBarFocused) { + print("state: $state, isSearchBarFocused: $isSearchBarFocused"); + return isSearchBarFocused + ? Container() + : FloatingCard( + bottomPosition: 0.0, + leftPosition: 0.0, + rightPosition: 0.0, + width: 500, + borderRadius: BorderRadius.circular(12.0), + child: state == SearchingState.Searching + ? Center(child: CircularProgressIndicator()) + : Container( + margin: EdgeInsets.all(12), + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.patientERInsertPresOrderRequestModel + .latitude = + selectedPlace.geometry.location.lat; + widget.patientERInsertPresOrderRequestModel + .longitude = + selectedPlace.geometry.location.lng; + }); + widget.changePageViewIndex(3); + }, + label: TranslationBase.of(context).next, + ), + ), + ); + }, + initialPosition: LatLng(latitude, longitude), + useCurrentLocation: true, + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart index 40fb6125..87a33c6d 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart @@ -4,12 +4,15 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth 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/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; import '../StepsWidget.dart'; import 'new_Home_health_care_step_one_page.dart'; @@ -18,7 +21,6 @@ class NewHomeHealthCarePage extends StatefulWidget { NewHomeHealthCarePage({this.model}); final HomeHealthCareViewModel model; - @override _NewHomeHealthCarePageState createState() => _NewHomeHealthCarePageState(); } @@ -27,7 +29,8 @@ class _NewHomeHealthCarePageState extends State with TickerProviderStateMixin { PageController _controller; int _currentIndex = 1; - int pageSelected = 2; + double _latitude; + double _longitude; PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel = new PatientERInsertPresOrderRequestModel(); @@ -36,8 +39,19 @@ class _NewHomeHealthCarePageState extends State void initState() { super.initState(); _controller = new PageController(); + _getCurrentLocation(); } + _getCurrentLocation() async { + await getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); + } + @override void dispose() { super.dispose(); @@ -285,6 +299,18 @@ class _NewHomeHealthCarePageState extends State patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, model: widget.model, ), + NewHomeHealthCareStepTowPage( + latitude: _latitude, + longitude: _longitude, + changePageViewIndex: _changeCurrentTab, + patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, + model: widget.model, + ), + NewHomeHealthCareStepThreePage( + changePageViewIndex: _changeCurrentTab, + patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, + model: widget.model, + ) ], ), diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart index ec3020c5..370544d0 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart @@ -13,7 +13,7 @@ class StepsWidget extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return projectViewModel.isArabic? Stack( + return !projectViewModel.isArabic? Stack( children: [ Container( height: 50, diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index f717ba8e..ea98921d 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -1,35 +1,32 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_index_page.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/my_web_view.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart'; -import 'package:diplomaticquarterapp/pages/Blood/advance_payment_page.dart'; import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; - import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; - import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; +import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.dart'; -import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:webview_flutter/webview_flutter.dart'; - -import 'h2o/h2o_page.dart'; class AllHabibMedicalService extends StatefulWidget { @override @@ -37,6 +34,17 @@ class AllHabibMedicalService extends StatefulWidget { } class _AllHabibMedicalServiceState extends State { + AppSharedPreferences sharedPref = AppSharedPreferences(); + AuthenticatedUser authUser = new AuthenticatedUser(); + + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + getAuthUser(); + }); + super.initState(); + } + @override Widget build(BuildContext context) { return AppScaffold( @@ -177,7 +185,10 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage(page: EReferralIndexPage()), + FadePage( + page: authUser.patientID == null + ? EReferralIndexPage() + : EReferralPage()), ), imageLocation: 'assets/images/ereferral_service_icon.png', title: 'E-Referral', @@ -214,8 +225,9 @@ class _AllHabibMedicalServiceState extends State { title: TranslationBase.of(context).todoList, ), ServicesContainer( - onTap: () => Navigator.of(context).pushNamed( - SYMPTOM_CHECKER, + onTap: () => Navigator.push( + context, + FadePage(page: SymptomInfo()), ), imageLocation: 'assets/images/new-design/body_icon.png', title: 'Symptom Checker'), @@ -315,4 +327,15 @@ class _AllHabibMedicalServiceState extends State { ), ); } + + getAuthUser() async { + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + setState(() { + authUser = data; + }); + print(authUser.patientID); + } + } } diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 74cba568..3e9ae0cd 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -235,7 +235,7 @@ class _DocAvailableAppointmentsState extends State return children; }, ), - onDaySelected: (date, events,holidays) { + onDaySelected: (date, events,format) { _onDaySelected(date, events); _animationController.forward(from: 0.0); }, @@ -385,8 +385,8 @@ class _DocAvailableAppointmentsState extends State color: _calendarController.isSelected(date) ? Colors.green[400] : _calendarController.isToday(date) - ? Colors.brown[300] - : Colors.blue[400], + ? Colors.brown[300] + : Colors.blue[400], ), width: 40.0, height: 40.0, diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart index 264f828a..9f2418fd 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -348,8 +348,8 @@ class _CovidTimeSlotsState extends State return children; }, ), - onDaySelected: (date, events,holidays) { - _onDaySelected(date, events); + onDaySelected: (date, event,formats) { + _onDaySelected(date, event,); _animationController.forward(from: 0.0); }, onVisibleDaysChanged: _onVisibleDaysChanged, diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart index ee7ed8fa..b99596c8 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart @@ -63,7 +63,6 @@ class _PickupLocationState extends State { _longitude = 0; _latitude = 0; }); - // currentLocation = LatLng(position.latitude, position.longitude); } @override @@ -364,7 +363,6 @@ class _PickupLocationState extends State { ), ], ), - //TODO show dialog projects SizedBox( height: 45, diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index e3538277..db2b0643 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -172,7 +172,7 @@ class _AppointmentDetailsState extends State physics: NeverScrollableScrollPhysics(), children: [ AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton), - DocAvailableAppointments(doctor: getDoctorObject()) + DocAvailableAppointments(doctor: getDoctorObject(), isLiveCareAppointment: widget.appo.isLiveCareAppointment) ], controller: _tabController, ), diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 7c20b53d..9ba57084 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -139,7 +139,7 @@ class _ToDoState extends State { flex: 3, child: Container( margin: EdgeInsets.only( - top: 20.0, left: 20.0, right: 20.0), + top: 10.0, left: 20.0, right: 20.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index a44d8b3d..a6936083 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -69,7 +68,7 @@ class _PaymentMethodState extends State { child: Container( child: InkWell( onTap: () { - updateSelectedPaymentMethod("SADAD"); + updateSelectedPaymentMethod("VISA"); }, child: Card( elevation: 3.0, @@ -77,7 +76,7 @@ class _PaymentMethodState extends State { color: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "SADAD" + side: selectedPaymentMethod == "VISA" ? BorderSide( color: Colors.green, width: 5.0) : BorderSide( @@ -88,12 +87,41 @@ class _PaymentMethodState extends State { padding: EdgeInsets.all(7.0), width: MediaQuery.of(context).size.width * 0.45, child: Image.asset( - "assets/images/new-design/sadad.png"), + "assets/images/new-design/visa.png"), ), ), ), ), ), +// Expanded( +// child: Container( +// child: InkWell( +// onTap: () { +// updateSelectedPaymentMethod("SADAD"); +// }, +// child: Card( +// elevation: 3.0, +// margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), +// color: Colors.white, +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(10), +// side: selectedPaymentMethod == "SADAD" +// ? BorderSide( +// color: Colors.green, width: 5.0) +// : BorderSide( +// color: Colors.transparent, width: 0.0), +// ), +// child: Container( +// height: 120.0, +// padding: EdgeInsets.all(7.0), +// width: MediaQuery.of(context).size.width * 0.45, +// child: Image.asset( +// "assets/images/new-design/sadad.png"), +// ), +// ), +// ), +// ), +// ), ], ), ), @@ -102,35 +130,6 @@ class _PaymentMethodState extends State { child: Flex( direction: Axis.horizontal, children: [ - Expanded( - child: Container( - child: InkWell( - onTap: () { - updateSelectedPaymentMethod("VISA"); - }, - child: Card( - elevation: 3.0, - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "VISA" - ? BorderSide( - color: Colors.green, width: 5.0) - : BorderSide( - color: Colors.transparent, width: 0.0), - ), - child: Container( - height: 120.0, - padding: EdgeInsets.all(7.0), - width: MediaQuery.of(context).size.width * 0.45, - child: Image.asset( - "assets/images/new-design/visa.png"), - ), - ), - ), - ), - ), Expanded( child: Container( child: InkWell( @@ -160,14 +159,6 @@ class _PaymentMethodState extends State { ), ), ), - ], - ), - ), - Container( - margin: EdgeInsets.only(top: 25.0), - child: Flex( - direction: Axis.horizontal, - children: [ Expanded( child: Container( child: InkWell( @@ -200,6 +191,13 @@ class _PaymentMethodState extends State { ], ), ), + Container( + margin: EdgeInsets.only(top: 25.0), + child: Flex( + direction: Axis.horizontal, + children: [], + ), + ), ], ), ), diff --git a/lib/pages/ToDoList/widgets/paymentDialog.dart b/lib/pages/ToDoList/widgets/paymentDialog.dart index d79a1ead..2fbcbcc1 100644 --- a/lib/pages/ToDoList/widgets/paymentDialog.dart +++ b/lib/pages/ToDoList/widgets/paymentDialog.dart @@ -24,7 +24,7 @@ class _PaymentDialogState extends State { shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), child: Container( - height: MediaQuery.of(context).size.height * 0.67, + height: 510.0, width: 450.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 8cd9923f..02e195c2 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -99,10 +99,10 @@ class _HomePageState extends State { Container( margin: EdgeInsets.only( top: 15.0, left: 3.5, right: 3.5), - // child: SvgPicture.asset( - // 'assets/images/new-design/covid-19-car.svg', - // width: 45.0, - // height: 45.0), + child: SvgPicture.asset( + 'assets/images/new-design/covid-19-car.svg', + width: 45.0, + height: 45.0), ), Container( margin: EdgeInsets.only( @@ -176,11 +176,11 @@ class _HomePageState extends State { .withOpacity(0.3), borderRadius: BorderRadius.all( Radius.circular(5))), - // child: SvgPicture.asset( - // projectViewModel.isArabic - // ? 'assets/images/new-design/livecare_arabic_logo.svg' - // : 'assets/images/new-design/liveCare_white_logo.svg', - // ), + child: SvgPicture.asset( + projectViewModel.isArabic + ? 'assets/images/new-design/livecare_arabic_logo.svg' + : 'assets/images/new-design/liveCare_white_logo.svg', + ), ), ), ), diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 439622b7..aa8e25d1 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -123,7 +123,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { AppGlobal.context = context; }); _requestIOSPermissions(); - pageController = PageController(keepPage: true); + pageController = PageController(keepPage: true); // _firebaseMessaging.setAutoInitEnabled(true); // // if (Platform.isIOS) { diff --git a/lib/pages/livecare/widgets/clinic_card.dart b/lib/pages/livecare/widgets/clinic_card.dart index 99c4b271..56613034 100644 --- a/lib/pages/livecare/widgets/clinic_card.dart +++ b/lib/pages/livecare/widgets/clinic_card.dart @@ -36,13 +36,13 @@ class _State extends State { return Row( children: [ Card( - margin: EdgeInsets.fromLTRB(13.0, 10.0, 8.0, 8.0), + margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0), color: widget.isSelected ? Colors.blue : Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), ), child: Container( - width: MediaQuery.of(context).size.width * 0.8, + width: MediaQuery.of(context).size.width * 0.75, padding: EdgeInsets.all(12.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index c1f5eb75..083af9f7 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -17,8 +17,11 @@ 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/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; @@ -81,7 +84,13 @@ class _clinic_listState extends State { service .getERAppointmentFees(selectedClinicID, context) .then((res) { - erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res); + if (res['HasAppointment'] == true) { + isError = true; + showLiveCareCancelDialog(res['ErrorEndUserMessage'], res); + } else { + erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res); + isError = false; + } }) .catchError((err) { print(err); @@ -97,10 +106,57 @@ class _clinic_listState extends State { }); } + showLiveCareCancelDialog(String msg, res) { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: msg, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => + {cancelAppointment(res)}, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + + cancelAppointment(res) { + AppoitmentAllHistoryResultList appo = AppoitmentAllHistoryResultList(); + appo.clinicID = res['ClinicID']; + appo.doctorID = res['DoctorID']; + appo.endTime = res['EndTime']; + appo.projectID = res['ProjectID']; + appo.startTime = res['StrAppointmentDate']; + appo.appointmentNo = res['AppointmentID']; + appo.isLiveCareAppointment = true; + appo.originalClinicID = 0; + appo.originalProjectID = res['ProjectID']; + appo.appointmentDate = res['AppointmentDate']; + + ConfirmDialog.closeAlertDialog(context); + DoctorsListService service = new DoctorsListService(); + service + .cancelAppointment(appo, context) + .then((res) { + print(res); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + startLiveCare(); + }); + } + getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) { LiveCareService service = new LiveCareService(); service.getERAppointmentTime(selectedClinicID, context).then((res) { - print(res['WatingtimeInteger']); + print(res); showLiveCarePaymentDialog( getERAppointmentFeesList, res['WatingtimeInteger']); }).catchError((err) { diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index cc5df0a6..8847aaa1 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -247,8 +247,8 @@ class ConfirmPaymentPage extends StatelessWidget { DoctorsListService service = new DoctorsListService(); service .checkPaymentStatus( - Utils.getAppointmentTransID( - appo.projectID, appo.clinicID, appo.appointmentNo), + Utils.getAdvancePaymentTransID( + appo.projectID, authenticatedUser.patientID), AppGlobal.context) .then((res) { print("Printing Payment Status Reponse!!!!"); @@ -302,5 +302,4 @@ class ConfirmPaymentPage extends StatelessWidget { Future navigateToHome(context) async { Navigator.of(context).pushNamed(HOME); } - } diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index e7d75e7f..61f22aca 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/monthly_reports.dart'; +import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart'; import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; @@ -407,10 +408,10 @@ class _MedicalProfilePageState extends State { flex: 1, child: InkWell( //TODO -// onTap: () { -// Navigator.push( -// context, FadePage(page: DoctorHomePage())); -// }, + onTap: () { + Navigator.push( + context, FadePage(page: SmartWatchInstructions())); + }, child: MedicalProfileItem( title: TranslationBase.of(context) .smartWatches, diff --git a/lib/pages/medical/smart_watch_health_data/health_data_list.dart b/lib/pages/medical/smart_watch_health_data/health_data_list.dart new file mode 100644 index 00000000..2f9a3e60 --- /dev/null +++ b/lib/pages/medical/smart_watch_health_data/health_data_list.dart @@ -0,0 +1,145 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class HealthDataList extends StatefulWidget { + @override + _HealthDataListState createState() => _HealthDataListState(); +} + +class _HealthDataListState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "Smartwatches", + isShowAppBar: true, + body: Container( + height: MediaQuery.of(context).size.height, + margin: EdgeInsets.all(20.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + child: Image.asset( + "assets/images/SmartWatches/heartrate_icon.png", + width: 60.0, + height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Heart Rate", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + Row( + children: [ + Container( + child: Image.asset( + "assets/images/SmartWatches/sleep_data.png", + width: 60.0, + height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Sleep Data", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + Row( + children: [ + Container( + child: Image.asset( + "assets/images/SmartWatches/heartrate_icon.png", + width: 60.0, + height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Steps", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + Row( + children: [ + Container( + child: Image.asset( + "assets/images/SmartWatches/heartrate_icon.png", + width: 60.0, + height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Distance", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + Row( + children: [ + Container( + child: Image.asset( + "assets/images/SmartWatches/heartrate_icon.png", + width: 60.0, + height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Energy", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + ], + ), + ), + ), + bottomSheet: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.1, + color: Colors.grey[100], + child: Column( + children: [ + Divider( + color: Colors.transparent, + ), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + onTap: () { +// launch(model.radImageURL); + }, + label: 'Sync Health Data', + backgroundColor: Colors.grey[800], + ), + ), + ], + ), + )); + } +} diff --git a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart new file mode 100644 index 00000000..eb0c1675 --- /dev/null +++ b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart @@ -0,0 +1,819 @@ +import 'dart:io'; + +import 'package:carousel_slider/carousel_slider.dart'; +import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/health_data_list.dart'; +import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class SmartWatchInstructions extends StatefulWidget { + @override + _SmartWatchInstructionsState createState() => _SmartWatchInstructionsState(); +} + +class _SmartWatchInstructionsState extends State { + CarouselController buttonCarouselController = CarouselController(); + + bool hasAlreadySynced = false; + + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + getLastPatientRecord(context); + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "Sync Health Data", + isShowAppBar: true, + body: Container( + child: Platform.isIOS + ? _getAppleWatchInstructions() + : _getGoogleWatchInstructions(), + )); + } + + _getAppleWatchInstructions() { + return SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: CarouselSlider( + carouselController: buttonCarouselController, + options: CarouselOptions( + enableInfiniteScroll: false, + viewportFraction: 0.95, + height: MediaQuery.of(context).size.height * 0.9), + items: [1, 2].map((i) { + return Builder( + builder: (BuildContext context) { + return Container( + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.symmetric(horizontal: 5.0), + child: Card( + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white.withOpacity(1.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: i == 1 + ? Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Supported Smartwatches", + style: TextStyle( + fontSize: 22.0, + fontWeight: FontWeight.bold, + fontFamily: "WorkSans")), + ), + Container( + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/apple-watch-1.jpeg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 1", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/apple-watch-2.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 2", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/apple-watch-3.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 3", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/apple-watch-4.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 4", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/apple-watch-5.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 5", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/Apple-Watch-6.png", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 6", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/miBand3.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text("Mi Band 3", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/miBand4.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text("Mi Band 4", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.fromLTRB( + 10.0, 30.0, 10.0, 10.0), + child: Text( + "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", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "Before syncing data, please make sure that you have followed the instructions properly", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + buttonCarouselController.nextPage(); + }, + child: Text("CONTINUE", + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ], + ) + : Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Watch Instructions:", + style: TextStyle( + fontSize: 22.0, + fontWeight: FontWeight.bold, + fontFamily: "WorkSans")), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "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", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.fromLTRB( + 10.0, 20.0, 10.0, 10.0), + child: Text( + "Before syncing data, please make sure that following instructions are met: ", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.fromLTRB( + 10.0, 20.0, 10.0, 10.0), + child: Text( + "1. Make sure that you have installed 'Health' App & 'Watch' App from Apple Store.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "2. Make sure that your Apple Watch is connected with the Watch & Health Apps.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "3. Make sure that data like heart rate, steps, distance etc. are being shown on your health app.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.fromLTRB( + 15.0, 110.0, 15.0, 15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + buttonCarouselController.nextPage(); + }, + child: Text("SYNC HEALTH DATA", + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + hasAlreadySynced ? Container( + margin: EdgeInsets.fromLTRB( + 15.0, 0.0, 15.0, 15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + _openHealthDataList(); + }, + child: Text("ALREADY SYNCED", + style: TextStyle(fontSize: 18.0)), + ), + ), + ): Container(), + ], + ), + )); + }, + ); + }).toList(), + ), + ) + ], + ), + ); + } + + _getGoogleWatchInstructions() { + return SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: CarouselSlider( + carouselController: buttonCarouselController, + options: CarouselOptions( + enableInfiniteScroll: false, + viewportFraction: 0.95, + height: MediaQuery.of(context).size.height * 0.9), + items: [1, 2].map((i) { + return Builder( + builder: (BuildContext context) { + return Container( + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.symmetric(horizontal: 5.0), + child: Card( + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white.withOpacity(1.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: i == 1 + ? Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Supported Smartwatches", + style: TextStyle( + fontSize: 22.0, + fontWeight: FontWeight.bold, + fontFamily: "WorkSans")), + ), + Container( + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/huawei-watch-2.png", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Huawei Watch 2", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/ticwatche2.png", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Mobovi TicWatch E2", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/huawei-watch-2-classic.png", + width: 70.0, + height: 70.0), + Container( + child: Text("Huawei Watch", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/ticwatche2.png", + width: 70.0, + height: 70.0), + Container( + child: Text("Fossil Sport", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/misfit-vapor-2.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "MisFit Vapor 2", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/lg-watch-sport.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "LG Watch Sport", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/miBand3.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text("Mi Band 3", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/miBand4.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text("Mi Band 4", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + InkWell( + onTap: () { + launch( + "https://wearos.google.com/#find-your-watch"); + }, + child: Container( + margin: EdgeInsets.only(top: 20.0), + child: Text( + "More Supported Smartwatches...", + style: TextStyle( + fontSize: 17.0, + color: Colors.blue, + decoration: + TextDecoration.underline)), + ), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "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", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "Before syncing data, please make sure that you have followed the instructions properly", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + buttonCarouselController.nextPage(); + }, + child: Text("CONTINUE", + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ], + ) + : Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Watch Instructions:", + style: TextStyle( + fontSize: 22.0, + fontWeight: FontWeight.bold, + fontFamily: "WorkSans")), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "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", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "Before syncing data, please make sure that following instructions are met: ", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "1. Make sure that you have installed 'WearOS' & 'Google Fit' apps from Google PlayStore.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "2. Make sure that you have installed your watch related apps from Google PlayStore.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "3. Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "4. Make sure that your smart watch apps are linked/associated with Google Fit App.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.fromLTRB( + 15.0, 95.0, 15.0, 15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + buttonCarouselController.nextPage(); + }, + child: Text("SYNC HEALTH DATA", + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + hasAlreadySynced ? Container( + margin: EdgeInsets.fromLTRB( + 15.0, 0.0, 15.0, 15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + _openHealthDataList(); + }, + child: Text("ALREADY SYNCED", + style: TextStyle(fontSize: 18.0)), + ), + ), + ) : Container(), + ], + ), + )); + }, + ); + }).toList(), + ), + ) + ], + ), + ); + } + + getLastPatientRecord(BuildContext context) { + SmartWatchIntegrationService service = new SmartWatchIntegrationService(); + service.getLastPatientRecord(context).then((res) { + if (res['MessageStatus'] == 1) { + print(res['Med_GetPatientLastRecordList']); + setState(() { + if (res['Med_GetPatientLastRecordList'] != null) + hasAlreadySynced = true; + else + hasAlreadySynced = false; + }); + } else {} + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + _openHealthDataList() { + Navigator.push( + context, MaterialPageRoute(builder: (context) => HealthDataList())); + } +} diff --git a/lib/pages/symptom-checker/info.dart b/lib/pages/symptom-checker/info.dart new file mode 100644 index 00000000..7906ba1a --- /dev/null +++ b/lib/pages/symptom-checker/info.dart @@ -0,0 +1,131 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/routes.dart'; + +class SymptomInfo extends StatefulWidget { + @override + _SymptomInfo createState() => new _SymptomInfo(); +} + +class _SymptomInfo extends State { + bool checkValue = false; + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).termsService, + isShowAppBar: true, + body: Padding( + padding: EdgeInsets.all(20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).beforeUsing, + fontWeight: FontWeight.bold, + fontSize: 14, + // textAlign: TextAlign.center, + ), + Container( + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + ), + padding: EdgeInsets.all(30), + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText(TranslationBase.of(context).remeberthat, + fontSize: 16), + SizedBox( + height: 10, + ), + AppText( + '1. ' + TranslationBase.of(context).checkDiagnosis, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText(TranslationBase.of(context).informational, + fontSize: 16), + SizedBox( + height: 10, + ), + AppText( + '2. ' + TranslationBase.of(context).notUseInEmbergency, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + TranslationBase.of(context).notUseInEmbergencyDetails, + fontSize: 16), + AppText( + TranslationBase.of(context).notUseInEmbergencyCall, + underline: true, + color: Colors.blue, + fontSize: 16), + SizedBox( + height: 10, + ), + AppText( + '3.' + TranslationBase.of(context).dataSafe, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText(TranslationBase.of(context).dataSafeInfo, + fontSize: 16), + ], + ), + ), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: CheckboxListTile( + title: AppText(TranslationBase.of(context).accept), + value: checkValue, + onChanged: (newValue) { + setState(() { + this.checkValue = newValue; + }); + }, + controlAffinity: ListTileControlAffinity + .leading, // <-- leading Checkbox + ), + ), + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).next, + () => { + if (checkValue == true) + { + Navigator.of(context).pushNamed( + SELECT_GENDER, + ) + } + }, + color: checkValue == true + ? Colors.black + : Colors.grey, + textColor: Colors.white, + )) + ], + ), + ], + )) + ], + ))); + } +} diff --git a/lib/pages/symptom-checker/select-gender.dart b/lib/pages/symptom-checker/select-gender.dart new file mode 100644 index 00000000..0b8be29d --- /dev/null +++ b/lib/pages/symptom-checker/select-gender.dart @@ -0,0 +1,124 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:flutter_xlider/flutter_xlider.dart'; + +class SelectGender extends StatefulWidget { + @override + _SelectGender createState() => new _SelectGender(); +} + +class _SelectGender extends State { + double slider = 22; + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).gender, + isShowAppBar: true, + body: Padding( + padding: EdgeInsets.all(20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + //TranslationBase.of(context).beforeUsing, + TranslationBase.of(context).selectGender, + fontWeight: FontWeight.bold, + fontSize: 20, + // textAlign: TextAlign.center, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText(TranslationBase.of(context).iAma, fontSize: 16), + SizedBox( + height: 10, + ), + Row( + children: [ + Expanded( + child: Container( + height: 200, + width: 150, + child: Card( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(15.0), + ), + shadowColor: Colors.red, + child: Image.asset( + 'assets/images/female_face.png')))), + Expanded( + child: Container( + height: 200, + width: 150, + child: Card( + shadowColor: Colors.red, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(15.0), + ), + child: Image.asset( + 'assets/images/male_face.png')))) + ], + ), + AppText(TranslationBase.of(context).selectAge, + fontSize: 25), + SizedBox( + height: 10, + ), + AppText( + TranslationBase.of(context).iAm + + ' ' + + slider.toString() + + ' ' + + TranslationBase.of(context) + .yearOld, //TranslationBase.of(context).remeberthat, + fontSize: 16), + SizedBox( + height: 30, + ), + FlutterSlider( + values: [slider], + max: 90, + min: 14, + onDragCompleted: (handlerIndex, lowerValue, upperValue) { + print(lowerValue); + print(upperValue); + setState(() { + slider = upperValue; + }); + }, + ), + ], + ), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).next, + () => { + Navigator.of(context).pushNamed( + SYMPTOM_CHECKER, + ) + }, + )) + ], + ), + ], + )) + ], + ))); + } +} diff --git a/lib/pages/symptom-checker/symtom-checker.dart b/lib/pages/symptom-checker/symtom-checker.dart index f7475abf..c088caab 100644 --- a/lib/pages/symptom-checker/symtom-checker.dart +++ b/lib/pages/symptom-checker/symtom-checker.dart @@ -1,3 +1,5 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -10,7 +12,10 @@ class SymptomChecker extends StatelessWidget { isShowAppBar: true, appBarTitle: 'Symptom Checker', body: Center( - child: SvgPicture.string( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + SvgPicture.string( ''' @@ -38,6 +43,19 @@ class SymptomChecker extends StatelessWidget { -'''))); +'''), + Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).next, + () => {}, + )) + ], + )) + ], + ))); } } diff --git a/lib/routes.dart b/lib/routes.dart index 8d109983..ada7c54c 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -10,6 +10,8 @@ import 'package:diplomaticquarterapp/pages/login/login.dart'; import 'package:diplomaticquarterapp/pages/login/register.dart'; import 'package:diplomaticquarterapp/pages/family/add-family_type.dart'; import 'package:diplomaticquarterapp/pages/family/add-family-member.dart'; +import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; +import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/symtom-checker.dart'; const String INIT_ROUTE = '/'; @@ -27,6 +29,8 @@ const String ADD_FAMILY_MEMBER_TYPE = 'add-family-member-type'; const String ADD_FAMILY_MEMBER = 'add-family-member'; const String LIVE_CARE = 'live-care'; const String SYMPTOM_CHECKER = 'symptom-checker'; +const String SYMPTOM_CHECKER_INFO = 'symptom-checker-info'; +const String SELECT_GENDER = 'select-gender'; var routes = { HOME: (_) => LandingPage(), WELCOME_LOGIN: (_) => WelcomeLogin(), @@ -40,5 +44,7 @@ var routes = { ADD_FAMILY_MEMBER_TYPE: (_) => AddFamilyMemberType(), ADD_FAMILY_MEMBER: (_) => AddMember(), LIVE_CARE: (_) => LiveCareHome(), - SYMPTOM_CHECKER: (_) => SymptomChecker() + SYMPTOM_CHECKER: (_) => SymptomChecker(), + SYMPTOM_CHECKER_INFO: (_) => SymptomInfo(), + SELECT_GENDER: (_) => SelectGender() }; diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 4b5dc264..39117783 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -66,7 +66,8 @@ class DoctorsListService extends BaseService { // "Latitude": 0, // "Longitude": 0, // "License": true, - "IsVoiceCommand": doctorId != null && doctorId.length > 0 ? true : false, + "SearchForVoiceCommand": + doctorId != null && doctorId.length > 0 ? true : false, "DoctorIDsList": doctorId, "Latitude": lat != null ? lat.toString() : 0, "Longitude": long != null ? long.toString() : 0, @@ -212,8 +213,8 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorScheduledFreeSlots( - int docID, int clinicID, int projectID, int serviceID, BuildContext context) async { + Future getDoctorScheduledFreeSlots(int docID, int clinicID, + int projectID, int serviceID, BuildContext context) async { Map request; var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); @@ -241,10 +242,10 @@ class DoctorsListService extends BaseService { await baseAppClient.post(GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } @@ -301,8 +302,14 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future insertLiveCareScheduleAppointment(int docID, int clinicID, int projectID, int serviceID, - String selectedTime, String selectedDate, BuildContext context) async { + Future insertLiveCareScheduleAppointment( + int docID, + int clinicID, + int projectID, + int serviceID, + String selectedTime, + String selectedDate, + BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -348,10 +355,10 @@ class DoctorsListService extends BaseService { await baseAppClient.post(INSERT_LIVECARE_SCHEDULE_APPOINTMENT, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } @@ -437,10 +444,10 @@ class DoctorsListService extends BaseService { await baseAppClient.post(GET_PATIENT_SHARE_LIVECARE, onSuccess: (response, statusCode) async { - localRes = response['OnlineCheckInAppointments'][0]; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response['OnlineCheckInAppointments'][0]; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } @@ -519,8 +526,8 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future confirmAppointment( - int appoNo, int clinicID, int projectID, bool isLiveCare, BuildContext context) async { + Future confirmAppointment(int appoNo, int clinicID, int projectID, + bool isLiveCare, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -564,9 +571,8 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - - Future insertVIDARequest( - int appoNo, int clinicID, int projectID, int serviceID, int docID, BuildContext context) async { + Future insertVIDARequest(int appoNo, int clinicID, int projectID, + int serviceID, int docID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -613,10 +619,10 @@ class DoctorsListService extends BaseService { await baseAppClient.post(INSERT_VIDA_REQUEST, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } diff --git a/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart b/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart new file mode 100644 index 00000000..315249c8 --- /dev/null +++ b/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart @@ -0,0 +1,54 @@ +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'; + +class SmartWatchIntegrationService extends BaseService { + AppSharedPreferences sharedPref = AppSharedPreferences(); + AppGlobal appGlobal = new AppGlobal(); + + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + Future getLastPatientRecord(BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "License": true + }; + + dynamic localRes; + + await baseAppClient.post(GET_PATIENT_LAST_RECORD, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + + } +} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 84eddbbb..2b794af9 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:diplomaticquarterapp/config/localized_values.dart'; +import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart'; import 'package:flutter/foundation.dart' show SynchronousFuture; import 'package:flutter/material.dart'; @@ -95,9 +96,11 @@ class TranslationBase { String get confirm => localizedValues['confirm'][locale.languageCode]; - String get confirmLiveCare => localizedValues['confirmLiveCare'][locale.languageCode]; + String get confirmLiveCare => + localizedValues['confirmLiveCare'][locale.languageCode]; - String get waitingForDoctor => localizedValues['waitingForDoctor'][locale.languageCode]; + String get waitingForDoctor => + localizedValues['waitingForDoctor'][locale.languageCode]; String get confirmLater => localizedValues['confirmLater'][locale.languageCode]; @@ -674,15 +677,23 @@ class TranslationBase { localizedValues['DoctorResponses'][locale.languageCode]; String get newDes => localizedValues['New'][locale.languageCode]; String get all => localizedValues['All'][locale.languageCode]; - String get questionHere => localizedValues['QuestionHere'][locale.languageCode]; - String get viewDoctorResponses => localizedValues['ViewDoctorResponses'][locale.languageCode]; - String get serviceInformation => localizedValues['ServiceInformation'][locale.languageCode]; - String get homeHealthCare => localizedValues['HomeHealthCare'][locale.languageCode]; - String get homeHealthCareText => localizedValues['HomeHealthCareText'][locale.languageCode]; - String get loginRegister => localizedValues['LoginRegister'][locale.languageCode]; + String get questionHere => + localizedValues['QuestionHere'][locale.languageCode]; + String get viewDoctorResponses => + localizedValues['ViewDoctorResponses'][locale.languageCode]; + String get serviceInformationButton => + localizedValues['ServiceInformationButton'][locale.languageCode]; + String get serviceInformationTitle => + localizedValues['ServiceInformationTitle'][locale.languageCode]; + String get serviceInformation => + localizedValues['ServiceInformation'][locale.languageCode]; + String get homeHealthCare => + localizedValues['HomeHealthCare'][locale.languageCode]; + String get homeHealthCareText => + localizedValues['HomeHealthCareText'][locale.languageCode]; + String get loginRegister => + localizedValues['LoginRegister'][locale.languageCode]; String get orderLog => localizedValues['OrderLog'][locale.languageCode]; - String get serviceInformationButton => localizedValues['ServiceInformationButton'][locale.languageCode]; - String get serviceInformationTitle => localizedValues['ServiceInformationTitle'][locale.languageCode]; String get infoLab => localizedValues['info-lab'][locale.languageCode]; String get infoRadiology => localizedValues['info-radiology'][locale.languageCode]; @@ -695,6 +706,33 @@ class TranslationBase { String get recentlyViewed => localizedValues['recentlyViewed'][locale.languageCode]; String get bestSellers => localizedValues['bestSellers'][locale.languageCode]; String get deleteAllItems => localizedValues['deleteAllItems'][locale.languageCode]; + String get infoRadiology => + localizedValues['info-radiology'][locale.languageCode]; + + String get termsService => + localizedValues['TermsService'][locale.languageCode]; + String get beforeUsing => localizedValues['Beforeusing'][locale.languageCode]; + String get accept => localizedValues['accept'][locale.languageCode]; + String get dataSafeInfo => + localizedValues['data-safe-info'][locale.languageCode]; + String get dataSafe => localizedValues['data-safe'][locale.languageCode]; + String get informational => + localizedValues['informational'][locale.languageCode]; + String get checkDiagnosis => + localizedValues['check-diagnosis'][locale.languageCode]; + String get remeberthat => localizedValues['remeberthat'][locale.languageCode]; + String get notUseInEmbergency => + localizedValues['not-use-in-emerbency'][locale.languageCode]; + String get notUseInEmbergencyDetails => + localizedValues['not-use-in-emerbency-details'][locale.languageCode]; + String get notUseInEmbergencyCall => + localizedValues['not-use-in-emerbency-details-call'][locale.languageCode]; + String get selectGender => + localizedValues['select-gender'][locale.languageCode]; + String get iAma => localizedValues['i-am-a'][locale.languageCode]; + String get selectAge => localizedValues['select-age'][locale.languageCode]; + String get iAm => localizedValues['i-am'][locale.languageCode]; + String get yearOld => localizedValues['years-old'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/data_display/text.dart b/lib/widgets/data_display/text.dart index 4b9fc551..215db9ff 100644 --- a/lib/widgets/data_display/text.dart +++ b/lib/widgets/data_display/text.dart @@ -257,11 +257,17 @@ class _TextsState extends State { hidden = !hidden; }); }, - child: Text(hidden ? "Read More" : "Read less", - style: _getFontStyle().copyWith( - color: Theme.of(context).primaryColor, - fontWeight: FontWeight.w800, - fontFamily: "WorkSans")), + child: Text( + hidden ? "Read More" : "Read less", + style: _getFontStyle().copyWith( + color: Theme.of(context).primaryColor, + fontWeight: FontWeight.w800, + fontFamily: + Localizations.localeOf(context).languageCode == 'ar' + ? 'Cairo' + : 'WorkSans', + ), + ), ), ), ], diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 31005606..f6ac453a 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -51,7 +51,8 @@ class AppScaffold extends StatelessWidget { this.floatingActionButton, this.title, this.description, - this.isShowDecPage = true, this.isBottomBar,this.backgroundColor}); + this.isShowDecPage = true, + this.isBottomBar,this.backgroundColor}); @override Widget build(BuildContext context) { @@ -69,7 +70,8 @@ class AppScaffold extends StatelessWidget { ), title: Text(authenticatedUserObject.isLogin ? appBarTitle.toUpperCase() - : TranslationBase.of(context).serviceInformationTitle),leading: Builder( + : TranslationBase.of(context).serviceInformationTitle), + leading: Builder( builder: (BuildContext context) { return ArrowBack(); }, @@ -80,7 +82,10 @@ class AppScaffold extends StatelessWidget { icon: Icon(FontAwesomeIcons.home), color: Colors.white, onPressed: () { - Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route r) => false); + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => LandingPage()), + (Route r) => false); }, ), ], @@ -91,14 +96,14 @@ class AppScaffold extends StatelessWidget { title: appBarTitle, description: description, ) - :baseViewModel != null - ? NetworkBaseView( - child: buildBodyWidget(), - baseViewModel: baseViewModel, - ) - : buildBodyWidget(), + : baseViewModel != null + ? NetworkBaseView( + child: buildBodyWidget(), + baseViewModel: baseViewModel, + ) + : buildBodyWidget(), bottomSheet: bottomSheet, - floatingActionButton: floatingActionButton ?? floatingActionButton, + //floatingActionButton: floatingActionButton ?? floatingActionButton, // bottomNavigationBar: // this.isBottomBar == true ? BottomBarSearch() : SizedBox() // floatingActionButton: FloatingSearchButton(), diff --git a/lib/widgets/pickupLocation/PickupLocationFromMap.dart b/lib/widgets/pickupLocation/PickupLocationFromMap.dart index 2e34ad3e..d8c93441 100644 --- a/lib/widgets/pickupLocation/PickupLocationFromMap.dart +++ b/lib/widgets/pickupLocation/PickupLocationFromMap.dart @@ -34,9 +34,10 @@ class PickupLocationFromMap extends StatelessWidget { body: PlacePicker( apiKey: GOOGLE_API_KEY, enableMyLocationButton: true, - + automaticallyImplyAppBarLeading: false, autocompleteLanguage: projectViewModel.currentLanguage, enableMapTypeButton: true, + selectInitialPosition: true, onPlacePicked: (PickResult result) { print(result.adrAddress); onPick(result); diff --git a/pubspec.yaml b/pubspec.yaml index 8155dc59..f43d4d93 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -70,6 +70,7 @@ dependencies: # Notification Banner dropdown_banner: ^1.4.0 + flutter_xlider: ^3.4.0 # flutter_local_notifications: # charts @@ -78,6 +79,8 @@ dependencies: #image banner slider carousel_slider: ^2.3.1 + google_maps_flutter: ^1.0.3 + # Qr code Scanner TODO fix it #barcode_scan: ^3.0.1 @@ -180,9 +183,33 @@ flutter: fonts: - family: WorkSans fonts: - - asset: assets/fonts/Work_Sans/WorkSans-Regular.ttf - - asset: assets/fonts/Work_Sans/WorkSans-Bold.ttf - - asset: assets/fonts/Work_Sans/WorkSans-Bold.ttf + - asset: assets/fonts/en/WorkSans-Light/WorkSans-Light_0.eot + - asset: assets/fonts/en/WorkSans-Light/WorkSans-Light_0.otf + - asset: assets/fonts/en/WorkSans-Light/WorkSans-Light_0.ttf + - asset: assets/fonts/en/WorkSans-Light/WorkSans-Light_0.woff + weight: 300 + - asset: assets/fonts/en/WorkSans-Light/WorkSans-Regular.otf + - asset: assets/fonts/en/WorkSans-Light/WorkSans-Regular.ttf + - asset: assets/fonts/en/WorkSans-Light/WorkSans-Regular.woff + weight: 400 + - asset: assets/fonts/en/WorkSans-Bold/WorkSans-Bold.eot + - asset: assets/fonts/en/WorkSans-Bold/WorkSans-Bold.otf + - asset: assets/fonts/en/WorkSans-Bold/WorkSans-Bold.ttf + - asset: assets/fonts/en/WorkSans-Bold/WorkSans-Bold.woff + weight: 700 + + - family: Cairo + fonts: + - asset: assets/fonts/ar/Cairo-Light/Cairo-Light.eot + - asset: assets/fonts/ar/Cairo-Light/Cairo-Light.otf + - asset: assets/fonts/ar/Cairo-Light/Cairo-Light.ttf + - asset: assets/fonts/ar/Cairo-Light/Cairo-Light.woff + weight: 300 + + - asset: assets/fonts/ar/Cairo-Bold/Cairo-Bold.eot + - asset: assets/fonts/ar/Cairo-Bold/Cairo-Bold.otf + - asset: assets/fonts/ar/Cairo-Bold/Cairo-Bold.ttf + - asset: assets/fonts/ar/Cairo-Bold/Cairo-Bold.woff weight: 700 - family: DQIcons diff --git a/sleep_data.png b/sleep_data.png new file mode 100644 index 00000000..dc6661d6 Binary files /dev/null and b/sleep_data.png differ