From b0f0b8734515fe7dfa53467bae344e4b25a626d6 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Sep 2020 11:43:13 +0300 Subject: [PATCH] fix merge issues --- lib/config/config.dart | 3 +- lib/config/localized_values.dart | 12 - lib/core/service/client/base_app_client.dart | 12 +- .../service/medical/my_doctor_service.dart | 5 +- .../medical/my_doctor_view_model.dart | 5 +- lib/core/viewModels/project_view_model.dart | 4 +- .../Appointments/DoctorListResponse.dart | 4 +- lib/pages/MyAppointments/MyAppointments.dart | 105 ++++---- lib/pages/landing/landing_page.dart | 226 +++++++++--------- .../medical/doctor/doctor_home_page.dart | 2 +- 10 files changed, 183 insertions(+), 195 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index c9a37d70..0165cb1b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -43,7 +43,8 @@ const SEND_RAD_REPORT_EMAIL = const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; const GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC'; const GET_PATIENT_AppointmentHistory = - 'Services/Doctors.svc/REST/PateintHasAppoimentHistory'; + 'Services' + '/Doctors.svc/REST/PateintHasAppoimentHistory'; ///VITAL SIGN const GET_PATIENT_VITAL_SIGN = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index bc50d61c..696e2665 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -449,18 +449,6 @@ const Map> localizedValues = { "OrderDetails": {"en": "Order Details", "ar": "تفاصيل الطلب"}, "VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"}, "MonthlyReports": {"en": "Monthly Reports", "ar": "تقارير شهرية"}, - "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"}, "locationDialogMessage": {"en": "Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.", "ar": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."}, - "parking":{"en":"Parking","ar":"مواقف"}, - "alhabiServices":{"en":"HMG Service","ar":"خدمات الحبيب"}, - "parkingTitle":{"en":"Car service, car service, service to save parking information, return to it later, 1- By clicking on (Read the code), save the parking data. 2- By clicking on the button (view my car park), it shows you the car’s location in Google Maps. 3- Read another position by pressing the Clear Position Data button.","ar":" خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). "}, - "readBarcode":{"en":"Read Barcode","ar":"قراءة الكود"}, - "showMyPark":{"en":"Show My Park","ar":"عرض بارك"}, - "clearMyData":{"en":"clear My Data","ar":"امسح البيانات"}, - "floor":{"en":"Floor:","ar":"الطابق"}, - "gate":{"en":"Gate:","ar":"بوابة"}, - "building":{"en":"Building:","ar":"المبنى"}, - "branch":{"en":"Branch:","ar":"الفرع"}, - "emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"}, "km":{"en":"KMs:","ar":"كم"}, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 04bc88d6..e80d1e83 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -44,27 +44,27 @@ class BaseAppClient { ? body['PatientOutSA'] != null ? body['PatientOutSA'] : PATIENT_OUT_SA : PATIENT_OUT_SA; - if (body.containsKey('isDentalAllowedBackend')) { + // if (body.containsKey('isDentalAllowedBackend')) { body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') ? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend'] : IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND; - } + // } body['DeviceTypeID'] = DeviceTypeID; - if (body.containsKey('PatientType')) { + // if (body.containsKey('PatientType')) { body['PatientType'] = body.containsKey('PatientType') ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE : PATIENT_TYPE; - } + // } - if (body.containsKey('PatientTypeID')) { + // if (body.containsKey('PatientTypeID')) { body['PatientTypeID'] = body.containsKey('PatientTypeID') ? body['PatientTypeID'] != null ? body['PatientTypeID'] : PATIENT_TYPE_ID : PATIENT_TYPE_ID; - } + // } if (user != null) { body['TokenID'] = token; diff --git a/lib/core/service/medical/my_doctor_service.dart b/lib/core/service/medical/my_doctor_service.dart index d688c7e7..4df3ce8a 100644 --- a/lib/core/service/medical/my_doctor_service.dart +++ b/lib/core/service/medical/my_doctor_service.dart @@ -1,7 +1,6 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/doctor/doctor_profile.dart'; import 'package:diplomaticquarterapp/core/model/doctor/doctor_rating.dart'; -import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart'; import 'package:diplomaticquarterapp/core/model/doctor/reques_patient_doctor_appointmentt.dart'; import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_profile.dart'; import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_rating.dart'; @@ -9,7 +8,7 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; class MyDoctorService extends BaseService { - List patientDoctorAppointmentList = List(); + List patientDoctorAppointmentList = List(); DoctorProfile doctorProfile; DoctorList doctorList; DoctorRating doctorRating = DoctorRating(); @@ -51,7 +50,7 @@ class MyDoctorService extends BaseService { patientDoctorAppointmentList.clear(); response['PatientDoctorAppointmentResultList'].forEach((hospital) { patientDoctorAppointmentList - .add(PatientDoctorAppointment.fromJson(hospital)); + .add(DoctorList.fromJson(hospital)); }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModels/medical/my_doctor_view_model.dart b/lib/core/viewModels/medical/my_doctor_view_model.dart index f1db7804..266157ff 100644 --- a/lib/core/viewModels/medical/my_doctor_view_model.dart +++ b/lib/core/viewModels/medical/my_doctor_view_model.dart @@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/doctor/doctor_profile.dart'; import 'package:diplomaticquarterapp/core/model/doctor/doctor_rating.dart'; -import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart'; import 'package:diplomaticquarterapp/core/service/medical/my_doctor_service.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; @@ -65,9 +64,7 @@ class MyDoctorViewModel extends BaseViewModel { .toList(); if (doctorByHospital.length != 0) { - _patientDoctorAppointmentListHospital[ - _patientDoctorAppointmentListHospital - .indexOf(doctorByHospital[0])] + _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])] .patientDoctorAppointmentList .add(element); } else { diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 40cdd432..5975daf2 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -9,7 +9,7 @@ import 'package:flutter/cupertino.dart'; class ProjectViewModel extends BaseViewModel { AppSharedPreferences sharedPref = AppSharedPreferences(); Locale _appLocale; - String currentLanguage = 'ar'; + String currentLanguage = 'en'; bool _isArabic = false; bool isInternetConnection = true; bool isLoading = false; @@ -45,7 +45,7 @@ class ProjectViewModel extends BaseViewModel { void loadSharedPrefLanguage() async { currentLanguage = await sharedPref.getString(APP_LANGUAGE); - _appLocale = Locale(currentLanguage ?? 'ar'); + _appLocale = Locale(currentLanguage ?? 'en'); _isArabic = currentLanguage != null ? currentLanguage == 'ar' ? true : false : true; diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 3b5557bc..65d28910 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -85,7 +85,7 @@ class DoctorList { clinicName = json['ClinicName']; doctorTitle = json['DoctorTitle']; iD = json['ID']; - name = json['Name']; + name = json['DoctorName']??json['Name']; projectID = json['ProjectID']; projectName = json['ProjectName']; actualDoctorRate = json['ActualDoctorRate']; @@ -118,7 +118,7 @@ class DoctorList { rateNumber = json['RateNumber']; serviceID = json['ServiceID']; setupID = json['SetupID']; - if (json.containsKey('Speciality')) + if (json.containsKey('Speciality') && json['Speciality']!=null) speciality = json['Speciality'].cast(); workingHours = json['WorkingHours']; } diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 782b5012..8076554e 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -241,59 +241,62 @@ class _MyAppointmentsState extends State fontSize: 16.0, )), ), - ], - margin: EdgeInsets.only(top: 10.0), - child: Container( - child: widget.bookedAppoList.length != 0 - ? SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Column( - children: [ - ...List.generate( - widget._patientBookedAppointmentListHospital.length, - (index) => AppExpandableNotifier( - title: widget - ._patientBookedAppointmentListHospital[index] - .filterName, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: widget - ._patientBookedAppointmentListHospital[index] - .patientDoctorAppointmentList - .map((doctor) { - return AppointmentCard( - appo: doctor, - onReloadAppointmentHistory: - getPatientAppointmentHistory, - ); - }).toList(), - )), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Container( + child: widget.bookedAppoList.length != 0 + ? SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ...List.generate( + widget._patientBookedAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: widget + ._patientBookedAppointmentListHospital[index] + .filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: widget + ._patientBookedAppointmentListHospital[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), + )), + ) + ], + ), + ) + : Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/images/new-design/noAppointmentIcon.png"), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("No Booked Appointments", + style: TextStyle( + fontSize: 16.0, + )), + ), + ], + ), + ), + ), + ), ) ], - ), - ) - : Container( - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/images/new-design/noAppointmentIcon.png"), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text("No Booked Appointments", - style: TextStyle( - fontSize: 16.0, - )), - ), - ], - ), - ), - ), - ), - ); + + )))); } Widget getConfirmedAppointments() { diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 8cfbbbcd..d892be83 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -130,119 +130,119 @@ class _LandingPageState extends State with WidgetsBindingObserver { //_firebase Background message handler _firebaseMessaging.configure( - onMessage: (Map message) async { - showDialog("onMessage: $message"); - print("onMessage: $message"); - print(message); - print(message['name']); - print(message['appointmentdate']); - - if (Platform.isIOS) { - if (message['is_call'] == "true") { - var route = ModalRoute.of(context); - - if (route != null) { - print(route.settings.name); - } - - Map myMap = new Map.from(message); - print(myMap); - LandingPage.isOpenCallPage = true; - LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - if (!isPageNavigated) { - isPageNavigated = true; - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => IncomingCall( - incomingCallData: LandingPage.incomingCallData))) - .then((value) { - isPageNavigated = false; - }); - } - } else { - print("Is Call Not Found iOS"); - } - } else { - print("Is Call Not Found iOS"); - } - - if (Platform.isAndroid) { - if (message['data'].containsKey("is_call")) { - var route = ModalRoute.of(context); - - if (route != null) { - print(route.settings.name); - } - - Map myMap = - new Map.from(message['data']); - print(myMap); - LandingPage.isOpenCallPage = true; - LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - if (!isPageNavigated) { - isPageNavigated = true; - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => IncomingCall( - incomingCallData: LandingPage.incomingCallData))) - .then((value) { - isPageNavigated = false; - }); - } - } else { - print("Is Call Not Found Android"); - } - } else { - print("Is Call Not Found Android"); - } - }, - onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, - onLaunch: (Map message) async { - print("onLaunch: $message"); - showDialog("onLaunch: $message"); - }, - onResume: (Map message) async { - print("onResume: $message"); - print(message); - print(message['name']); - print(message['appointmentdate']); - - showDialog("onResume: $message"); - - if (Platform.isIOS) { - if (message['is_call'] == "true") { - var route = ModalRoute.of(context); - - if (route != null) { - print(route.settings.name); - } - - Map myMap = - new Map.from(message); - print(myMap); - LandingPage.isOpenCallPage = true; - LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - if (!isPageNavigated) { - isPageNavigated = true; - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => IncomingCall( - incomingCallData: LandingPage.incomingCallData))) - .then((value) { - isPageNavigated = false; - }); - } - } else { - print("Is Call Not Found iOS"); - } - } else { - print("Is Call Not Found iOS"); - } - }, - ); + // onMessage: (Map message) async { + // showDialog("onMessage: $message"); + // print("onMessage: $message"); + // print(message); + // print(message['name']); + // print(message['appointmentdate']); + // + // if (Platform.isIOS) { + // if (message['is_call'] == "true") { + // var route = ModalRoute.of(context); + // + // if (route != null) { + // print(route.settings.name); + // } + // + // Map myMap = new Map.from(message); + // print(myMap); + // LandingPage.isOpenCallPage = true; + // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // if (!isPageNavigated) { + // isPageNavigated = true; + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => IncomingCall( + // incomingCallData: LandingPage.incomingCallData))) + // .then((value) { + // isPageNavigated = false; + // }); + // } + // } else { + // print("Is Call Not Found iOS"); + // } + // } else { + // print("Is Call Not Found iOS"); + // } + // + // if (Platform.isAndroid) { + // if (message['data'].containsKey("is_call")) { + // var route = ModalRoute.of(context); + // + // if (route != null) { + // print(route.settings.name); + // } + // + // Map myMap = + // new Map.from(message['data']); + // print(myMap); + // LandingPage.isOpenCallPage = true; + // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // if (!isPageNavigated) { + // isPageNavigated = true; + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => IncomingCall( + // incomingCallData: LandingPage.incomingCallData))) + // .then((value) { + // isPageNavigated = false; + // }); + // } + // } else { + // print("Is Call Not Found Android"); + // } + // } else { + // print("Is Call Not Found Android"); + // } + // }, + // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, + // onLaunch: (Map message) async { + // print("onLaunch: $message"); + // showDialog("onLaunch: $message"); + // }, + // onResume: (Map message) async { + // print("onResume: $message"); + // print(message); + // print(message['name']); + // print(message['appointmentdate']); + // + // showDialog("onResume: $message"); + // + // if (Platform.isIOS) { + // if (message['is_call'] == "true") { + // var route = ModalRoute.of(context); + // + // if (route != null) { + // print(route.settings.name); + // } + // + // Map myMap = + // new Map.from(message); + // print(myMap); + // LandingPage.isOpenCallPage = true; + // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // if (!isPageNavigated) { + // isPageNavigated = true; + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => IncomingCall( + // incomingCallData: LandingPage.incomingCallData))) + // .then((value) { + // isPageNavigated = false; + // }); + // } + // } else { + // print("Is Call Not Found iOS"); + // } + // } else { + // print("Is Call Not Found iOS"); + // } + // }, + ); } showDialog(String message) { diff --git a/lib/pages/medical/doctor/doctor_home_page.dart b/lib/pages/medical/doctor/doctor_home_page.dart index 456b0bcb..7a01ef90 100644 --- a/lib/pages/medical/doctor/doctor_home_page.dart +++ b/lib/pages/medical/doctor/doctor_home_page.dart @@ -89,7 +89,7 @@ class DoctorHomePage extends StatelessWidget { doctorRate: doctor.doctorRate, gender: doctor.gender, doctorTitle: doctor.doctorTitle, - name: doctor.doctorName, + name: doctor.name, doctorImageURL: doctor.doctorImageURL, nationalityFlagURL: doctor.nationalityFlagURL); return DoctorView(