From 35cd02494c93e24a4eb909bbb9e6bb4725691ee1 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 2 Sep 2020 12:10:40 +0300 Subject: [PATCH 01/15] implemented search by doctor list --- lib/config/localized_values.dart | 5 +- .../Appointments/DoctorListResponse.dart | 86 +++++++++++-------- lib/pages/BookAppointment/SearchResults.dart | 74 ++++------------ .../components/SearchByClinic.dart | 8 -- .../components/SearchByDoctor.dart | 44 +++++++++- .../BookAppointment/widgets/BranchView.dart | 16 ++-- 6 files changed, 117 insertions(+), 116 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ea14b71f..95398e23 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -363,7 +363,7 @@ const Map> localizedValues = { "consultation": {"en": "Consultation", "ar": "استشارة"}, "logs": {"en": "Logs", "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": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."} + "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- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). "}, @@ -374,6 +374,5 @@ const Map> localizedValues = { "gate":{"en":"Gate:","ar":"بوابة"}, "building":{"en":"Building:","ar":"المبنى"}, "branch":{"en":"Branch:","ar":"الفرع"}, - "emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"}, - "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"} + "emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"} }; diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 07563a25..8e1f0b35 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -41,44 +41,44 @@ class DoctorList { DoctorList( {this.clinicID, - this.clinicName, - this.doctorTitle, - this.iD, - this.name, - this.projectID, - this.projectName, - this.actualDoctorRate, - this.clinicRoomNo, - this.date, - this.dayName, - this.doctorID, - this.doctorImageURL, - this.doctorProfile, - this.doctorProfileInfo, - this.doctorRate, - this.gender, - this.genderDescription, - this.isAppointmentAllowed, - this.isDoctorAllowVedioCall, - this.isDoctorDummy, - this.isLiveCare, - this.latitude, - this.longitude, - this.nationalityFlagURL, - this.nationalityID, - this.nationalityName, - this.nearestFreeSlot, - this.noOfPatientsRate, - this.originalClinicID, - this.personRate, - this.projectDistanceInKiloMeters, - this.qR, - this.qRString, - this.rateNumber, - this.serviceID, - this.setupID, - this.speciality, - this.workingHours}); + this.clinicName, + this.doctorTitle, + this.iD, + this.name, + this.projectID, + this.projectName, + this.actualDoctorRate, + this.clinicRoomNo, + this.date, + this.dayName, + this.doctorID, + this.doctorImageURL, + this.doctorProfile, + this.doctorProfileInfo, + this.doctorRate, + this.gender, + this.genderDescription, + this.isAppointmentAllowed, + this.isDoctorAllowVedioCall, + this.isDoctorDummy, + this.isLiveCare, + this.latitude, + this.longitude, + this.nationalityFlagURL, + this.nationalityID, + this.nationalityName, + this.nearestFreeSlot, + this.noOfPatientsRate, + this.originalClinicID, + this.personRate, + this.projectDistanceInKiloMeters, + this.qR, + this.qRString, + this.rateNumber, + this.serviceID, + this.setupID, + this.speciality, + this.workingHours}); DoctorList.fromJson(Map json) { clinicID = json['ClinicID']; @@ -166,3 +166,13 @@ class DoctorList { return data; } } + +class PatientDoctorAppointmentList { + String filterName = ""; + List patientDoctorAppointmentList = List(); + + PatientDoctorAppointmentList( + {this.filterName, DoctorList patientDoctorAppointment}) { + patientDoctorAppointmentList.add(patientDoctorAppointment); + } +} diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 5d74cc59..8b9dd984 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -8,8 +8,10 @@ import 'package:flutter/material.dart'; class SearchResults extends StatefulWidget { List doctorsList = []; + List patientDoctorAppointmentListHospital; - SearchResults({@required this.doctorsList}); + SearchResults( + {@required this.doctorsList, this.patientDoctorAppointmentListHospital}); @override _SearchResultsState createState() => _SearchResultsState(); @@ -21,23 +23,7 @@ class _SearchResultsState extends State { @override void initState() { - event.controller.stream.listen((p) { - // if (p['project_id'] != null) { - // tempList = []; - // widget.doctorsList.forEach((e) => { - // if (e.projectID == int.parse(p['project_id'])) {tempList.add(e)} - // }); - // } else if (p['doctor_id'] != null) { - // tempList = []; - // widget.doctorsList.forEach((e) => { - // if (e.doctorID == int.parse(p['doctor_id'])) {tempList.add(e)} - // }); - // DoctorView().getDoctorsProfile(context, tempList[0], isAppo: true); - // } - // setState(() { - // widget.doctorsList = tempList; - // }); - }); + event.controller.stream.listen((p) {}); super.initState(); } @@ -50,50 +36,28 @@ class _SearchResultsState extends State { margin: EdgeInsets.only(bottom: 10.0), child: SingleChildScrollView( physics: BouncingScrollPhysics(), - child: FractionallySizedBox( - widthFactor: 1.0, - child: Column( - children: [ - ...List.generate( - widget.doctorsList.length, - (index) => AppExpandableNotifier( - title: widget.doctorsList[index].projectName, + child: Column( + children: [ + ...List.generate( + widget.patientDoctorAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: widget + .patientDoctorAppointmentListHospital[index].filterName, bodyWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: widget.doctorsList.map((doctorObj) { + children: widget + .patientDoctorAppointmentListHospital[index] + .patientDoctorAppointmentList + .map((doctor) { return DoctorView( - doctor: doctorObj, + doctor: doctor, ); }).toList(), - ), - ), - ) - ], - ), + )), + ) + ], ), - -// ListView.builder( -// scrollDirection: Axis.vertical, -// shrinkWrap: true, -// physics: ScrollPhysics(), -// padding: EdgeInsets.all(0.0), -// itemCount: widget.doctorsList.length, -// itemBuilder: (context, index) { -// return AppExpandableNotifier( -// title: widget.doctorsList[index].projectName, -// bodyWidget: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// mainAxisAlignment: MainAxisAlignment.spaceBetween, -// children: widget.doctorsList.map((labOrder) { -// return DoctorView( -// doctor: widget.doctorsList[index], -// ); -// }).toList(), -// ), -// ); -// }, -// ), ), ), ); diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 2188d296..35fcf593 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -125,14 +125,6 @@ class _SearchByClinicState extends State { arrDistance.add(new DoctorList.fromJson(v) .projectDistanceInKiloMeters .toString()); - -// print(DoctorList -// .fromJson(v) -// .projectName); -// print(DoctorList -// .fromJson(v) -// .projectDistanceInKiloMeters); -// distinctIds = result.toSet().toList(); }); } else {} }); diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 3e817878..4fb55c7c 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -84,6 +84,10 @@ class _SearchByDoctorState extends State { getDoctorsList(BuildContext context) { List doctorsList = []; DoctorsListService service = new DoctorsListService(); + + List _patientDoctorAppointmentListHospital = + List(); + service .getDoctorsListByName(doctorNameController.text, context) .then((res) { @@ -93,9 +97,34 @@ class _SearchByDoctorState extends State { res['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); }); + + doctorsList.forEach((element) { + List doctorByHospital = + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[ + _patientDoctorAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + _patientDoctorAppointmentListHospital.add( + PatientDoctorAppointmentList( + filterName: element.projectName, + patientDoctorAppointment: element)); + } + }); } else {} }); - navigateToSearchResults(context, doctorsList); + + navigateToSearchResults( + context, doctorsList, _patientDoctorAppointmentListHospital); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -107,7 +136,7 @@ class _SearchByDoctorState extends State { _onDocTextChanged(content) { print(content); - if (content.length >= 4) { + if (content.length >= 3) { setState(() { _isButtonDisabled = false; }); @@ -123,10 +152,17 @@ class _SearchByDoctorState extends State { getDoctorsList(context); } - Future navigateToSearchResults(context, List docList) async { + Future navigateToSearchResults( + context, + List docList, + List + patientDoctorAppointmentListHospital) async { Navigator.push( context, MaterialPageRoute( - builder: (context) => SearchResults(doctorsList: docList))); + builder: (context) => SearchResults( + doctorsList: docList, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))); } } diff --git a/lib/pages/BookAppointment/widgets/BranchView.dart b/lib/pages/BookAppointment/widgets/BranchView.dart index 8ec0bbd5..6819c54b 100644 --- a/lib/pages/BookAppointment/widgets/BranchView.dart +++ b/lib/pages/BookAppointment/widgets/BranchView.dart @@ -82,13 +82,9 @@ class _ExpandableListViewState extends State { children: [ new Text( widget.result2[widget.val].toString() + - " " + - widget.resultDistance[widget.val] - .toString() != - "0" - ? getProjectDistance( - widget.resultDistance[widget.val].toString()) - : "", + " " + + getProjectDistance( + widget.resultDistance[widget.val].toString()), style: new TextStyle( fontWeight: FontWeight.bold, color: Colors.black), ), @@ -148,7 +144,11 @@ class _ExpandableListViewState extends State { } String getProjectDistance(String distance) { - return " - " + distance + " KM"; + if (distance != "0") + return " - " + distance + " KMs"; + else { + return ""; + } } } From a7f5dfab5c5f972a90f12fa46d45652dc4206ff5 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 2 Sep 2020 12:22:05 +0300 Subject: [PATCH 02/15] fixes --- lib/models/Appointments/DoctorListResponse.dart | 3 ++- lib/pages/BookAppointment/SearchResults.dart | 5 +++-- .../BookAppointment/components/SearchByDoctor.dart | 1 + .../appointment_services/GetDoctorsList.dart | 12 ++++++++++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 8e1f0b35..66c0c855 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -169,10 +169,11 @@ class DoctorList { class PatientDoctorAppointmentList { String filterName = ""; + String distanceInKMs = ""; List patientDoctorAppointmentList = List(); PatientDoctorAppointmentList( - {this.filterName, DoctorList patientDoctorAppointment}) { + {this.filterName, this.distanceInKMs, DoctorList patientDoctorAppointment}) { patientDoctorAppointmentList.add(patientDoctorAppointment); } } diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 8b9dd984..c52002b4 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -33,7 +33,7 @@ class _SearchResultsState extends State { appBarTitle: TranslationBase.of(context).bookAppo, isShowAppBar: true, body: Container( - margin: EdgeInsets.only(bottom: 10.0), + margin: EdgeInsets.all(10.0), child: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Column( @@ -42,7 +42,8 @@ class _SearchResultsState extends State { widget.patientDoctorAppointmentListHospital.length, (index) => AppExpandableNotifier( title: widget - .patientDoctorAppointmentListHospital[index].filterName, + .patientDoctorAppointmentListHospital[index].filterName + " - " +widget + .patientDoctorAppointmentListHospital[index].distanceInKMs + " KMs" , bodyWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 4fb55c7c..1e7deb38 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -117,6 +117,7 @@ class _SearchByDoctorState extends State { _patientDoctorAppointmentListHospital.add( PatientDoctorAppointmentList( filterName: element.projectName, + distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); } }); diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 27a66d43..61845095 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -79,12 +79,20 @@ class DoctorsListService extends BaseService { Future getDoctorsListByName(String docName, BuildContext context) async { Map request; + double lat; + double long; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson( await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } + if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { + lat = await this.sharedPref.getDouble(USER_LAT); + long = await this.sharedPref.getDouble(USER_LONG); + } + var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); request = { @@ -106,8 +114,8 @@ class DoctorsListService extends BaseService { "gender": authUser.gender != null ? authUser.gender : 0, "age": authUser.age != null ? authUser.age : 0, "IsGetNearAppointment": false, - "Latitude": 0, - "Longitude": 0, + "Latitude": lat, + "Longitude": long, "License": true }; From ef4a57223ca8df6adf1ee1e3c27e48d0d524d7ed Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 2 Sep 2020 14:19:14 +0300 Subject: [PATCH 03/15] fix DoctorView.dart UI issues --- lib/config/localized_values.dart | 6 +- lib/core/service/client/base_app_client.dart | 4 +- .../service/medical/my_doctor_service.dart | 12 +- .../medical/my_doctor_view_model.dart | 6 +- .../Appointments/DoctorListResponse.dart | 91 +++--- .../BookAppointment/widgets/DoctorView.dart | 130 ++++----- lib/pages/MyAppointments/MyAppointments.dart | 8 +- lib/pages/landing/home_page.dart | 4 +- .../medical/doctor/doctor_home_page.dart | 48 +++- .../medical/doctor/doctor_profile_page.dart | 258 +++++++++--------- lib/uitl/translations_delegate_base.dart | 6 + 11 files changed, 320 insertions(+), 253 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6d2cff69..3291870d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -373,5 +373,9 @@ const Map> localizedValues = { "building":{"en":"Building:","ar":"المبنى"}, "branch":{"en":"Branch:","ar":"الفرع"}, "emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"}, - "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"} + "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"}, + "MyAppointments": {"en": "My Appointments", "ar": "مواعيدي"}, + "NoBookedAppointments": {"en": "No Booked Appointments", "ar": "لا توجد مواعيد محجوزة"}, + "NoConfirmedAppointments": {"en": "No Confirmed Appointments", "ar": "لا توجد مواعيد مؤكدة"}, + "noArrivedAppointments": {"en": "No Arrived Appointments", "ar": "لم تصل المواعيد"}, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index f45fe22b..aa48c49d 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -36,9 +36,7 @@ class BaseAppClient { body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID : SETUP_ID; - body['VersionID'] = body.containsKey('VersionID') - ? body['VersionID'] != null ? body['VersionID'] : VERSION_ID - : VERSION_ID; + body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; body['LanguageID'] = languageID == 'ar' ? 1 : 2; body['IPAdress'] = IP_ADDRESS; diff --git a/lib/core/service/medical/my_doctor_service.dart b/lib/core/service/medical/my_doctor_service.dart index 349d7ace..d688c7e7 100644 --- a/lib/core/service/medical/my_doctor_service.dart +++ b/lib/core/service/medical/my_doctor_service.dart @@ -6,10 +6,12 @@ import 'package:diplomaticquarterapp/core/model/doctor/reques_patient_doctor_app import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_profile.dart'; import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_rating.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; class MyDoctorService extends BaseService { List patientDoctorAppointmentList = List(); DoctorProfile doctorProfile; + DoctorList doctorList; DoctorRating doctorRating = DoctorRating(); RequestPatientDoctorAppointment patientDoctorAppointmentRequest = @@ -58,7 +60,6 @@ class MyDoctorService extends BaseService { } RequestDoctorProfile _requestDoctorProfile = RequestDoctorProfile( - doctorID: 2477, license: true, isRegistered: true, projectID: 12, @@ -79,11 +80,18 @@ class MyDoctorService extends BaseService { ///GET DOCTOR PROFILE _requestDoctorProfile.doctorID = doctorId; _requestDoctorProfile.clinicID = clinicID; - _requestDoctorProfile.patientID = projectID; + _requestDoctorProfile.projectID = projectID; hasError = false; await baseAppClient.post(GET_DOCTOR_PROFILE, onSuccess: (dynamic response, int statusCode) { doctorProfile = DoctorProfile.fromJson(response['DoctorProfileList'][0]); + doctorList = DoctorList.fromJson(response['DoctorProfileList'][0]); + doctorList.clinicName = doctorProfile.clinicDescription; + doctorList.doctorTitle = doctorProfile.doctorTitleForProfile; + doctorList.name = doctorProfile.doctorName; + doctorList.projectName = doctorProfile.projectName; + + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/medical/my_doctor_view_model.dart b/lib/core/viewModels/medical/my_doctor_view_model.dart index e04f9bdd..f1db7804 100644 --- a/lib/core/viewModels/medical/my_doctor_view_model.dart +++ b/lib/core/viewModels/medical/my_doctor_view_model.dart @@ -4,6 +4,7 @@ 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'; import '../../../locator.dart'; import '../base_view_model.dart'; @@ -22,6 +23,9 @@ class MyDoctorViewModel extends BaseViewModel { ? _patientDoctorAppointmentListClinic : _patientDoctorAppointmentListHospital; + DoctorList get doctorList=> _myDoctorService.doctorList; + + DoctorProfile get doctorProfile => _myDoctorService.doctorProfile; DoctorRating get doctorRating => _myDoctorService.doctorRating; @@ -83,7 +87,7 @@ class MyDoctorViewModel extends BaseViewModel { notifyListeners(); } - void getDoctorProfileAndRating({int doctorId,int clinicID,int projectID }) async { + Future getDoctorProfileAndRating({int doctorId,int clinicID,int projectID }) async { setState(ViewState.Busy); await _myDoctorService.getDoctorProfileAndRating(doctorId: doctorId,clinicID: clinicID,projectID: projectID); if (_myDoctorService.hasError) { diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 2f4ee2a0..1ef6ee72 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -1,3 +1,5 @@ +import 'package:intl/intl.dart'; + class DoctorList { int clinicID; String clinicName; @@ -41,44 +43,44 @@ class DoctorList { DoctorList( {this.clinicID, - this.clinicName, - this.doctorTitle, - this.iD, - this.name, - this.projectID, - this.projectName, - this.actualDoctorRate, - this.clinicRoomNo, - this.date, - this.dayName, - this.doctorID, - this.doctorImageURL, - this.doctorProfile, - this.doctorProfileInfo, - this.doctorRate, - this.gender, - this.genderDescription, - this.isAppointmentAllowed, - this.isDoctorAllowVedioCall, - this.isDoctorDummy, - this.isLiveCare, - this.latitude, - this.longitude, - this.nationalityFlagURL, - this.nationalityID, - this.nationalityName, - this.nearestFreeSlot, - this.noOfPatientsRate, - this.originalClinicID, - this.personRate, - this.projectDistanceInKiloMeters, - this.qR, - this.qRString, - this.rateNumber, - this.serviceID, - this.setupID, - this.speciality, - this.workingHours}); + this.clinicName, + this.doctorTitle, + this.iD, + this.name, + this.projectID, + this.projectName, + this.actualDoctorRate, + this.clinicRoomNo, + this.date, + this.dayName, + this.doctorID, + this.doctorImageURL, + this.doctorProfile, + this.doctorProfileInfo, + this.doctorRate, + this.gender, + this.genderDescription, + this.isAppointmentAllowed, + this.isDoctorAllowVedioCall, + this.isDoctorDummy, + this.isLiveCare, + this.latitude, + this.longitude, + this.nationalityFlagURL, + this.nationalityID, + this.nationalityName, + this.nearestFreeSlot, + this.noOfPatientsRate, + this.originalClinicID, + this.personRate, + this.projectDistanceInKiloMeters, + this.qR, + this.qRString, + this.rateNumber, + this.serviceID, + this.setupID, + this.speciality, + this.workingHours}); DoctorList.fromJson(Map json) { clinicID = json['ClinicID']; @@ -118,7 +120,8 @@ class DoctorList { rateNumber = json['RateNumber']; serviceID = json['ServiceID']; setupID = json['SetupID']; - speciality = json['Speciality'].cast(); + if (json.containsKey('Speciality')) + speciality = json['Speciality'].cast(); workingHours = json['WorkingHours']; } @@ -166,3 +169,13 @@ class DoctorList { return data; } } + +class DoctorListAppointmentList { + String filterName = ""; + List patientDoctorAppointmentList = List(); + + DoctorListAppointmentList( + {this.filterName, DoctorList patientDoctorAppointment}) { + patientDoctorAppointmentList.add(patientDoctorAppointment); + } +} diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 3d69a93d..4cdc3977 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -9,7 +9,7 @@ import 'package:smart_progress_bar/smart_progress_bar.dart'; import '../DoctorProfile.dart'; class DoctorView extends StatelessWidget { - DoctorList doctor; + final DoctorList doctor; DoctorView({@required this.doctor}); @@ -33,69 +33,77 @@ class DoctorView extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - ClipRRect( - borderRadius: BorderRadius.circular(100.0), - child: Image.network(this.doctor.doctorImageURL, - fit: BoxFit.fill, height: 60.0, width: 60.0), + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network(this.doctor.doctorImageURL, + fit: BoxFit.fill, height: 60.0, width: 60.0), + ), ), - Container( - width: MediaQuery.of(context).size.width * 0.6, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(this.doctor.doctorTitle + " " + this.doctor.name, - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700], - letterSpacing: 1.0)), - Container( - margin: EdgeInsets.only(top: 3.0), - child: Text(this.doctor.clinicName, - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], - letterSpacing: 1.0)), - ), - Container( - margin: EdgeInsets.only(top: 3.0), - child: Text(this.doctor.projectName, - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], - letterSpacing: 1.0)), - ), - Container( - margin: EdgeInsets.only(top: 3.0, bottom: 3.0), - child: Text( - getDoctorSpeciality(this.doctor.speciality).trim(), + Expanded( + flex: 4, + child: Container( + width: MediaQuery.of(context).size.width * 0.6, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if(doctor.doctorTitle!=null) + Text(this.doctor.doctorTitle + " " + this.doctor.name, style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], + fontSize: 14.0, + color: Colors.grey[700], letterSpacing: 1.0)), - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - RatingBar.readOnly( - initialRating: - this.doctor.actualDoctorRate.toDouble(), - size: 20.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - Container( - child: Image.network(this.doctor.nationalityFlagURL, - width: 25.0, height: 25.0), - ), - ], - ), - ], + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(this.doctor.clinicName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(this.doctor.projectName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + if(doctor.speciality!=null) + Container( + margin: EdgeInsets.only(top: 3.0, bottom: 3.0), + child: Text( + getDoctorSpeciality(this.doctor.speciality).trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: + this.doctor.actualDoctorRate.toDouble(), + size: 20.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + Container( + child: Image.network(this.doctor.nationalityFlagURL, + width: 25.0, height: 25.0), + ), + ], + ), + ], + ), ), ), ], diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 63034373..af4c47c0 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -36,7 +36,7 @@ class _MyAppointmentsState extends State @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "My Appointments", + appBarTitle: TranslationBase.of(context).myAppointments, isShowAppBar: true, body: Container( child: Column(children: [ @@ -158,7 +158,7 @@ class _MyAppointmentsState extends State "assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text("No Booked Appointments", + child: Text(TranslationBase.of(context).noBookedAppointments, style: TextStyle( fontSize: 16.0, )), @@ -192,7 +192,7 @@ class _MyAppointmentsState extends State Image.asset("assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text("No Confirmed Appointments", + child: Text(TranslationBase.of(context).noConfirmedAppointments , style: TextStyle( fontSize: 16.0, )), @@ -225,7 +225,7 @@ class _MyAppointmentsState extends State Image.asset("assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text("No Arrived Appointments", + child: Text(TranslationBase.of(context).noArrivedAppointments, style: TextStyle( fontSize: 16.0, )), diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 06a2f9ca..5e5c5971 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -154,8 +154,8 @@ class _HomePageState extends State { ), Align( alignment: projectViewModel.isArabic - ? Alignment.bottomLeft - : Alignment.bottomRight, + ? Alignment.bottomRight + : Alignment.bottomLeft, child: InkWell( onTap: () { widget.goToMyProfile(); diff --git a/lib/pages/medical/doctor/doctor_home_page.dart b/lib/pages/medical/doctor/doctor_home_page.dart index 4cce1dc8..075565e0 100644 --- a/lib/pages/medical/doctor/doctor_home_page.dart +++ b/lib/pages/medical/doctor/doctor_home_page.dart @@ -1,5 +1,7 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; @@ -75,16 +77,40 @@ class DoctorHomePage extends StatelessWidget { children: model.patientDoctorAppointmentList[index] .patientDoctorAppointmentList .map((doctor) { - return InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: DoctorProfilePage( - patientDoctorAppointment: doctor, - ), - ), - ); + DoctorList doctorList = DoctorList( + projectID: doctor.projectID, + setupID: doctor.setupID, + clinicID: doctor.clinicID, + projectName: doctor.projectName, + clinicName: doctor.clinicName, + actualDoctorRate: doctor.actualDoctorRate, + doctorID: doctor.doctorID, + doctorRate: doctor.doctorRate, + gender: doctor.gender, + doctorTitle: doctor.doctorTitle, + name: doctor.doctorName, + doctorImageURL: doctor.doctorImageURL, + nationalityFlagURL:doctor.nationalityFlagURL + ); + return DoctorView(doctor: doctorList,);/* InkWell( + onTap: () async { + model + .getDoctorProfileAndRating( + doctorId: doctor.doctorID, + clinicID: doctor.clinicID, + projectID: doctor.projectID) + .then((value) { + var asd=""; + Navigator.push( + context, + FadePage( + page: DoctorView(doctor: model.doctorList,), + ), + ); + }).catchError((e){ + var asd=""; + + }); }, child: DoctorCard( name: doctor.doctorName, @@ -93,7 +119,7 @@ class DoctorHomePage extends StatelessWidget { subName: DateUtil.getMonthDayYearDateFormatted( doctor.appointmentDate), ), - ); + )*/; }).toList(), )), ) diff --git a/lib/pages/medical/doctor/doctor_profile_page.dart b/lib/pages/medical/doctor/doctor_profile_page.dart index 2b19ba3d..7588205c 100644 --- a/lib/pages/medical/doctor/doctor_profile_page.dart +++ b/lib/pages/medical/doctor/doctor_profile_page.dart @@ -1,5 +1,7 @@ import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -35,149 +37,147 @@ class _DoctorProfilePageState extends State @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getDoctorProfileAndRating( - doctorId: widget.patientDoctorAppointment.doctorID, - clinicID: widget.patientDoctorAppointment.clinicID, - projectID: widget.patientDoctorAppointment.projectID), - builder: (context, model, widget) => AppScaffold( - isShowAppBar: true, - appBarTitle: 'Doctor Profile', - baseViewModel: model, - body: SingleChildScrollView( + /* onModelReady: (model) => model.getDoctorProfileAndRating( + doctorId: widget.patientDoctorAppointment.doctorID, + clinicID: widget.patientDoctorAppointment.clinicID, + projectID: widget.patientDoctorAppointment.projectID),*/ + builder: (context, model, widget) => DoctorView(doctor: model.doctorList,)/*AppScaffold( + isShowAppBar: true, + appBarTitle: 'Doctor Profile', + baseViewModel: model, + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + color: Colors.white, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - color: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + margin: EdgeInsets.only(top: 20.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - margin: EdgeInsets.only(top: 20.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all(5), - width: 50, - height: 50, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.grey), - child: Icon( - Icons.calendar_view_day, - size: 25, - color: Colors.white, - )), - ClipRRect( - borderRadius: BorderRadius.circular(100.0), - child: Image.network( - patientDoctorAppointment.doctorImageURL, - fit: BoxFit.fill, - height: 120.0, - width: 120.0), - ), - Container( - margin: EdgeInsets.all(5), - width: 50, - height: 50, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.grey), - child: Icon( - Icons.format_list_bulleted, - size: 25, - color: Colors.white, - )), - ], - ), + margin: EdgeInsets.all(5), + width: 50, + height: 50, + decoration: BoxDecoration( + shape: BoxShape.circle, color: Colors.grey), + child: Icon( + Icons.calendar_view_day, + size: 25, + color: Colors.white, + )), + ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network( + patientDoctorAppointment.doctorImageURL, + fit: BoxFit.fill, + height: 120.0, + width: 120.0), ), Container( - margin: EdgeInsets.only(top: 10.0), - alignment: Alignment.center, - child: Text(patientDoctorAppointment.doctorName, - style: TextStyle( - fontSize: 20.0, - color: Colors.grey[900], - letterSpacing: 1.0)), - ), - Container( - margin: EdgeInsets.only(top: 10.0), - alignment: Alignment.center, - child: Text(patientDoctorAppointment.clinicName, - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[900], - letterSpacing: 1.0)), - ), - Container( - margin: EdgeInsets.only(top: 5.0), - alignment: Alignment.center, - child: RatingBar.readOnly( - initialRating: - model.doctorRating.doctorRate?.toDouble() ?? - 0.0, - size: 35.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - ), - Container( - margin: EdgeInsets.only(top: 5.0), - alignment: Alignment.center, - child: Text( - "(${model.doctorRating.patientNumber ?? 0} Reviews)", - style: TextStyle( - fontSize: 14.0, - color: Colors.blue[800], - letterSpacing: 1.0, - decoration: TextDecoration.underline, - )), - ), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Divider( - color: Colors.grey[500], - ), - ), - TabBar( - indicatorColor: Colors.red[800], - indicatorWeight: 3.0, - tabs: [ - Tab( - child: Text('Doctor Information', - style: TextStyle(color: Colors.black))), - Tab( - child: Text( - TranslationBase.of(context).availableAppo, - style: TextStyle(color: Colors.black)), - ) - ], - controller: _tabController, - ), - Container( - height: MediaQuery.of(context).size.height * 0.8, - child: TabBarView( - physics: BouncingScrollPhysics(), - children: [ - DoctorInformation( - doctorProfile: model.doctorProfile, - ), - Container() - ], - controller: _tabController, - ), + margin: EdgeInsets.all(5), + width: 50, + height: 50, + decoration: BoxDecoration( + shape: BoxShape.circle, color: Colors.grey), + child: Icon( + Icons.format_list_bulleted, + size: 25, + color: Colors.white, + )), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text(patientDoctorAppointment.doctorName, + style: TextStyle( + fontSize: 20.0, + color: Colors.grey[900], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text(patientDoctorAppointment.clinicName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[900], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: RatingBar.readOnly( + initialRating: + model.doctorRating.doctorRate?.toDouble() ?? 0.0, + size: 35.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: Text( + "(${model.doctorRating.patientNumber ?? 0} Reviews)", + style: TextStyle( + fontSize: 14.0, + color: Colors.blue[800], + letterSpacing: 1.0, + decoration: TextDecoration.underline, + )), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Divider( + color: Colors.grey[500], + ), + ), + TabBar( + indicatorColor: Colors.red[800], + indicatorWeight: 3.0, + tabs: [ + Tab( + child: Text('Doctor Information', + style: TextStyle(color: Colors.black))), + Tab( + child: Text(TranslationBase.of(context).availableAppo, + style: TextStyle(color: Colors.black)), + ) + ], + controller: _tabController, + ), + Container( + height: MediaQuery.of(context).size.height * 0.8, + child: TabBarView( + physics: BouncingScrollPhysics(), + children: [ + DoctorInformation( + doctorProfile: model.doctorProfile, ), + Container(), +// DocAvailableAppointments(doctor: model.doctorList,) ], + controller: _tabController, ), ), ], ), ), - )); + ], + ), + ), + )*/, + ); } } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 43056cfb..5b9f0fc7 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -450,6 +450,12 @@ class TranslationBase { String get logs => localizedValues['logs'][locale.languageCode]; String get textToSpeech => localizedValues['textToSpeech'][locale.languageCode]; + + String get myAppointments => localizedValues['MyAppointments'][locale.languageCode]; + String get noBookedAppointments => localizedValues['NoBookedAppointments'][locale.languageCode]; + String get noConfirmedAppointments => localizedValues['NoConfirmedAppointments'][locale.languageCode]; + String get noArrivedAppointments => localizedValues['noArrivedAppointments'][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate { From 1886f3a763a1e3444cb32d49b3f653fa6bfdc967 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 3 Sep 2020 10:12:05 +0300 Subject: [PATCH 04/15] implementing Dental Appointment flow --- lib/config/config.dart | 3 + lib/models/Appointments/SearchInfoModel.dart | 10 + .../BookAppointment/DentalComplaints.dart | 49 +++++ .../components/SearchByClinic.dart | 172 ++++++++++++++---- .../clinic_services/get_clinic_service.dart | 87 +++++++++ 5 files changed, 281 insertions(+), 40 deletions(-) create mode 100644 lib/models/Appointments/SearchInfoModel.dart create mode 100644 lib/pages/BookAppointment/DentalComplaints.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 91cc2eda..f3b05b6a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -69,6 +69,9 @@ const GET_QR_PARKING = '/Services/SWP.svc/REST/GetQRParkingByID'; //URL to get clinic list const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; +//URL to get projects list +const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; + //URL to get doctors list const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; diff --git a/lib/models/Appointments/SearchInfoModel.dart b/lib/models/Appointments/SearchInfoModel.dart new file mode 100644 index 00000000..f5500bca --- /dev/null +++ b/lib/models/Appointments/SearchInfoModel.dart @@ -0,0 +1,10 @@ +class SearchInfo { + int ProjectID; + int ClinicID; + String DoctorName; + String SelectedDate; + String SelectedTime; + String currentLat; + String currentLong; + DateTime date; +} diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart new file mode 100644 index 00000000..756aa8bf --- /dev/null +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -0,0 +1,49 @@ +import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class DentalComplaints extends StatefulWidget { + SearchInfo searchInfo; + + DentalComplaints({@required this.searchInfo}); + + @override + _DentalComplaintsState createState() => _DentalComplaintsState(); +} + +class _DentalComplaintsState extends State { + @override + void initState() { + WidgetsBinding.instance + .addPostFrameCallback((_) => getChiefComplaintsList()); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: "Symptoms", + body: Container(), + ); + } + + getChiefComplaintsList() { + ClinicListService service = new ClinicListService(); + service + .getChiefComplaintsList( + widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context) + .then((res) { + if (res['MessageStatus'] == 1) { +// setState(() { +// res['List_DentalChiefComplain'].forEach((v) {}); +// }); + } else {} + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } +} diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 35fcf593..6ff05204 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -1,7 +1,10 @@ import "dart:collection"; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; @@ -19,8 +22,11 @@ class SearchByClinic extends StatefulWidget { class _SearchByClinicState extends State { bool nearestAppo = false; String dropdownValue; + String projectDropdownValue; var event = RobotProvider(); List clinicsList = []; + List projectsList = []; + bool isMobileAppDentalAllow = false; @override void initState() { @@ -76,25 +82,91 @@ class _SearchByClinicState extends State { onChanged: (newValue) { setState(() { dropdownValue = newValue; - - getDoctorsList(context); + if (!isDentalSelectedAndSupported()) { + projectDropdownValue = ""; + getDoctorsList(context); + } }); }, ), )), + isDentalSelectedAndSupported() == true || nearestAppo + ? Container( + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + border: Border.all( + color: Colors.grey[400], + width: 1.0, + ), + borderRadius: BorderRadius.circular(10), + ), + padding: EdgeInsets.all(8.0), + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.only(top: 15.0), + child: DropdownButtonHideUnderline( + child: DropdownButton( + hint: new Text("Select Project"), + value: projectDropdownValue, + items: projectsList.map((item) { + return new DropdownMenuItem( + value: item.mainProjectID.toString(), + child: new Text(item.name), + ); + }).toList(), + onChanged: (newValue) { + setState(() { + projectDropdownValue = newValue; + getDoctorsList(context); + }); + }, + ), + )) + : Container(), ], ), ); } + bool isDentalSelectedAndSupported() { + return dropdownValue != "" && + (dropdownValue == "17") && + isMobileAppDentalAllow; + } + getClinicsList() { ClinicListService service = new ClinicListService(); - service.getClinicsList(context).then((res) { + service + .getClinicsList(context) + .then((res) { + if (res['MessageStatus'] == 1) { + setState(() { + isMobileAppDentalAllow = res['ISMobileAppDentalAllow']; + res['ListClinicCentralized'].forEach((v) { + clinicsList.add(new ListClinicCentralized.fromJson(v)); + }); + }); + } else {} + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + getProjectsList(); + }); + } + + getProjectsList() { + ClinicListService service = new ClinicListService(); + service.getProjectsList(context).then((res) { if (res['MessageStatus'] == 1) { setState(() { - res['ListClinicCentralized'].forEach((v) { - clinicsList.add(new ListClinicCentralized.fromJson(v)); + res['ListProject'].forEach((v) { + projectsList.add(new HospitalsModel.fromJson(v)); }); + print(projectsList.length); }); } else {} }).catchError((err) { @@ -104,43 +176,65 @@ class _SearchByClinicState extends State { } getDoctorsList(BuildContext context) { - List doctorsList = []; + SearchInfo searchInfo = new SearchInfo(); + if (dropdownValue == "17") { + searchInfo.ProjectID = int.parse(projectDropdownValue); + searchInfo.ClinicID = int.parse(dropdownValue); + searchInfo.date = DateTime.now(); - List arr = []; - List arrDistance = []; - var distinctIds; - List result; - int numAll; - DoctorsListService service = new DoctorsListService(); - service.getDoctorsList(int.parse(dropdownValue), 0, context).then((res) { - if (res['MessageStatus'] == 1) { - setState(() { - if (res['DoctorList'].length != 0) { - print(res['DoctorList']); - doctorsList.clear(); - res['DoctorList'].forEach((v) { - doctorsList.add(new DoctorList.fromJson(v)); + navigateToDentalComplaints(context, searchInfo); + } else { + List doctorsList = []; + List arr = []; + List arrDistance = []; + List result; + int numAll; + DoctorsListService service = new DoctorsListService(); + service + .getDoctorsList( + int.parse(dropdownValue), + projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, + context) + .then((res) { + if (res['MessageStatus'] == 1) { + setState(() { + if (res['DoctorList'].length != 0) { + print(res['DoctorList']); + doctorsList.clear(); + res['DoctorList'].forEach((v) { + doctorsList.add(new DoctorList.fromJson(v)); - arr.add(new DoctorList.fromJson(v).projectName); - arrDistance.add(new DoctorList.fromJson(v) - .projectDistanceInKiloMeters - .toString()); - }); - } else {} - }); + arr.add(new DoctorList.fromJson(v).projectName); + arrDistance.add(new DoctorList.fromJson(v) + .projectDistanceInKiloMeters + .toString()); + }); + } else {} + }); - result = LinkedHashSet.from(arr).toList(); - numAll = result.length; + result = LinkedHashSet.from(arr).toList(); + numAll = result.length; - navigateToSearchResults( - context, doctorsList, result, numAll, arrDistance); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } - }).catchError((err) { - print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + navigateToSearchResults( + context, doctorsList, result, numAll, arrDistance); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + } + + Future navigateToDentalComplaints( + BuildContext context, SearchInfo searchInfo) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => DentalComplaints(searchInfo: searchInfo), + ), + ); } Future navigateToSearchResults( @@ -148,7 +242,6 @@ class _SearchByClinicState extends State { Navigator.push( context, MaterialPageRoute( -// builder: (context) => SearchResults(doctorsList: docList) builder: (context) => BranchView( doctorsList: docList, result: result, @@ -156,6 +249,5 @@ class _SearchByClinicState extends State { resultDistance: resultDistance), ), ); - //builder: (context) => SearchResults(doctorsList: docList))); } } diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index 42c9754c..cb486762 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -1,13 +1,22 @@ 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 ClinicListService extends BaseService { AppSharedPreferences sharedPref = AppSharedPreferences(); AppGlobal appGlobal = new AppGlobal(); + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + double lat; + double long; + Future getClinicsList(context) async { Map request; var languageID = await sharedPref.getString(APP_LANGUAGE); @@ -34,4 +43,82 @@ class ClinicListService extends BaseService { }, body: request); return Future.value(localRes); } + + Future getProjectsList(context) async { + Map request; + 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": 0, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": null + }; + + dynamic localRes; + + await baseAppClient.post(GET_PROJECTS_LIST, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getChiefComplaintsList(int clinicID, int projectID, BuildContext context, + {doctorId}) async { + //Utils.showProgressDialog(context); + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + if (await this.sharedPref.getDouble(USER_LAT) != null && + await this.sharedPref.getDouble(USER_LONG) != null) { + lat = await this.sharedPref.getDouble(USER_LAT); + long = await this.sharedPref.getDouble(USER_LONG); + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + request = { + "ClinicID": clinicID, + "ProjectID": projectID, + "SelectedDate": "", + "SelectedTime": "", + "License": true, + "VersionID": 5.6, + "Channel": 3, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "generalid": "Cs2020@2016\$2958", + "PatientOutSA": 0, + "SessionID": null, + "isDentalAllowedBackend": true, + "DeviceTypeID": 1, + "PatientID": 1, + "ContinueDentalPlan": true, + "IsSearchAppointmnetByClinicID": false + }; + + dynamic localRes; + + await baseAppClient.post(GET_DOCTORS_LIST_URL, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + } From 3a79ddb4885d4252e507b7030dd12fb69884dc68 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 3 Sep 2020 11:24:33 +0300 Subject: [PATCH 05/15] vaccine service --- lib/config/config.dart | 4 +- lib/core/model/vaccine/my_vaccine.dart | 91 +++++ lib/core/service/vaccine_service.dart | 43 +++ lib/core/viewModels/vaccine_view_model.dart | 25 ++ lib/locator.dart | 5 +- lib/pages/medical/medical_profile_page.dart | 29 +- lib/pages/vaccine/my_vaccines_screen.dart | 361 ++++++++++++++++++++ pubspec.yaml | 8 + 8 files changed, 558 insertions(+), 8 deletions(-) create mode 100644 lib/core/model/vaccine/my_vaccine.dart create mode 100644 lib/core/service/vaccine_service.dart create mode 100644 lib/core/viewModels/vaccine_view_model.dart create mode 100644 lib/pages/vaccine/my_vaccines_screen.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index a7cb621b..fd7de7bf 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -52,7 +52,7 @@ const GENERAL_ID = 'Cs2020@2016\$2958'; const IP_ADDRESS = '10.20.10.20'; const VERSION_ID = 5.5; const SETUP_ID = '91877'; -const LANGUAGE = 1; +const LANGUAGE = 2; const PATIENT_OUT_SA = 0; const SESSION_ID = 'TMRhVmkGhOsvamErw'; const IS_DENTAL_ALLOWED_BACKEND = false; @@ -67,6 +67,8 @@ const GET_PAtIENTS_INSURANCE = "/Patients.svc/REST/Get_PatientInsuranceDetails"; const GET_PAtIENTS_INSURANCE_UPDATED = "/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; const GET_PAtIENTS_INSURANCE_APPROVALS = "/Patients.svc/REST/GetApprovalStatus"; +const GET_VACCINES = "/Patients.svc/REST/GetDoneVaccinesByPatientID"; +const GET_VACCINES_EMAIL = "/Notifications.svc/REST/SendVaccinesEmail"; class AppGlobal { static var context; diff --git a/lib/core/model/vaccine/my_vaccine.dart b/lib/core/model/vaccine/my_vaccine.dart new file mode 100644 index 00000000..ac6e2e19 --- /dev/null +++ b/lib/core/model/vaccine/my_vaccine.dart @@ -0,0 +1,91 @@ +class VaccineModel { + String to; + String from; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + String invoiceDate; + String doctorImageURL; + String doctorName; + String doctorTitle; + String projectName; + String vaccineName; + + VaccineModel({ + this.to, + this.from, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.invoiceDate, + this.doctorImageURL, + this.doctorName, + this.doctorTitle, + this.projectName, + this.vaccineName, + }); + + VaccineModel.fromJson(Map json) { + vaccineName = json['VaccineName']; + projectName = json['ProjectName']; + doctorTitle = json['DoctorTitle']; + doctorName = json['DoctorName']; + doctorImageURL = json['DoctorImageURL']; + invoiceDate = json['InvoiceDate']; + to = json['To']; + from = json['From']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['To'] = this.to; + data['From'] = this.from; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/service/vaccine_service.dart b/lib/core/service/vaccine_service.dart new file mode 100644 index 00000000..189e26d8 --- /dev/null +++ b/lib/core/service/vaccine_service.dart @@ -0,0 +1,43 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/core/model/vaccine/my_vaccine.dart'; + +class VaccineService extends BaseService { + List _vaccineList = List(); + + List get vaccineList => _vaccineList; + + VaccineModel _vaccineModel = VaccineModel( + to: "0", + from: "0", + channel: 3, + deviceTypeID: 2, + generalid: "Cs2020@2016\$2958", + iPAdress: "10.20.10.20", + isDentalAllowedBackend: false, + languageID: 2, + patientID: 1231755, + patientOutSA: 0, + patientType: 1, + patientTypeID: 1, + sessionID: "uoKFXSLUwEaHYPwKZNA", + tokenID: "@dm!n", + versionID: 5.5, + ); + + Future getMyVaccine() async { + hasError = false; + _vaccineList.clear(); + await baseAppClient.post(GET_VACCINES, + onSuccess: (dynamic response, int statusCode) { + response['List_DoneVaccines'].forEach((item) { + _vaccineList.add(VaccineModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _vaccineModel.toJson()); + } + + Future sendEmail() async {} +} diff --git a/lib/core/viewModels/vaccine_view_model.dart b/lib/core/viewModels/vaccine_view_model.dart new file mode 100644 index 00000000..a3b6c057 --- /dev/null +++ b/lib/core/viewModels/vaccine_view_model.dart @@ -0,0 +1,25 @@ +import 'base_view_model.dart'; +import '../../locator.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/vaccine/my_vaccine.dart'; +import 'package:diplomaticquarterapp/core/service/vaccine_service.dart'; + +class VaccineViewModel extends BaseViewModel { + bool hasError = false; + + VaccineService _vaccineService = locator(); + + List get vaccineList => _vaccineService.vaccineList; + + Future getVaccine() async { + hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + await _vaccineService.getMyVaccine(); + if (_vaccineService.hasError) { + error = _vaccineService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/locator.dart b/lib/locator.dart index 5806ca70..c56abbd7 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -17,6 +17,8 @@ import 'core/viewModels/pharmacies_view_model.dart'; import 'core/service/pharmacies_service.dart'; import 'core/service/insurance_service.dart'; import 'core/viewModels/insurance_card_View_model.dart'; +import 'core/viewModels/vaccine_view_model.dart'; +import 'core/service/vaccine_service.dart'; GetIt locator = GetIt.instance; @@ -31,6 +33,7 @@ void setupLocator() { locator.registerLazySingleton(() => RadiologyService()); locator.registerLazySingleton(() => FeedbackService()); locator.registerLazySingleton(() => InsuranceCardService()); + locator.registerFactory(() => VaccineService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -40,6 +43,6 @@ void setupLocator() { locator.registerFactory(() => LabsViewModel()); locator.registerFactory(() => RadiologyViewModel()); locator.registerFactory(() => FeedbackViewModel()); - + locator.registerFactory(() => VaccineViewModel()); locator.registerFactory(() => InsuranceViewModel()); } diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 53c09727..f570750a 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -1,5 +1,5 @@ import 'dart:math'; - +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'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; @@ -170,12 +170,11 @@ class _MedicalProfilePageState extends State { subTitle: 'Card', ), ), - ), Expanded( + ), + Expanded( flex: 1, child: InkWell( - onTap: () { - - }, + onTap: () {}, child: MedicalProfileItem( title: 'new', imagePath: 'insurance_card_icon.png', @@ -184,7 +183,25 @@ class _MedicalProfilePageState extends State { ), ) ], - ) + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, FadePage(page: MyVaccines())); + }, + child: MedicalProfileItem( + title: 'Vaccines', + imagePath: 'insurance_card_icon.png', + subTitle: 'Card', + ), + ), + ), + ], + ), ], ), ), diff --git a/lib/pages/vaccine/my_vaccines_screen.dart b/lib/pages/vaccine/my_vaccines_screen.dart new file mode 100644 index 00000000..cfb0415f --- /dev/null +++ b/lib/pages/vaccine/my_vaccines_screen.dart @@ -0,0 +1,361 @@ +import 'dart:typed_data'; +import 'dart:convert'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:flutter/cupertino.dart'; +import '../base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; +import 'package:flutter_email_sender/flutter_email_sender.dart'; +import 'package:popup_box/popup_box.dart'; + +class MyVaccines extends StatefulWidget { + @override + _MyVaccinesState createState() => _MyVaccinesState(); +} + +class _MyVaccinesState extends State { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getVaccine(), + builder: (BuildContext context, VaccineViewModel model, Widget child) => + AppScaffold( + isShowAppBar: true, + appBarTitle: 'My Vaccines', + baseViewModel: model, + body: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: Column( + children: [ + RoundedContainer( + backgroundColor: Colors.white, + child: ExpansionTile( + title: Container( + height: 65.0, + child: Text('2018'), + ), + children: [ + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.vaccineList == null + ? 0 + : model.vaccineList.length, + itemBuilder: (BuildContext context, int index) { + return Column( + children: [ + RoundedContainer( + child: Column( + children: [ + Row( + children: [ + Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.0, + vertical: 20.0), + child: Image.network( + model.vaccineList[index] + .doctorImageURL, + height: SizeConfig + .imageSizeMultiplier * + 23, + width: SizeConfig + .imageSizeMultiplier * + 20, + fit: BoxFit.fill, + ), + ), + ], + ), + Container( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + model.vaccineList[index] + .doctorTitle + + model.vaccineList[index] + .doctorName, + style: TextStyle( + fontWeight: FontWeight.w900, + fontSize: 16.6, + ), + ), + SpaceBetweenTexts(space: 7.0), + Text( + model.vaccineList[index] + .projectName, + style: TextStyle( + fontSize: 17.0, + letterSpacing: 0.5, + ), + ), + SpaceBetweenTexts(space: 7.0), + Text( + model.vaccineList[index] + .vaccineName, + style: TextStyle( + fontSize: 17.0, + ), + ), + SpaceBetweenTexts(space: 7.0), + Text( + 'Date Taken ' + + convertDateFormat(model + .vaccineList[index] + .invoiceDate), + style: + TextStyle(fontSize: 17.0), + ), + ], + ), + ), + ], + ), + ], + ), + ), + ], + ); + }), + ) + ], + ), + ), + SpaceBetweenTexts(space: 165.0), + Flexible( + child: Container( + width: 350.0, + height: 80.0, + child: Button( + label: 'CHECK VACCINE AVAILABILITY', + backgroundColor: Color(0xff9EA3A4), + ), + ), + ), + Flexible( + child: Container( + width: 350.0, + height: 80.0, + child: Button( + label: 'SEND EMAIL', + backgroundColor: Color(0xffF62426), + onTap: () async { + await PopupBox.showPopupBox( + context: context, + button: MaterialButton( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20), + ), + color: Colors.white, + child: Text( + 'CANCEL', + style: TextStyle(fontSize: 16.5), + ), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + willDisplayWidget: Column( + children: [ + Text( + 'Conform \nSend a copy of this report to the email' + + model.vaccineList[0].doctorName, + style: TextStyle( + fontSize: 20, + color: Colors.black26, + fontWeight: FontWeight.w900), + ), + SizedBox( + height: 30.0, + ), + ], + )); + }, + ), + ), + ), + ], + ), + +// child: ListView.builder( +// itemCount: model.vaccineList == null ? 0 : model.vaccineList.length, +// itemBuilder: (BuildContext context, int index) { +// return Column( +// children: [ +// RoundedContainer( +// backgroundColor: Colors.white, +// child: Column( +// children: [ +// ExpansionTile( +// title: Container( +// height: 60.0, +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Texts('2018'), +// ], +// ), +// ), +// children: [ +// Column( +// children: [ +// Row( +// children: [ +// Column( +// children: [ +// Padding( +// padding: EdgeInsets.symmetric( +// horizontal: 20.0, vertical: 20.0), +// child: Container( +// child: Image.network( +// model.vaccineList[index] +// .doctorImageURL, +// height: SizeConfig +// .imageSizeMultiplier * +// 23, +// width: SizeConfig +// .imageSizeMultiplier * +// 20, +// fit: BoxFit.fill, +// colorBlendMode: +// BlendMode.hardLight, +// ), +// ), +// ) +// ], +// ), +// Container( +// child: Column( +// mainAxisAlignment: +// MainAxisAlignment.start, +// crossAxisAlignment: +// CrossAxisAlignment.start, +// children: [ +// Text( +// model.vaccineList[index] +// .doctorTitle + +// model.vaccineList[index] +// .doctorName, +// style: TextStyle( +// fontWeight: FontWeight.w900, +// fontSize: 17.5), +// ), +// Text( +// model +// .vaccineList[index].projectName, +// style: TextStyle( +// fontSize: 19.0, +// letterSpacing: 0.3, +// color: Colors.grey, +// fontWeight: FontWeight.bold), +// ), +// Text( +// model +// .vaccineList[index].vaccineName, +// style: TextStyle( +// fontSize: 19.0, +// color: Colors.grey, +// fontWeight: FontWeight.bold), +// ), +// Text( +// 'Date Taken ' + +// convertDateFormat(model +// .vaccineList[index] +// .invoiceDate), +// style: TextStyle( +// fontSize: 19.0, +// color: Colors.grey, +// fontWeight: FontWeight.bold), +// ), +// ], +// ), +// ), +// ], +// ), +// ], +// ), +// ], +// ), +// ], +// ), +// ), +// Container( +// width: 300, +// child: Button( +// label: 'CHECK VACCINE AVAILABILITY', +// backgroundColor: Color(0xff9EA3A4), +// ), +// ), +// Container( +// width: 300, +// child: Button( +// label: 'SEND EMAIL', +// backgroundColor: Color(0xff9EA3A4), +// ), +// ), +// ], +// ); +// }, +// ), + ), + ), + ); + } + + convertDateFormat(String Date) { + const start = "/Date("; + const end = "+0300)"; + + final startIndex = Date.indexOf(start); + final endIndex = Date.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(Date.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "-" + + date.month.toString().padLeft(2, '0') + + "-" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); + } + + emailSender() async { + final Email email = Email( + body: 'Email body', + subject: 'Email subject', + recipients: ['example@example.com'], + cc: ['cc@example.com'], + bcc: ['bcc@example.com'], + attachmentPaths: ['/path/to/attachment.zip'], + isHTML: false, + ); + + await FlutterEmailSender.send(email); + } +} + +class SpaceBetweenTexts extends StatelessWidget { + final double space; + SpaceBetweenTexts({this.space}); + + @override + Widget build(BuildContext context) { + return SizedBox( + height: space, + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index e2735c4f..c6bf3b03 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -83,6 +83,14 @@ dependencies: #hijri hijri: ^2.0.3 + #Email Sender + flutter_email_sender: ^3.0.1 + + #Popup_window + popup_box: ^0.1.0 + + + From 1b3a780a29bb0ec5396ecae55e5093ed6792180e Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 3 Sep 2020 11:27:15 +0300 Subject: [PATCH 06/15] add ar lan for medical profile --- ios/Runner.xcodeproj/project.pbxproj | 3 - lib/config/localized_values.dart | 100 ++++++-- lib/core/service/client/base_app_client.dart | 2 +- lib/core/viewModels/project_view_model.dart | 4 +- lib/pages/landing/home_page.dart | 14 +- lib/pages/landing/landing_page.dart | 2 +- .../medical/doctor/doctor_home_page.dart | 38 +-- lib/pages/medical/labs/labs_home_page.dart | 9 +- lib/pages/medical/medical_profile_page.dart | 227 +++++++++++------- .../prescriptions_history_page.dart | 5 +- .../prescriptions_home_page.dart | 7 +- .../prescriptions/prescriptions_page.dart | 5 +- .../radiology/radiology_home_page.dart | 9 +- .../vital_sign/vital_sign_details_screen.dart | 20 +- lib/uitl/translations_delegate_base.dart | 53 ++++ 15 files changed, 340 insertions(+), 158 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index c1c5e34c..5ba52820 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -356,7 +356,6 @@ /* Begin XCBuildConfiguration section */ 249021D3217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -433,7 +432,6 @@ }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -489,7 +487,6 @@ }; 97C147041CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 3291870d..903943ef 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -343,7 +343,10 @@ const Map> localizedValues = { "en": "Online Payment Service", 'ar': 'خدمة الدفع عبر الإلكتدوني' }, - "OffersAndPackages": {"en": "Online transfer request", 'ar': 'طلب التحويل الالكتروني'}, + "OffersAndPackages": { + "en": "Online transfer request", + 'ar': 'طلب التحويل الالكتروني' + }, "ComprehensiveMedicalCheckup": { "en": "Comprehensive Medical Check up", 'ar': 'فحص طبي شامل' @@ -362,20 +365,87 @@ const Map> localizedValues = { "medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'}, "consultation": {"en": "Consultation", "ar": "استشارة"}, "logs": {"en": "Logs", "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":"خدمات الطوارئ"}, + "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": "خدمات الطوارئ"}, "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"}, "MyAppointments": {"en": "My Appointments", "ar": "مواعيدي"}, - "NoBookedAppointments": {"en": "No Booked Appointments", "ar": "لا توجد مواعيد محجوزة"}, - "NoConfirmedAppointments": {"en": "No Confirmed Appointments", "ar": "لا توجد مواعيد مؤكدة"}, - "noArrivedAppointments": {"en": "No Arrived Appointments", "ar": "لم تصل المواعيد"}, + "NoBookedAppointments": { + "en": "No Booked Appointments", + "ar": "لا توجد مواعيد محجوزة" + }, + "NoConfirmedAppointments": { + "en": "No Confirmed Appointments", + "ar": "لا توجد مواعيد مؤكدة" + }, + "noArrivedAppointments": { + "en": "No Arrived Appointments", + "ar": "لم تصل المواعيد" + }, + "MyAppointmentsList": {"en": "List", "ar": "قائمة بمواعدي"}, + "Radiology": {"en": "Radiology", "ar": "الأشعة"}, + "RadiologySubtitle": {"en": "Result", "ar": "صور وتقارير"}, + "Lab": {"en": "Lab", "ar": "تحليل المختبر"}, + "LabSubtitle": {"en": "Result", "ar": "نتائج"}, + "Medicines": {"en": "Medicines", "ar": "الوصفات"}, + "MedicinesSubtitle": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, + "VitalSigns": {"en": "Vital Signs", "ar": "المؤشرات الحيوية"}, + "VitalSignsSubTitle": {"en": "Reports", "ar": "قراءات"}, + "MyMedical": {"en": "Active", "ar": "قراءات"}, + "MyMedicalSubtitle": {"en": "Medications", "ar": "النشطة"}, + "MyDoctor": {"en": "My Doctor", "ar": "اطبائي"}, + "MyDoctorSubtitle": {"en": "List", "ar": "قمت بزيارتهم"}, + "Eye": {"en": "Eye", "ar": "قياسات"}, + "EyeSubtitle": {"en": "Measurement", "ar": "النظر"}, + "Insurance": {"en": "Insurance", "ar": "بطاقة"}, + "InsuranceSubtitle": {"en": "Card", "ar": "التأمين"}, + "UpdateInsurance": {"en": "Update Insurance", "ar": "تحديث التأمين"}, + "UpdateInsuranceSubtitle": {"en": "Card", "ar": "التأمين"}, + "InsuranceApproval": {"en": "Insurance Approval", "ar": "موافقات"}, + "InsuranceApprovalSubtitle": {"en": "Approvals", "ar": "موافقات التأمين"}, + "Allergies": {"en": "Approvals", "ar": "الحساسية"}, + "AllergiesSubtitle": {"en": "Diagnosed", "ar": "مسجلة"}, + "MyVaccines": {"en": "My Vaccines", "ar": "تطعيماتي"}, + "MyVaccinesSubtitle": {"en": "List", "ar": "قائمة"}, + "Medical": {"en": "Medical", "ar": "التقارير"}, + "MedicalSubtitle": {"Report": "List", "ar": "الطبية"}, + "Monthly": {"en": "Monthly", "ar": "تقارير"}, + "MonthlySubtitle": {"en": "Report", "ar": "الشهرية"}, + "Sick": {"en": "Sick", "ar": "الإجازات"}, + "SickSubtitle": {"en": "Leaves", "ar": "المرضية"}, + "MyBalance": {"en": "My Balance", "ar": "ارصدتي"}, + "MyBalanceSubtitle": {"en": "Credit", "ar": "المبالغ"}, + "PatientCall": {"en": "Patient Call", "ar": "النداء للموعد"}, + "PatientCallSubtitle": {"en": "Service", "ar": "خدمة"}, + "SmartWatches": {"en": "Smart Watches", "ar": "الساعة الذكية"}, + "SmartWatchesSubtitle": {"en": "Pairing", "ar": "ربط البيانات"}, + "MyTrackers": {"en": "My Trackers", "ar": "تتبع قراءاتي"}, + "MyTrackersSubtitle": {"en": "Service", "ar": "الطبية"}, + "AskYour": {"en": "Ask Your", "ar": "إرسل طبيبك"}, + "AskYourSubtitle": {"en": "Doctor", "ar": "خدمة"}, + "Internet": {"en": "Internet", "ar": "الاتصال"}, + "InternetSubtitle": {"en": "Pairing", "ar": "بالإنترنت"}, + "Chatbot": {"en": "Chatbot", "ar": "تاشت بوت"}, + "ChatbotSubtitle": {"en": "", "ar": ""}, + "TimeLine": {"en": "Time Line", "ar": "الجدول الزمني"}, + "LabOrders": {"en": "Lab Orders", "ar": "تحاليل المختبر"}, + "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, + "Prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, + "History": {"en": "History", "ar": "السجل"}, + "OrderNo": {"en": "Order No", "ar": "رقم الطلب"}, + "OrderDetails": {"en": "Order Details", "ar": "تفاصيل الطلب"}, + "VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"}, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index aa48c49d..efb168c8 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -31,7 +31,7 @@ class BaseAppClient { //Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en'); + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var user = await sharedPref.getObject(USER_PROFILE); body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 5975daf2..40cdd432 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 = 'en'; + String currentLanguage = 'ar'; 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 ?? 'en'); + _appLocale = Locale(currentLanguage ?? 'ar'); _isArabic = currentLanguage != null ? currentLanguage == 'ar' ? true : false : true; diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 5e5c5971..d0c8d382 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -368,13 +368,13 @@ class _HomePageState extends State { textAlign: TextAlign.center, color: Colors.white, bold: true, - fontSize: SizeConfig.textMultiplier * 2.0, + fontSize: SizeConfig.textMultiplier * 1.7, ) ], ), ), ), - height: MediaQuery.of(context).size.width*0.4, + height: MediaQuery.of(context).size.width * 0.4, imageName: 'home_healthcare_service_bg.png', opacity: 0.5, ), @@ -403,7 +403,7 @@ class _HomePageState extends State { ), ), ), - height: MediaQuery.of(context).size.width*0.4, + height: MediaQuery.of(context).size.width * 0.4, imageName: 'al-habib_onlne_pharmacy_bg.png', ), DashboardItem( @@ -431,7 +431,7 @@ class _HomePageState extends State { ), ), ), - height: MediaQuery.of(context).size.width*0.4, + height: MediaQuery.of(context).size.width * 0.4, color: Hexcolor("#747C80"), imageName: 'emergency_service_image.png', ), @@ -472,7 +472,7 @@ class _HomePageState extends State { ), ), ), - height: MediaQuery.of(context).size.width*0.4, + height: MediaQuery.of(context).size.width * 0.4, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.0), color: Colors.white, @@ -505,7 +505,7 @@ class _HomePageState extends State { ), ), width: MediaQuery.of(context).size.width * 0.29, - height: MediaQuery.of(context).size.width*0.4, + height: MediaQuery.of(context).size.width * 0.4, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.0), color: Colors.white, @@ -536,7 +536,7 @@ class _HomePageState extends State { ), ), ), - height: MediaQuery.of(context).size.width*0.4, + height: MediaQuery.of(context).size.width * 0.4, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.0), color: Colors.white, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 0e25c819..46e5e2fb 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -253,7 +253,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { case 0: return TranslationBase.of(context).home; case 1: - return 'Medical Profile'; + return TranslationBase.of(context).medicalProfile; case 2: return TranslationBase.of(context).mySchedule; case 3: diff --git a/lib/pages/medical/doctor/doctor_home_page.dart b/lib/pages/medical/doctor/doctor_home_page.dart index 075565e0..456b0bcb 100644 --- a/lib/pages/medical/doctor/doctor_home_page.dart +++ b/lib/pages/medical/doctor/doctor_home_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -36,7 +37,7 @@ class DoctorHomePage extends StatelessWidget { child: InkWell( onTap: () => model.setFilterType(FilterType.Clinic), child: ListTile( - title: const Text('Clinic'), + title: Text(TranslationBase.of(context).clinic), leading: Radio( value: FilterType.Clinic, groupValue: model.filterType, @@ -53,7 +54,7 @@ class DoctorHomePage extends StatelessWidget { child: InkWell( onTap: () => model.setFilterType(FilterType.Hospital), child: ListTile( - title: const Text('Hospital'), + title: Text(TranslationBase.of(context).hospital), leading: Radio( value: FilterType.Hospital, groupValue: model.filterType, @@ -78,21 +79,23 @@ class DoctorHomePage extends StatelessWidget { .patientDoctorAppointmentList .map((doctor) { DoctorList doctorList = DoctorList( - projectID: doctor.projectID, - setupID: doctor.setupID, - clinicID: doctor.clinicID, - projectName: doctor.projectName, - clinicName: doctor.clinicName, - actualDoctorRate: doctor.actualDoctorRate, - doctorID: doctor.doctorID, - doctorRate: doctor.doctorRate, - gender: doctor.gender, - doctorTitle: doctor.doctorTitle, - name: doctor.doctorName, - doctorImageURL: doctor.doctorImageURL, - nationalityFlagURL:doctor.nationalityFlagURL + projectID: doctor.projectID, + setupID: doctor.setupID, + clinicID: doctor.clinicID, + projectName: doctor.projectName, + clinicName: doctor.clinicName, + actualDoctorRate: doctor.actualDoctorRate, + doctorID: doctor.doctorID, + doctorRate: doctor.doctorRate, + gender: doctor.gender, + doctorTitle: doctor.doctorTitle, + name: doctor.doctorName, + doctorImageURL: doctor.doctorImageURL, + nationalityFlagURL: doctor.nationalityFlagURL); + return DoctorView( + doctor: doctorList, ); - return DoctorView(doctor: doctorList,);/* InkWell( + /* InkWell( onTap: () async { model .getDoctorProfileAndRating( @@ -119,7 +122,8 @@ class DoctorHomePage extends StatelessWidget { subName: DateUtil.getMonthDayYearDateFormatted( doctor.appointmentDate), ), - )*/; + )*/ + ; }).toList(), )), ) diff --git a/lib/pages/medical/labs/labs_home_page.dart b/lib/pages/medical/labs/labs_home_page.dart index 00cd82a1..325d5dcd 100644 --- a/lib/pages/medical/labs/labs_home_page.dart +++ b/lib/pages/medical/labs/labs_home_page.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -19,7 +20,7 @@ class LabsHomePage extends StatelessWidget { builder: (context, LabsViewModel model, widget) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: 'Lab Orders', + appBarTitle: TranslationBase.of(context).labOrders, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( @@ -34,7 +35,7 @@ class LabsHomePage extends StatelessWidget { child: InkWell( onTap: () => model.setFilterType(FilterType.Clinic), child: ListTile( - title: const Text('Clinic'), + title: Text(TranslationBase.of(context).clinic), leading: Radio( value: FilterType.Clinic, groupValue: model.filterType, @@ -51,7 +52,7 @@ class LabsHomePage extends StatelessWidget { child: InkWell( onTap: () => model.setFilterType(FilterType.Hospital), child: ListTile( - title: const Text('Hospital'), + title: Text(TranslationBase.of(context).hospital), leading: Radio( value: FilterType.Hospital, groupValue: model.filterType, @@ -85,7 +86,7 @@ class LabsHomePage extends StatelessWidget { ), name: labOrder.doctorName, profileUrl: labOrder.doctorImageURL, - subName: 'Bill No : ${labOrder.invoiceNo}', + subName: TranslationBase.of(context).billNo+' ${labOrder.invoiceNo}', date: DateUtil.getMonthDayYearDateFormatted( labOrder.orderDate), ); diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 87486ce5..d0998ec5 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -2,12 +2,14 @@ import 'dart:math'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/time_line_widget.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -17,6 +19,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; +import 'package:provider/provider.dart'; import '../../locator.dart'; import 'doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; @@ -31,6 +34,7 @@ class MedicalProfilePage extends StatefulWidget { class _MedicalProfilePageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getAppointmentHistory(), builder: (_, model, widget) => AppScaffold( @@ -48,11 +52,9 @@ class _MedicalProfilePageState extends State { height: 210, decoration: BoxDecoration( image: DecorationImage( - image: ExactAssetImage( - 'assets/images/timeline_bg.png'), - fit: BoxFit.cover - ), - + image: ExactAssetImage( + 'assets/images/timeline_bg.png'), + fit: BoxFit.cover), ), child: Stack( children: [ @@ -76,7 +78,7 @@ class _MedicalProfilePageState extends State { ), ), Padding( - padding: EdgeInsets.symmetric(vertical: 12.0), + padding: EdgeInsets.symmetric(vertical: 5.0), child: Column( children: [ Container( @@ -89,13 +91,19 @@ class _MedicalProfilePageState extends State { flex: 1, child: InkWell( onTap: () { - Navigator.push(context, - FadePage(page: MyAppointments())); + Navigator.push( + context, + FadePage( + page: MyAppointments(), + ), + ); }, child: MedicalProfileItem( - title: 'My Appointments', + title: TranslationBase.of(context) + .myAppointments, imagePath: 'my_appointment_icon.png', - subTitle: 'List', + subTitle: TranslationBase.of(context) + .myAppointmentsList, ), ), ), @@ -103,11 +111,12 @@ class _MedicalProfilePageState extends State { flex: 1, child: InkWell( onTap: () => Navigator.push(context, - FadePage(page: RadiologyHomePage())), + FadePage(page: LabsHomePage())), child: MedicalProfileItem( - title: 'Radiology', - imagePath: 'radiology_icon.png', - subTitle: 'Service', + title: TranslationBase.of(context).lab, + imagePath: 'lab_result_icon.png', + subTitle: + TranslationBase.of(context).lab, ), ), ), @@ -115,11 +124,13 @@ class _MedicalProfilePageState extends State { flex: 1, child: InkWell( onTap: () => Navigator.push(context, - FadePage(page: LabsHomePage())), + FadePage(page: RadiologyHomePage())), child: MedicalProfileItem( - title: 'Lab', - imagePath: 'lab_result_icon.png', - subTitle: 'Result', + title: TranslationBase.of(context) + .radiology, + imagePath: 'radiology_icon.png', + subTitle: TranslationBase.of(context) + .radiologySubtitle, ), ), ), @@ -132,14 +143,18 @@ class _MedicalProfilePageState extends State { child: InkWell( onTap: () { Navigator.push( - context, - FadePage( - page: HomePrescriptionsPage())); + context, + FadePage( + page: HomePrescriptionsPage(), + ), + ); }, child: MedicalProfileItem( - title: 'Medicines', + title: TranslationBase.of(context) + .medicines, imagePath: 'prescription_icon.png', - subTitle: 'Prescriptions', + subTitle: TranslationBase.of(context) + .medicinesSubtitle, ), ), ), @@ -147,13 +162,17 @@ class _MedicalProfilePageState extends State { flex: 1, child: InkWell( onTap: () => Navigator.push( - context, - FadePage( - page: VitalSignDetailsScreen())), + context, + FadePage( + page: VitalSignDetailsScreen(), + ), + ), child: MedicalProfileItem( - title: 'Vital Signs', + title: TranslationBase.of(context) + .vitalSigns, imagePath: 'medical_history_icon.png', - subTitle: 'Reports', + subTitle: TranslationBase.of(context) + .vitalSignsSubtitle, ), ), ), @@ -163,9 +182,11 @@ class _MedicalProfilePageState extends State { // onTap: () => Navigator.push( // context, FadePage(page: RadiologyHomePage())), child: MedicalProfileItem( - title: 'My Medicines ', + title: TranslationBase.of(context) + .myMedical, imagePath: 'radiology_icon.png', - subTitle: 'Service', + subTitle: TranslationBase.of(context) + .myMedicalSubtitle, ), ), ), @@ -177,13 +198,19 @@ class _MedicalProfilePageState extends State { flex: 1, child: InkWell( onTap: () { - Navigator.push(context, - FadePage(page: DoctorHomePage())); + Navigator.push( + context, + FadePage( + page: DoctorHomePage(), + ), + ); }, child: MedicalProfileItem( - title: 'My Doctor', + title: TranslationBase.of(context) + .myDoctor, imagePath: 'doctor_icon.png', - subTitle: 'List', + subTitle: TranslationBase.of(context) + .myDoctorSubtitle, ), ), ), @@ -196,10 +223,11 @@ class _MedicalProfilePageState extends State { // FadePage(page: InsuranceApproval())); // }, child: MedicalProfileItem( - title: 'Eye', + title: TranslationBase.of(context).eye, imagePath: 'insurance_approvals_icon.png', - subTitle: 'Measurement', + subTitle: TranslationBase.of(context) + .eyeSubtitle, ), ), ), @@ -211,9 +239,11 @@ class _MedicalProfilePageState extends State { FadePage(page: InsuranceCard())); }, child: MedicalProfileItem( - title: 'Insurance', + title: TranslationBase.of(context) + .insurance, imagePath: 'insurance_card_icon.png', - subTitle: 'Card', + subTitle: TranslationBase.of(context) + .insuranceSubtitle, ), ), ), @@ -229,32 +259,38 @@ class _MedicalProfilePageState extends State { // context, FadePage(page: DoctorHomePage())); // }, child: MedicalProfileItem( - title: 'Update Insurance', + title: TranslationBase.of(context) + .updateInsurance, imagePath: 'insurance_card_icon.png', - subTitle: 'card', + subTitle: TranslationBase.of(context) + .updateInsuranceSubtitle, ), ), ), Expanded( flex: 1, child: InkWell( -// onTap: () { -// Navigator.push( -// context, FadePage(page: InsuranceApproval())); -// }, + onTap: () { + Navigator.push( + context, FadePage(page: InsuranceApproval())); + }, child: MedicalProfileItem( - title: 'Insurance Approval', + title: TranslationBase.of(context) + .insuranceApproval, imagePath: 'insurance_approvals_icon.png', - subTitle: '', + subTitle: TranslationBase.of(context) + .insuranceApprovalSubtitle, ), ), ), Expanded( flex: 1, child: MedicalProfileItem( - title: 'Allergies', + title: + TranslationBase.of(context).allergies, imagePath: 'medical_history_icon.png', - subTitle: 'Diagnosed', + subTitle: TranslationBase.of(context) + .allergiesSubtitle, ), ), ]), @@ -268,9 +304,11 @@ class _MedicalProfilePageState extends State { // context, FadePage(page: DoctorHomePage())); // }, child: MedicalProfileItem( - title: 'My Vaccines', + title: TranslationBase.of(context) + .myVaccines, imagePath: 'insurance_card_icon.png', - subTitle: 'card', + subTitle: TranslationBase.of(context) + .myVaccinesSubtitle, ), ), ), @@ -282,18 +320,21 @@ class _MedicalProfilePageState extends State { FadePage(page: HomeReportPage())); }, child: MedicalProfileItem( - title: 'Medical', + title: + TranslationBase.of(context).medical, imagePath: 'insurance_approvals_icon.png', - subTitle: 'Reports', + subTitle: TranslationBase.of(context) + .medicalSubtitle, ), ), ), Expanded( flex: 1, child: MedicalProfileItem( - title: 'Monthly', + title: TranslationBase.of(context).monthly, imagePath: 'medical_history_icon.png', - subTitle: 'Report', + subTitle: TranslationBase.of(context) + .monthlySubtitle, ), ), ]), @@ -307,9 +348,10 @@ class _MedicalProfilePageState extends State { // context, FadePage(page: DoctorHomePage())); // }, child: MedicalProfileItem( - title: 'Sick', + title: TranslationBase.of(context).sick, imagePath: 'insurance_card_icon.png', - subTitle: 'Leaves', + subTitle: TranslationBase.of(context) + .sickSubtitle, ), ), ), @@ -321,18 +363,22 @@ class _MedicalProfilePageState extends State { // context, FadePage(page: InsuranceApproval())); // }, child: MedicalProfileItem( - title: 'My Balance', + title: + TranslationBase.of(context).myBalance, imagePath: 'insurance_approvals_icon.png', - subTitle: 'Credit', + subTitle: TranslationBase.of(context) + .myBalanceSubtitle, ), ), ), Expanded( flex: 1, child: MedicalProfileItem( - title: 'Patient Call', + title: + TranslationBase.of(context).patientCall, imagePath: 'medical_history_icon.png', - subTitle: 'Service', + subTitle: TranslationBase.of(context) + .patientCallSubtitle, ), ), ]), @@ -346,9 +392,11 @@ class _MedicalProfilePageState extends State { // context, FadePage(page: DoctorHomePage())); // }, child: MedicalProfileItem( - title: 'Smart Watches', + title: TranslationBase.of(context) + .smartWatches, imagePath: 'insurance_card_icon.png', - subTitle: 'Pairing', + subTitle: TranslationBase.of(context) + .smartWatchesSubtitle, ), ), ), @@ -360,18 +408,21 @@ class _MedicalProfilePageState extends State { // context, FadePage(page: InsuranceApproval())); // }, child: MedicalProfileItem( - title: 'My Trackers', + title: TranslationBase.of(context) + .myTrackers, imagePath: 'insurance_approvals_icon.png', - subTitle: 'Service', + subTitle: TranslationBase.of(context) + .myTrackersSubtitle, ), ), ), Expanded( flex: 1, child: MedicalProfileItem( - title: 'Ask Your', + title: TranslationBase.of(context).askYour, imagePath: 'medical_history_icon.png', - subTitle: 'Doctor', + subTitle: TranslationBase.of(context) + .askYourSubtitle, ), ), ]), @@ -385,9 +436,11 @@ class _MedicalProfilePageState extends State { // context, FadePage(page: DoctorHomePage())); // }, child: MedicalProfileItem( - title: 'Internet', + title: + TranslationBase.of(context).internet, imagePath: 'insurance_card_icon.png', - subTitle: 'Pairing', + subTitle: TranslationBase.of(context) + .internetSubtitle, ), ), ), @@ -399,19 +452,17 @@ class _MedicalProfilePageState extends State { // context, FadePage(page: InsuranceApproval())); // }, child: MedicalProfileItem( - title: 'My Trackers', + title: + TranslationBase.of(context).chatbot, imagePath: 'insurance_approvals_icon.png', - subTitle: 'Service', + subTitle: TranslationBase.of(context) + .chatbotSubtitle, ), ), ), Expanded( flex: 1, - child: MedicalProfileItem( - title: 'Ask Your', - imagePath: 'medical_history_icon.png', - subTitle: 'Doctor', - ), + child: Container(), ), ]), ], @@ -428,17 +479,16 @@ class _MedicalProfilePageState extends State { width: double.infinity, height: 70, decoration: BoxDecoration( - color: Colors.grey[600], - shape: BoxShape.rectangle, - border: Border.all( - color: Colors.transparent, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(9)), - image: DecorationImage( - image: ExactAssetImage( - 'assets/images/bg_graphic.png'), - fit: BoxFit.cover - ) - ), + color: Colors.grey[600], + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(9)), + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/bg_graphic.png'), + fit: BoxFit.cover)), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -464,9 +514,10 @@ class _MedicalProfilePageState extends State { ), Positioned( top: 2, - left: 10, + left: projectViewModel.isArabic ? 0 : 10, + right: projectViewModel.isArabic ? 10 : 0, child: Texts( - 'Time Line ', + TranslationBase.of(context).timeLine, color: Colors.white, fontSize: 14, fontWeight: FontWeight.normal, diff --git a/lib/pages/medical/prescriptions/prescriptions_history_page.dart b/lib/pages/medical/prescriptions/prescriptions_history_page.dart index efd9df44..9d63bf7d 100644 --- a/lib/pages/medical/prescriptions/prescriptions_history_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_history_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_details_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -49,7 +50,7 @@ class PrescriptionsHistoryPage extends StatelessWidget { height: 5, ), Texts( - 'Order No ${prescriptionsViewModel.prescriptionsHistory[index].iD}'), + '${TranslationBase.of(context).orderNo} ${prescriptionsViewModel.prescriptionsHistory[index].iD}'), SizedBox( height: 5, ), @@ -59,7 +60,7 @@ class PrescriptionsHistoryPage extends StatelessWidget { height: 5, ), Texts( - 'Order Details', + '${TranslationBase.of(context).orderNo}', fontWeight: FontWeight.w300, ), SizedBox( diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart index fd903b4b..e6e3e6db 100644 --- a/lib/pages/medical/prescriptions/prescriptions_home_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_home_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -36,7 +37,7 @@ class _HomePrescriptionsPageState extends State onModelReady: (model) => model.getPrescriptions(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: 'My Doctors', + appBarTitle: TranslationBase.of(context).myDoctor, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -84,13 +85,13 @@ class _HomePrescriptionsPageState extends State Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: Texts('Prescriptions'), + child: Texts(TranslationBase.of(context).prescriptions), ), ), Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: Texts('History'), + child: Texts(TranslationBase.of(context).history), ), ), ], diff --git a/lib/pages/medical/prescriptions/prescriptions_page.dart b/lib/pages/medical/prescriptions/prescriptions_page.dart index e335f41c..e6e90d9e 100644 --- a/lib/pages/medical/prescriptions/prescriptions_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_page.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_items_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -32,7 +33,7 @@ class PrescriptionsPage extends StatelessWidget { onTap: () => prescriptionsViewModel.setFilterType(FilterType.Clinic), child: ListTile( - title: const Text('Clinic'), + title: Text(TranslationBase.of(context).clinic), leading: Radio( value: FilterType.Clinic, groupValue: prescriptionsViewModel.filterType, @@ -50,7 +51,7 @@ class PrescriptionsPage extends StatelessWidget { onTap: () => prescriptionsViewModel .setFilterType(FilterType.Hospital), child: ListTile( - title: const Text('Hospital'), + title: Text(TranslationBase.of(context).hospital), leading: Radio( value: FilterType.Hospital, groupValue: prescriptionsViewModel.filterType, diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index 3288dcaf..0f9f4c7b 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_mode import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -17,7 +18,7 @@ class RadiologyHomePage extends StatelessWidget { onModelReady: (model) => model.getPatientRadOrders(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: 'Radiology', + appBarTitle: TranslationBase.of(context).radiology, baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, @@ -32,7 +33,7 @@ class RadiologyHomePage extends StatelessWidget { onTap: () => model.setFilterType(FilterType.Clinic), child: ListTile( - title: const Text('Clinic'), + title: Text(TranslationBase.of(context).clinic), leading: Radio( value: FilterType.Clinic, groupValue: model.filterType, @@ -50,7 +51,7 @@ class RadiologyHomePage extends StatelessWidget { onTap: () => model .setFilterType(FilterType.Hospital), child: ListTile( - title: const Text('Hospital'), + title: Text(TranslationBase.of(context).hospital), leading: Radio( value: FilterType.Hospital, groupValue: model.filterType, @@ -85,7 +86,7 @@ class RadiologyHomePage extends StatelessWidget { child: DoctorCard( name: radiology.doctorName, profileUrl: radiology.doctorImageURL, - subName: '${radiology.projectName} \nBill No ${radiology.invoiceNo}', + subName: '${radiology.projectName} \n${TranslationBase.of(context).billNo} ${radiology.invoiceNo}', date: DateUtil.getMonthDayYearDateFormatted( radiology.orderDate), ), diff --git a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart index a0dc78ff..b8c4eda2 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart @@ -16,7 +16,6 @@ class VitalSignDetailsScreen extends StatelessWidget { int appointmentNo; int projectID; - VitalSignDetailsScreen({this.appointmentNo, this.projectID}); @override @@ -28,7 +27,7 @@ class VitalSignDetailsScreen extends StatelessWidget { : (model) => model.getPatientRadOrders(), builder: (_, mode, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: 'Vital Sign', + appBarTitle: TranslationBase.of(context).vitalSigns, baseViewModel: mode, body: mode.vitalSignResModelList.length > 0 ? Container( @@ -42,7 +41,7 @@ class VitalSignDetailsScreen extends StatelessWidget { FadePage( page: VitalSignItemDetailsScreen( pageKey: VitalSignDetails.Height, - pageTitle: 'Height', + pageTitle: TranslationBase.of(context).height, vitalList: mode.vitalSignResModelList, ), ), @@ -66,7 +65,7 @@ class VitalSignDetailsScreen extends StatelessWidget { FadePage( page: VitalSignItemDetailsScreen( pageKey: VitalSignDetails.Weight, - pageTitle: 'Weight', + pageTitle: TranslationBase.of(context).weight, vitalList: mode.vitalSignResModelList, ), ), @@ -92,7 +91,8 @@ class VitalSignDetailsScreen extends StatelessWidget { FadePage( page: VitalSignItemDetailsScreen( pageKey: VitalSignDetails.BodyMeasurements, - pageTitle: 'BMI', + pageTitle: TranslationBase.of(context) + .bodyMeasurements, vitalList: mode.vitalSignResModelList, ), ), @@ -112,7 +112,8 @@ class VitalSignDetailsScreen extends StatelessWidget { FadePage( page: VitalSignItemDetailsScreen( pageKey: VitalSignDetails.Temperature, - pageTitle: 'Temperature', + pageTitle: + TranslationBase.of(context).temperature, vitalList: mode.vitalSignResModelList, ), ), @@ -138,7 +139,7 @@ class VitalSignDetailsScreen extends StatelessWidget { FadePage( page: VitalSignItemDetailsScreen( pageKey: VitalSignDetails.heart, - pageTitle: 'Hart ', + pageTitle: TranslationBase.of(context).heart, vitalList: mode.vitalSignResModelList, ), ), @@ -160,7 +161,8 @@ class VitalSignDetailsScreen extends StatelessWidget { FadePage( page: VitalSignItemDetailsScreen( pageKey: VitalSignDetails.Respiration, - pageTitle: 'Respiration Rate', + pageTitle: + TranslationBase.of(context).respirationRate, vitalList: mode.vitalSignResModelList, ), ), @@ -187,7 +189,7 @@ class VitalSignDetailsScreen extends StatelessWidget { FadePage( page: VitalSignItemDetailsScreen( pageKey: VitalSignDetails.BloodPressure, - pageTitle: 'BloodPressure', + pageTitle: TranslationBase.of(context).pulse, vitalList: mode.vitalSignResModelList, ), ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 5b9f0fc7..114f3a1b 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -455,6 +455,59 @@ class TranslationBase { String get noBookedAppointments => localizedValues['NoBookedAppointments'][locale.languageCode]; String get noConfirmedAppointments => localizedValues['NoConfirmedAppointments'][locale.languageCode]; String get noArrivedAppointments => localizedValues['noArrivedAppointments'][locale.languageCode]; + String get myAppointmentsList => localizedValues['MyAppointmentsList'][locale.languageCode]; + String get radiology => localizedValues['Radiology'][locale.languageCode]; + String get radiologySubtitle => localizedValues['RadiologySubtitle'][locale.languageCode]; + String get lab => localizedValues['Lab'][locale.languageCode]; + String get labSubtitle => localizedValues['LabSubtitle'][locale.languageCode]; + String get medicines => localizedValues['Medicines'][locale.languageCode]; + String get medicinesSubtitle => localizedValues['MedicinesSubtitle'][locale.languageCode]; + String get vitalSigns => localizedValues['VitalSigns'][locale.languageCode]; + String get vitalSignsSubtitle => localizedValues['VitalSignsSubTitle'][locale.languageCode]; + String get myMedical => localizedValues['MyMedical'][locale.languageCode]; + String get myMedicalSubtitle => localizedValues['MyMedicalSubtitle'][locale.languageCode]; + String get myDoctor => localizedValues['MyDoctor'][locale.languageCode]; + String get myDoctorSubtitle => localizedValues['MyDoctorSubtitle'][locale.languageCode]; + String get eye => localizedValues['Eye'][locale.languageCode]; + String get eyeSubtitle => localizedValues['EyeSubtitle'][locale.languageCode]; + String get insurance => localizedValues['Insurance'][locale.languageCode]; + String get insuranceSubtitle => localizedValues['InsuranceSubtitle'][locale.languageCode]; + String get updateInsurance => localizedValues['UpdateInsurance'][locale.languageCode]; + String get updateInsuranceSubtitle => localizedValues['UpdateInsuranceSubtitle'][locale.languageCode]; + String get insuranceApproval => localizedValues['InsuranceApproval'][locale.languageCode]; + String get insuranceApprovalSubtitle => localizedValues['InsuranceApprovalSubtitle'][locale.languageCode]; + String get allergies => localizedValues['Allergies'][locale.languageCode]; + String get allergiesSubtitle => localizedValues['AllergiesSubtitle'][locale.languageCode]; + String get myVaccines => localizedValues['MyVaccines'][locale.languageCode]; + String get myVaccinesSubtitle => localizedValues['MyVaccinesSubtitle'][locale.languageCode]; + String get medical => localizedValues['Medical'][locale.languageCode]; + String get medicalSubtitle => localizedValues['MedicalSubtitle'][locale.languageCode]; + String get monthly => localizedValues['Monthly'][locale.languageCode]; + String get monthlySubtitle => localizedValues['MonthlySubtitle'][locale.languageCode]; + String get sick => localizedValues['Sick'][locale.languageCode]; + String get sickSubtitle => localizedValues['SickSubtitle'][locale.languageCode]; + String get myBalance => localizedValues['MyBalance'][locale.languageCode]; + String get myBalanceSubtitle => localizedValues['MyBalanceSubtitle'][locale.languageCode]; + String get patientCall => localizedValues['PatientCall'][locale.languageCode]; + String get patientCallSubtitle => localizedValues['PatientCallSubtitle'][locale.languageCode]; + String get smartWatches => localizedValues['SmartWatches'][locale.languageCode]; + String get smartWatchesSubtitle => localizedValues['SmartWatchesSubtitle'][locale.languageCode]; + String get myTrackers => localizedValues['MyTrackers'][locale.languageCode]; + String get myTrackersSubtitle => localizedValues['MyTrackersSubtitle'][locale.languageCode]; + String get askYour => localizedValues['AskYour'][locale.languageCode]; + String get askYourSubtitle => localizedValues['AskYourSubtitle'][locale.languageCode]; + String get internet => localizedValues['Internet'][locale.languageCode]; + String get internetSubtitle => localizedValues['InternetSubtitle'][locale.languageCode]; + String get chatbot => localizedValues['Chatbot'][locale.languageCode]; + String get chatbotSubtitle => localizedValues['ChatbotSubtitle'][locale.languageCode]; + String get timeLine => localizedValues['TimeLine'][locale.languageCode]; + String get labOrders => localizedValues['LabOrders'][locale.languageCode]; + String get billNo => localizedValues['BillNo'][locale.languageCode]; + String get prescriptions => localizedValues['Prescriptions'][locale.languageCode]; + String get history => localizedValues['History'][locale.languageCode]; + String get orderNo => localizedValues['OrderNo'][locale.languageCode]; + String get orderDetails => localizedValues['OrderDetails'][locale.languageCode]; + String get vitalSign => localizedValues['VitalSign'][locale.languageCode]; } From 51078227ab9f0e3e423a50c324f327bdf2074707 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 3 Sep 2020 11:51:40 +0300 Subject: [PATCH 07/15] Dental appointment flow implemented --- lib/config/config.dart | 3 + lib/config/localized_values.dart | 3 +- lib/core/service/client/base_app_client.dart | 42 ++++-- .../DentalChiefComplaintsModel.dart | 48 +++++++ .../BookAppointment/DentalComplaints.dart | 41 +++++- lib/pages/BookAppointment/SearchResults.dart | 2 +- .../BookAppointment/widgets/BranchView.dart | 2 +- .../widgets/DentalComplaintCard.dart | 135 ++++++++++++++++++ .../clinic_services/get_clinic_service.dart | 78 +++++++--- lib/uitl/translations_delegate_base.dart | 2 + 10 files changed, 315 insertions(+), 41 deletions(-) create mode 100644 lib/models/Appointments/DentalChiefComplaintsModel.dart create mode 100644 lib/pages/BookAppointment/widgets/DentalComplaintCard.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index f3b05b6a..8cdd118b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -75,6 +75,9 @@ const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; //URL to get doctors list const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; +//URL to dental doctors list +const GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; + //URL to get doctor free slots const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 95398e23..d950f05d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -374,5 +374,6 @@ const Map> localizedValues = { "gate":{"en":"Gate:","ar":"بوابة"}, "building":{"en":"Building:","ar":"المبنى"}, "branch":{"en":"Branch:","ar":"الفرع"}, - "emergencyServices":{"en":"Emergency Services:","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 f45fe22b..bc5c8a3f 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -2,14 +2,11 @@ import 'dart:convert'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart' as http; -import '../../../locator.dart'; import '../../../routes.dart'; AppSharedPreferences sharedPref = new AppSharedPreferences(); @@ -33,9 +30,11 @@ class BaseAppClient { var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en'); var user = await sharedPref.getObject(USER_PROFILE); - body['SetupID'] = body.containsKey('SetupID') - ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID - : SETUP_ID; + if (body.containsKey('SetupID')) { + body['SetupID'] = body.containsKey('SetupID') + ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID + : SETUP_ID; + } body['VersionID'] = body.containsKey('VersionID') ? body['VersionID'] != null ? body['VersionID'] : VERSION_ID : VERSION_ID; @@ -46,16 +45,29 @@ class BaseAppClient { body['PatientOutSA'] = body.containsKey('PatientOutSA') ? body['PatientOutSA'] != null ? body['PatientOutSA'] : PATIENT_OUT_SA : PATIENT_OUT_SA; - body['isDentalAllowedBackend'] = IS_DENTAL_ALLOWED_BACKEND; + + 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; - body['PatientType'] = body.containsKey('PatientType') - ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE - : PATIENT_TYPE; - body['PatientTypeID'] = body.containsKey('PatientTypeID') - ? body['PatientTypeID'] != null - ? body['PatientTypeID'] - : PATIENT_TYPE_ID - : PATIENT_TYPE_ID; + + if (body.containsKey('PatientType')) { + body['PatientType'] = body.containsKey('PatientType') + ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE + : PATIENT_TYPE; + } + + 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; body['PatientID'] = diff --git a/lib/models/Appointments/DentalChiefComplaintsModel.dart b/lib/models/Appointments/DentalChiefComplaintsModel.dart new file mode 100644 index 00000000..c15b828a --- /dev/null +++ b/lib/models/Appointments/DentalChiefComplaintsModel.dart @@ -0,0 +1,48 @@ +class DentalChiefComplaintsModel { + List listDentalChiefComplain; + + DentalChiefComplaintsModel({this.listDentalChiefComplain}); + + DentalChiefComplaintsModel.fromJson(Map json) { + if (json['List_DentalChiefComplain'] != null) { + listDentalChiefComplain = new List(); + json['List_DentalChiefComplain'].forEach((v) { + listDentalChiefComplain.add(new ListDentalChiefComplain.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.listDentalChiefComplain != null) { + data['List_DentalChiefComplain'] = + this.listDentalChiefComplain.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ListDentalChiefComplain { + int projectID; + int iD; + String name; + String nameN; + + ListDentalChiefComplain({this.projectID, this.iD, this.name, this.nameN}); + + ListDentalChiefComplain.fromJson(Map json) { + projectID = json['ProjectID']; + iD = json['ID']; + name = json['Name']; + nameN = json['NameN']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['ID'] = this.iD; + data['Name'] = this.name; + data['NameN'] = this.nameN; + return data; + } +} diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart index 756aa8bf..9d3da450 100644 --- a/lib/pages/BookAppointment/DentalComplaints.dart +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -1,5 +1,10 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DentalComplaintCard.dart'; +import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; @@ -14,6 +19,11 @@ class DentalComplaints extends StatefulWidget { } class _DentalComplaintsState extends State { + List complaintsList = []; + AppSharedPreferences sharedPref = AppSharedPreferences(); + bool isDataLoaded = false; + var languageID; + @override void initState() { WidgetsBinding.instance @@ -26,20 +36,43 @@ class _DentalComplaintsState extends State { return AppScaffold( isShowAppBar: true, appBarTitle: "Symptoms", - body: Container(), + body: Container( + margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), + child: ListView.builder( + itemCount: complaintsList.length, + itemBuilder: (BuildContext context, int index) { + return Container( + margin: EdgeInsets.only(bottom: 10.0), + child: DentalComplaintCard( + listDentalChiefComplain: complaintsList[index], + languageID: languageID, + ), + ); + }, + ), + ), ); } + getLanguageID() async { + languageID = await sharedPref.getString(APP_LANGUAGE); + } + getChiefComplaintsList() { + getLanguageID(); ClinicListService service = new ClinicListService(); service .getChiefComplaintsList( widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context) .then((res) { if (res['MessageStatus'] == 1) { -// setState(() { -// res['List_DentalChiefComplain'].forEach((v) {}); -// }); + print(res['List_DentalChiefComplain']); + setState(() { + res['List_DentalChiefComplain'].forEach((v) { + complaintsList.add(new ListDentalChiefComplain.fromJson(v)); + }); + print(complaintsList.length); + }); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index c52002b4..2b5fac17 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -43,7 +43,7 @@ class _SearchResultsState extends State { (index) => AppExpandableNotifier( title: widget .patientDoctorAppointmentListHospital[index].filterName + " - " +widget - .patientDoctorAppointmentListHospital[index].distanceInKMs + " KMs" , + .patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km, bodyWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/pages/BookAppointment/widgets/BranchView.dart b/lib/pages/BookAppointment/widgets/BranchView.dart index 6819c54b..88912a3f 100644 --- a/lib/pages/BookAppointment/widgets/BranchView.dart +++ b/lib/pages/BookAppointment/widgets/BranchView.dart @@ -145,7 +145,7 @@ class _ExpandableListViewState extends State { String getProjectDistance(String distance) { if (distance != "0") - return " - " + distance + " KMs"; + return " - " + distance + " " + TranslationBase.of(context).km; else { return ""; } diff --git a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart new file mode 100644 index 00000000..27f37d0a --- /dev/null +++ b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart @@ -0,0 +1,135 @@ +import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +// ignore: must_be_immutable +class DentalComplaintCard extends StatefulWidget { + final ListDentalChiefComplain listDentalChiefComplain; + var languageID; + + DentalComplaintCard( + {@required this.listDentalChiefComplain, this.languageID}); + + @override + _DentalComplaintCardState createState() => _DentalComplaintCardState(); +} + +class _DentalComplaintCardState extends State { + @override + Widget build(BuildContext context) { + return Container( + child: InkWell( + onTap: () { + getChiefComplaintsList(); + }, + child: Card( + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.85, + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + child: Text(widget.listDentalChiefComplain.name, + style: + TextStyle(fontSize: 16.0, color: Colors.black)), + ), + ], + ), + ), + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Icon(Icons.arrow_forward_ios, + size: 20.0, color: Colors.black54), + ], + ), + ), + ], + ), + ), + ), + ); + } + + getChiefComplaintsList() { + List doctorsList = []; + List _patientDoctorAppointmentListHospital = + List(); + + ClinicListService service = new ClinicListService(); + service + .getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD, + widget.listDentalChiefComplain.projectID, context) + .then((res) { + if (res['MessageStatus'] == 1) { + print(res['List_DentalDoctorChiefComplaintMapping']); + setState(() { + doctorsList.clear(); + res['List_DentalDoctorChiefComplaintMapping'].forEach((v) { + doctorsList.add(new DoctorList.fromJson(v)); + }); + + doctorsList.forEach((element) { + List doctorByHospital = + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[ + _patientDoctorAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + _patientDoctorAppointmentListHospital.add( + PatientDoctorAppointmentList( + filterName: element.projectName, + distanceInKMs: + element.projectDistanceInKiloMeters.toString(), + patientDoctorAppointment: element)); + } + }); + navigateToSearchResults( + context, doctorsList, _patientDoctorAppointmentListHospital); + }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + Future navigateToSearchResults( + context, + List docList, + List + patientDoctorAppointmentListHospital) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => SearchResults( + doctorsList: docList, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))); + } +} diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index cb486762..8cc1e469 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -37,10 +37,10 @@ class ClinicListService extends BaseService { await baseAppClient.post(GET_CLINICS_LIST_URL, 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); } @@ -64,14 +64,15 @@ class ClinicListService extends BaseService { await baseAppClient.post(GET_PROJECTS_LIST, 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); } - Future getChiefComplaintsList(int clinicID, int projectID, BuildContext context, + Future getChiefComplaintsList( + int clinicID, int projectID, BuildContext context, {doctorId}) async { //Utils.showProgressDialog(context); Map request; @@ -82,12 +83,6 @@ class ClinicListService extends BaseService { authUser = data; } - if (await this.sharedPref.getDouble(USER_LAT) != null && - await this.sharedPref.getDouble(USER_LONG) != null) { - lat = await this.sharedPref.getDouble(USER_LAT); - long = await this.sharedPref.getDouble(USER_LONG); - } - var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); request = { @@ -114,11 +109,56 @@ class ClinicListService extends BaseService { await baseAppClient.post(GET_DOCTORS_LIST_URL, 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); } + Future getChiefComplaintDoctorList( + int chiefComplaintID, int projectID, BuildContext context, + {doctorId}) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + if (await this.sharedPref.getDouble(USER_LAT) != null && + await this.sharedPref.getDouble(USER_LONG) != null) { + lat = await this.sharedPref.getDouble(USER_LAT); + long = await this.sharedPref.getDouble(USER_LONG); + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + request = { + "ChiefComplaintID": chiefComplaintID, + "ProjectID": projectID, + "VersionID": 5.6, + "Channel": 3, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": 0, + "SessionID": null, + "isDentalAllowedBackend": true, + "Latitude": lat.toString(), + "Longitude": long.toString(), + "DeviceTypeID": 1 + }; + + dynamic localRes; + + await baseAppClient.post(GET_DENTAL_DOCTORS_LIST_URL, + 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 d9fc04bc..3b3e581d 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -452,6 +452,8 @@ class TranslationBase { localizedValues['textToSpeech'][locale.languageCode]; String get locationDialogMessage => localizedValues['locationDialogMessage'][locale.languageCode]; + String get km => + localizedValues['km'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From ce9903fd13f427671ee29c4916b16c84707bea11 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 3 Sep 2020 12:13:15 +0300 Subject: [PATCH 08/15] nearest appointment flow implemented --- .../components/SearchByClinic.dart | 7 ++-- .../BookAppointment/widgets/DoctorView.dart | 36 ++++++++++++++++++- .../appointment_services/GetDoctorsList.dart | 13 ++++--- lib/widgets/others/bottom_bar.dart | 2 +- 4 files changed, 50 insertions(+), 8 deletions(-) diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 6ff05204..6b3eff38 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -82,7 +82,7 @@ class _SearchByClinicState extends State { onChanged: (newValue) { setState(() { dropdownValue = newValue; - if (!isDentalSelectedAndSupported()) { + if (!isDentalSelectedAndSupported() && !nearestAppo) { projectDropdownValue = ""; getDoctorsList(context); } @@ -194,6 +194,7 @@ class _SearchByClinicState extends State { .getDoctorsList( int.parse(dropdownValue), projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, + nearestAppo, context) .then((res) { if (res['MessageStatus'] == 1) { @@ -248,6 +249,8 @@ class _SearchByClinicState extends State { num: numAll, resultDistance: resultDistance), ), - ); + ).then((value) { + getProjectsList(); + }); } } diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index e8f08af5..67c536c4 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:flutter/material.dart'; import 'package:rating_bar/rating_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; @@ -39,7 +40,7 @@ class DoctorView extends StatelessWidget { fit: BoxFit.fill, height: 60.0, width: 60.0), ), Container( - width: MediaQuery.of(context).size.width * 0.5, + width: MediaQuery.of(context).size.width * 0.55, margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -74,6 +75,16 @@ class DoctorView extends StatelessWidget { color: Colors.grey[600], letterSpacing: 1.0)), ), + this.doctor.nearestFreeSlot != null ? Container( + margin: EdgeInsets.only(top: 3.0, bottom: 3.0), + child: Text( + getDate(this.doctor.nearestFreeSlot), + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.bold, + color: Colors.green[600], + letterSpacing: 1.0)), + ) : Container(), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisSize: MainAxisSize.max, @@ -136,6 +147,29 @@ class DoctorView extends StatelessWidget { }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } + String getDate(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString() + + " " + + dateObj.hour.toString() + + ":" + + getMinute(dateObj); + } + + String getMinute(DateTime dateObj) { + if(dateObj.minute == 0) { + return dateObj.minute.toString() + "0"; + } else { + return dateObj.minute.toString(); + } + } + Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo}) async { Navigator.push( diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 61845095..c992e8e9 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -10,7 +10,6 @@ import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:flutter/cupertino.dart'; class DoctorsListService extends BaseService { @@ -23,7 +22,8 @@ class DoctorsListService extends BaseService { double lat; double long; - Future getDoctorsList(int clinicID, int projectID, BuildContext context, + Future getDoctorsList( + int clinicID, int projectID, bool isNearest, BuildContext context, {doctorId}) async { //Utils.showProgressDialog(context); Map request; @@ -34,7 +34,8 @@ class DoctorsListService extends BaseService { authUser = data; } - if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { + if (await this.sharedPref.getDouble(USER_LAT) != null && + await this.sharedPref.getDouble(USER_LONG) != null) { lat = await this.sharedPref.getDouble(USER_LAT); long = await this.sharedPref.getDouble(USER_LONG); } @@ -62,6 +63,9 @@ class DoctorsListService extends BaseService { "IsGetNearAppointment": false, "Latitude": lat.toString(), "Longitude": long.toString(), + "IsGetNearAppointment": isNearest, + if (isNearest) + "SelectedDate": DateUtil.convertDateToString(DateTime.now()), "License": true }; @@ -88,7 +92,8 @@ class DoctorsListService extends BaseService { authUser = data; } - if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { + if (await this.sharedPref.getDouble(USER_LAT) != null && + await this.sharedPref.getDouble(USER_LONG) != null) { lat = await this.sharedPref.getDouble(USER_LAT); long = await this.sharedPref.getDouble(USER_LONG); } diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 32df2dfc..d0fc01f6 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -312,7 +312,7 @@ class _SearchBot extends State { List doctorsList = []; DoctorsListService service = new DoctorsListService(); service - .getDoctorsList(clinicId, projectId, context, doctorId: doctorName) + .getDoctorsList(clinicId, projectId, false, context, doctorId: doctorName) .then((res) { if (res['MessageStatus'] == 1) { setState(() { From 3e5ef26b29225e83fd4a651c7a72f62bd6bc3695 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 3 Sep 2020 14:03:31 +0300 Subject: [PATCH 09/15] my appointment sorting implemented --- .../AppoimentAllHistoryResultList.dart | 10 + lib/pages/MyAppointments/MyAppointments.dart | 239 ++++++++++++++---- .../widgets/AppointmentCardView.dart | 4 +- 3 files changed, 207 insertions(+), 46 deletions(-) diff --git a/lib/models/Appointments/AppoimentAllHistoryResultList.dart b/lib/models/Appointments/AppoimentAllHistoryResultList.dart index a935542a..9ba1fb8e 100644 --- a/lib/models/Appointments/AppoimentAllHistoryResultList.dart +++ b/lib/models/Appointments/AppoimentAllHistoryResultList.dart @@ -272,3 +272,13 @@ class AppoitmentAllHistoryResultList { return data; } } + +class PatientAppointmentList { + String filterName = ""; + List patientDoctorAppointmentList = List(); + + PatientAppointmentList( + {this.filterName, AppoitmentAllHistoryResultList patientDoctorAppointment}) { + patientDoctorAppointmentList.add(patientDoctorAppointment); + } +} diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 63034373..699990ac 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCar import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; @@ -15,6 +16,13 @@ class MyAppointments extends StatefulWidget { List confirmedAppoList = []; List arrivedAppoList = []; + List _patientBookedAppointmentListHospital = List(); + + List _patientConfirmedAppointmentListHospital = + List(); + + List _patientArrivedAppointmentListHospital = List(); + @override _MyAppointmentsState createState() => _MyAppointmentsState(); } @@ -40,7 +48,6 @@ class _MyAppointmentsState extends State isShowAppBar: true, body: Container( child: Column(children: [ - /// this is will not colored with theme data TabBar( tabs: [ Tab(text: TranslationBase.of(context).booked), @@ -94,7 +101,8 @@ class _MyAppointmentsState extends State } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } bool isConfirmed(AppoitmentAllHistoryResultList appo) { @@ -123,64 +131,176 @@ class _MyAppointmentsState extends State widget.arrivedAppoList.add(v); } }); + + widget.bookedAppoList.forEach((element) { + List doctorByHospital = + widget._patientBookedAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.clinicName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + widget + ._patientBookedAppointmentListHospital[widget + ._patientBookedAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientBookedAppointmentListHospital.add(PatientAppointmentList( + filterName: element.clinicName, patientDoctorAppointment: element)); + } + }); + + widget.confirmedAppoList.forEach((element) { + List doctorByHospital = + widget._patientConfirmedAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.clinicName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + widget + ._patientConfirmedAppointmentListHospital[widget + ._patientConfirmedAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientConfirmedAppointmentListHospital.add( + PatientAppointmentList( + filterName: element.clinicName, + patientDoctorAppointment: element)); + } + }); + + widget.arrivedAppoList.forEach((element) { + List doctorByHospital = + widget._patientArrivedAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.clinicName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + widget + ._patientArrivedAppointmentListHospital[widget + ._patientArrivedAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientArrivedAppointmentListHospital.add( + PatientAppointmentList( + filterName: element.clinicName, + patientDoctorAppointment: element)); + } + }); } openAppointmentsTab() { if (widget.bookedAppoList.length != 0) { - _tabController.animateTo((_tabController.index + 1) % 1); + _tabController.index = 0; } else if (widget.confirmedAppoList.length != 0) { - _tabController.animateTo((_tabController.index + 1) % 2); + _tabController.index = 1; } else if (widget.arrivedAppoList.length != 0) { - _tabController.animateTo((_tabController.index + 1) % 3); + _tabController.index = 2; return; } } Widget getBookedAppointments() { return Container( - child: widget.bookedAppoList.length != 0 - ? new ListView.builder( - itemCount: widget.bookedAppoList.length, - itemBuilder: (context, i) { - return AppointmentCard( - appo: widget.bookedAppoList[i], - onReloadAppointmentHistory: getPatientAppointmentHistory, - ); - }, - ) - : Container( - child: Center( + margin: EdgeInsets.only(top: 10.0), + child: Container( + child: widget.bookedAppoList.length != 0 + ? SingleChildScrollView( + physics: BouncingScrollPhysics(), 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, + ...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, + )), + ), + ], + ), + ), ), - ), + ), ); } Widget getConfirmedAppointments() { return widget.confirmedAppoList.length != 0 ? Container( - child: new ListView.builder( - itemCount: widget.confirmedAppoList.length, - itemBuilder: (context, i) { - return AppointmentCard( - appo: widget.confirmedAppoList[i], - onReloadAppointmentHistory: getPatientAppointmentHistory, - ); - }, + margin: EdgeInsets.only(top: 10.0), + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ...List.generate( + widget._patientConfirmedAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: widget + ._patientConfirmedAppointmentListHospital[index] + .filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: widget + ._patientConfirmedAppointmentListHospital[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), + )), + ) + ], + ), ), ) : Container( @@ -206,16 +326,47 @@ class _MyAppointmentsState extends State Widget getArrivedAppointments() { return widget.arrivedAppoList.length != 0 ? Container( - child: new ListView.builder( - itemCount: widget.arrivedAppoList.length, - itemBuilder: (context, i) { - return AppointmentCard( - appo: widget.arrivedAppoList[i], - onReloadAppointmentHistory: getPatientAppointmentHistory, - ); - }, + margin: EdgeInsets.only(top: 10.0), + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ...List.generate( + widget._patientArrivedAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: widget + ._patientArrivedAppointmentListHospital[index] + .filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: widget + ._patientArrivedAppointmentListHospital[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), + )), + ) + ], + ), ), ) +// Container( +// child: new ListView.builder( +// itemCount: widget.arrivedAppoList.length, +// itemBuilder: (context, i) { +// return AppointmentCard( +// appo: widget.arrivedAppoList[i], +// onReloadAppointmentHistory: getPatientAppointmentHistory, +// ); +// }, +// ), +// ) : Container( child: Center( child: Column( diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index e2f6f706..b64bd232 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -42,7 +42,7 @@ class _ApointmentCardState extends State { fit: BoxFit.fill, height: 60.0, width: 60.0), ), Container( - width: MediaQuery.of(context).size.width * 0.6, + width: MediaQuery.of(context).size.width * 0.57, margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -95,7 +95,7 @@ class _ApointmentCardState extends State { emptyIcon: Icons.star, ), Container( - transform: Matrix4.translationValues(0.0, -40.0, 0.0), + transform: Matrix4.translationValues(15.0, -40.0, 0.0), child: Image.asset( "assets/images/new-design/arrow.png", width: 25.0, From 02ce04a39760e671d2de199862dc6427e8f3f63a Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 3 Sep 2020 16:12:16 +0300 Subject: [PATCH 10/15] medical_profile_page.dart --- lib/config/config.dart | 6 ++--- .../insurance/insurance_approval_screen.dart | 2 +- lib/pages/landing/landing_page.dart | 2 ++ lib/pages/medical/medical_profile_page.dart | 26 +++++++++---------- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 664a405c..956a2315 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -161,11 +161,9 @@ const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; const GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceDetails"; const GET_PAtIENTS_INSURANCE_UPDATED = - "/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; -const GET_PAtIENTS_INSURANCE_APPROVALS = "/Patients.svc/REST/GetApprovalStatus"; -const GET_VACCINES = "/Patients.svc/REST/GetDoneVaccinesByPatientID"; -const GET_VACCINES_EMAIL = "/Notifications.svc/REST/SendVaccinesEmail"; "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; +const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; +const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; diff --git a/lib/pages/insurance/insurance_approval_screen.dart b/lib/pages/insurance/insurance_approval_screen.dart index 9cc40692..038468e0 100644 --- a/lib/pages/insurance/insurance_approval_screen.dart +++ b/lib/pages/insurance/insurance_approval_screen.dart @@ -80,7 +80,7 @@ class _InsuranceApprovalState extends State { children: [ ExpansionTile( title: Container( - height: 120.0, + //height: 120.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 46e5e2fb..8eea389f 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -307,4 +307,6 @@ class _LandingPageState extends State with WidgetsBindingObserver { _changeCurrentTab(2); } } + + } diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index b87652c5..83628076 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -254,11 +254,10 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( - //TODO -// onTap: () { -// Navigator.push( -// context, FadePage(page: DoctorHomePage())); -// }, + onTap: () { + Navigator.push(context, + FadePage(page: InsuranceUpdate())); + }, child: MedicalProfileItem( title: TranslationBase.of(context) .updateInsurance, @@ -271,10 +270,10 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( - onTap: () { - Navigator.push( - context, FadePage(page: InsuranceApproval())); - }, + onTap: () { + Navigator.push(context, + FadePage(page: InsuranceApproval())); + }, child: MedicalProfileItem( title: TranslationBase.of(context) .insuranceApproval, @@ -299,11 +298,10 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( - //TODO -// onTap: () { -// Navigator.push( -// context, FadePage(page: DoctorHomePage())); -// }, + onTap: () { + Navigator.push(context, + FadePage(page: MyVaccines())); + }, child: MedicalProfileItem( title: TranslationBase.of(context) .myVaccines, From fe66ee59937cc3a1bd55f33c14977866e998e5f1 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Sep 2020 09:27:34 +0300 Subject: [PATCH 11/15] fix lab result issues --- android/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- assets/images/report.jpg | Bin 0 -> 37509 bytes lib/config/config.dart | 4 +- lib/config/localized_values.dart | 1 + lib/core/model/labs/lab_result.dart | 88 +++++++ lib/core/service/client/base_app_client.dart | 2 +- lib/core/service/insurance_service.dart | 41 +++- lib/core/service/medical/labs_service.dart | 23 ++ .../medical/reports_monthly_service.dart | 83 +++++++ .../viewModels/insurance_card_View_model.dart | 15 +- .../viewModels/medical/labs_view_model.dart | 23 +- .../medical/reports_monthly_view_model.dart | 84 +++++++ lib/locator.dart | 4 + .../insurance/insurance_update_screen.dart | 130 +++++----- lib/pages/landing/landing_page.dart | 15 +- .../medical/labs/laboratory_result_page.dart | 4 +- lib/pages/medical/medical_profile_page.dart | 2 +- .../medical/reports/monthly_reports.dart | 18 ++ lib/uitl/translations_delegate_base.dart | 1 + .../medical/laboratory_result_widget.dart | 228 +++++++++++++++++- lib/widgets/others/app_scaffold_widget.dart | 2 +- pubspec.yaml | 2 +- 23 files changed, 679 insertions(+), 97 deletions(-) create mode 100644 assets/images/report.jpg create mode 100644 lib/core/model/labs/lab_result.dart create mode 100644 lib/core/service/medical/reports_monthly_service.dart create mode 100644 lib/core/viewModels/medical/reports_monthly_view_model.dart create mode 100644 lib/pages/medical/reports/monthly_reports.dart diff --git a/android/build.gradle b/android/build.gradle index e2e8a05f..8e56476b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' + classpath 'com.android.tools.build:gradle:4.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.2' } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 296b146b..5660070d 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 23 08:50:38 CEST 2017 +#Thu Sep 03 16:26:30 EEST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/assets/images/report.jpg b/assets/images/report.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5846cd538dec27f12011b3de3ecfbdae4d411f29 GIT binary patch literal 37509 zcmdpdWmH^EwrJx{Xj}s{(6}_N!QI^hbT{tq3GVJ5f+e_X2*I_H;GWgVj{Z0%)5 z=jZI?;wkDU0s0fU=wtnlW^NGOpIy8hB|y@DP^B|c*P@ek^{}QB;1cA7@dygh35jq) z1cZe6g*fPVc_0GZJbc`IJe<6IqWnCf{JeC3FQ7+i9&j5`9XW-+(|UZ80R3GkUteD? zUp_8Z4_j`Ch=>R`4=*<_FXv+qPEUUqFDpMz7f*)2FvwYZ!aVHVyzE_F=>EWH1$FiI zk^nt&`Zp1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ese@sg{R;+7I^>{;ZEkdHk|zvd?yX7P)}*Io3+kY25Kc{MwYh(-Iwv=o>-{b>)a}KjqDb02V(swa@TP$-M~TbI%XhdZb9G(Jl;)`Y|oD# zoC`}37A&N3MJ`aT>bulkCfYa0)YV?H_XU#f$ADrhO4wqwgrjG`HnGlm0zsNR;p@+c z!#{B`XqLmj&GN&wNKZ|xBoC^}INC_%>zBf@5(t&?cU7oJMhOqE1Wi#W&DBcRpD5Qb zu}3wOo0arJU>^jZs(twMu`+}$(Nf&6e*pV+`Z=1c6fP~Z`?Bs0i8`nj9&{N=XSwCk z)j8WxY*=GA899bZ9fnKLZHq?|6hRX45t@GQsg*07g42d5-U32Su1k}4InrrxsOuv; z;Jc5g?7=*#dZI{g>507fE&?-^6>{n(MWMV!XW$!7TJ0U07%knc%1+yh;9D`xAdUuavxGv>iq!gsw2n35DcTzx$G&@=-IH_uUsL4QdQWz~n*gd1H6ri6Ys znPA~>!%Mw1&ts_?FkJ35cMPkSkCoN>kb&(VM?oZSxms?W@SY}WLYlkAVsY(wm7pHZD(>${Y)VK z$%|*}B-l!yU&Iz*`sqZ$^t@9)Au>mCBQMrbA}elq^kbm|gh$LY>qnnH%^9m@%(NA7 zwt4+}-w9taxVbJqs0$;TAjMPe(d8}QFo`E5Oh*$ma}sCH_#T3l?$DUUV9s4@t@G~J zHAJ~ueyNl?oxK20CWU1gI|7OaP`0dFrxnT~3?fMpeC%Qg%hJ(RFoo&1$ck#v?-F9` z*R^ZzYnx^dPu2;Bd69MG;REc56JIG-D%>=V=VvxDZxY37&zVFl_)yz4eaDp4t$iI~ zN1hx39aO>I<)YRqn$4fgJt?SY=kdW`yv%Tz>4K$FC^}*rF@O{nxM&jy20wm#KS8(_ z(YCt5A(+XP%d(ReG7!Mh?t-x-(-78!@_%i=exB|k_U_uWwn literal 0 HcmV?d00001 diff --git a/lib/config/config.dart b/lib/config/config.dart index 956a2315..fc636ceb 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -28,8 +28,8 @@ const GET_PRESCRIPTION_REPORT_ENH = ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -const GET_Patient_LAB_SPECIAL_RESULT = - 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const GET_Patient_LAB_RESULT = '/Services/Patients.svc/REST/GetPatientLabResults'; /// const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 903943ef..ddd98917 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -448,4 +448,5 @@ const Map> localizedValues = { "OrderNo": {"en": "Order No", "ar": "رقم الطلب"}, "OrderDetails": {"en": "Order Details", "ar": "تفاصيل الطلب"}, "VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"}, + "MonthlyReports": {"en": "Monthly Reports", "ar": "تقارير شهرية"}, }; diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart new file mode 100644 index 00000000..23b3363d --- /dev/null +++ b/lib/core/model/labs/lab_result.dart @@ -0,0 +1,88 @@ +class LabResult { + String description; + Null femaleInterpretativeData; + int gender; + int lineItemNo; + Null maleInterpretativeData; + String notes; + String packageID; + int patientID; + String projectID; + String referanceRange; + String resultValue; + String sampleCollectedOn; + String sampleReceivedOn; + String setupID; + Null superVerifiedOn; + String testCode; + String uOM; + String verifiedOn; + Null verifiedOnDateTime; + + LabResult( + {this.description, + this.femaleInterpretativeData, + this.gender, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); + + LabResult.fromJson(Map json) { + description = json['Description']; + femaleInterpretativeData = json['FemaleInterpretativeData']; + gender = json['Gender']; + lineItemNo = json['LineItemNo']; + maleInterpretativeData = json['MaleInterpretativeData']; + notes = json['Notes']; + packageID = json['PackageID']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + referanceRange = json['ReferanceRange']; + resultValue = json['ResultValue']; + sampleCollectedOn = json['SampleCollectedOn']; + sampleReceivedOn = json['SampleReceivedOn']; + setupID = json['SetupID']; + superVerifiedOn = json['SuperVerifiedOn']; + testCode = json['TestCode']; + uOM = json['UOM']; + verifiedOn = json['VerifiedOn']; + verifiedOnDateTime = json['VerifiedOnDateTime']; + } + + Map toJson() { + final Map data = new Map(); + data['Description'] = this.description; + data['FemaleInterpretativeData'] = this.femaleInterpretativeData; + data['Gender'] = this.gender; + data['LineItemNo'] = this.lineItemNo; + data['MaleInterpretativeData'] = this.maleInterpretativeData; + data['Notes'] = this.notes; + data['PackageID'] = this.packageID; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ReferanceRange'] = this.referanceRange; + data['ResultValue'] = this.resultValue; + data['SampleCollectedOn'] = this.sampleCollectedOn; + data['SampleReceivedOn'] = this.sampleReceivedOn; + data['SetupID'] = this.setupID; + data['SuperVerifiedOn'] = this.superVerifiedOn; + data['TestCode'] = this.testCode; + data['UOM'] = this.uOM; + data['VerifiedOn'] = this.verifiedOn; + data['VerifiedOnDateTime'] = this.verifiedOnDateTime; + return data; + } +} diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index efb168c8..aa48c49d 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -31,7 +31,7 @@ class BaseAppClient { //Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en'); var user = await sharedPref.getObject(USER_PROFILE); body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID diff --git a/lib/core/service/insurance_service.dart b/lib/core/service/insurance_service.dart index 8850e953..7fee6615 100644 --- a/lib/core/service/insurance_service.dart +++ b/lib/core/service/insurance_service.dart @@ -1,8 +1,13 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart'; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; class InsuranceCardService extends BaseService { List _cardList = List(); @@ -15,6 +20,9 @@ class InsuranceCardService extends BaseService { List get insuranceApproval => _insuranceApproval; + GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse(); + clearInsuranceCard() { _cardList.clear(); } @@ -101,7 +109,7 @@ class InsuranceCardService extends BaseService { Future getInsuranceApproval({int appointmentNo}) async { hasError = false; // _cardList.clear(); - if(appointmentNo != null) { + if (appointmentNo != null) { _insuranceApprovalModel.appointmentNo = appointmentNo; _insuranceApprovalModel.eXuldAPPNO = null; _insuranceApprovalModel.projectID = null; @@ -124,4 +132,35 @@ class InsuranceCardService extends BaseService { super.error = error; }, body: _insuranceApprovalModel.toJson()); } + + Future getFamilyFiles() async { + var myFamily = await sharedPref.getObject(FAMILY_FILE); + if (myFamily != null) { + getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse.fromJson(myFamily); + } else { + getSharedRecordByStatus(); + } + } + + Future getSharedRecordByStatus() async { + try { + dynamic localRes; + var request = GetAllSharedRecordsByStatusReq(); + request.status = 0; + await baseAppClient.post(GET_SHARED_RECORD_BY_STATUS, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request.toJson()); + sharedPref.setObject(FAMILY_FILE, localRes); + getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse.fromJson(localRes); + } catch (error) { + print(error); + throw error; + } + } } diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 98f8110e..c1ad65f3 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_orders.dart'; @@ -28,6 +29,7 @@ class LabsService extends BaseService { RequestPatientLabSpecialResult(); List patientLabSpecialResult = List(); + List labResultList = List(); Future getLaboratoryResult( {String projectID, @@ -52,6 +54,27 @@ class LabsService extends BaseService { }, body: _requestPatientLabSpecialResult.toJson()); } + Future getPatientLabResult({PatientLabOrders patientLabOrder}) async { + hasError = false; + Map body = Map(); + body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['OrderNo'] = patientLabOrder.orderNo; + body['Procedure'] = "U/A"; + body['ProjectID'] = patientLabOrder.projectID; + body['ClinicID'] = patientLabOrder.clinicID; + //TODO Check the res + await baseAppClient.post(GET_Patient_LAB_RESULT, + onSuccess: (dynamic response, int statusCode) { + patientLabSpecialResult.clear(); + response['ListPLR'].forEach((lab) { + labResultList.add(LabResult.fromJson(lab)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); diff --git a/lib/core/service/medical/reports_monthly_service.dart b/lib/core/service/medical/reports_monthly_service.dart new file mode 100644 index 00000000..5e643669 --- /dev/null +++ b/lib/core/service/medical/reports_monthly_service.dart @@ -0,0 +1,83 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; +import 'package:diplomaticquarterapp/core/model/reports/request_reports.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; + +class ReportsMonthlyService extends BaseService { + List reportsList = List(); + List appointHistoryList = List(); + + RequestReports _requestReports = RequestReports( + isReport: true, + encounterType: 1, + requestType: 1, + versionID: 5.5, + channel: 3, + languageID: 2, + iPAdress: "10.20.10.20", + generalid: 'Cs2020@2016\$2958', + patientOutSA: 0, + sessionID: 'KIbLoqkytuKJEWECHQ', + isDentalAllowedBackend: false, + deviceTypeID: 2, + patientID: 1231755, + tokenID: '@dm!n', + patientTypeID: 1, + patientType: 1); + + Future getReports() async { + hasError = false; + await baseAppClient.post(REPORTS, + onSuccess: (dynamic response, int statusCode) { + reportsList.clear(); + response['GetPatientMedicalStatus'].forEach((reports) { + reportsList.add(Reports.fromJson(reports)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestReports.toJson()); + } + + Future getPatentAppointmentHistory() async { + hasError = false; + Map body = new Map(); + body['IsForMedicalReport'] = true; + await baseAppClient.post(GET_PATIENT_AppointmentHistory, + onSuccess: (dynamic response, int statusCode) { + appointHistoryList = []; + response['AppoimentAllHistoryResultList'].forEach((appoint) { + appointHistoryList.add(AppointmentHistory.fromJson(appoint)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future insertRequestForMedicalReport( + AppointmentHistory appointmentHistory) async { + Map body = new Map(); + body['ClinicID'] = appointmentHistory.clinicID; + body['DoctorID'] = appointmentHistory.doctorID; + body['SetupID'] = appointmentHistory.setupID; + body['EncounterNo'] = appointmentHistory.appointmentNo; + body['EncounterType'] = 1;// appointmentHistory.appointmentType; + body['IsActive'] = appointmentHistory.isActiveDoctor; + body['ProjectID'] = appointmentHistory.projectID; + body['Remarks'] = ""; + body['ProcedureId'] = ""; + body['RequestType'] = 1; + body['Source'] = 2; + body['Status'] = 1; + body['CreatedBy'] = 102; + hasError = false; + await baseAppClient.post(INSERT_REQUEST_FOR_MEDICAL_REPORT, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/viewModels/insurance_card_View_model.dart b/lib/core/viewModels/insurance_card_View_model.dart index a6975360..e99a53f6 100644 --- a/lib/core/viewModels/insurance_card_View_model.dart +++ b/lib/core/viewModels/insurance_card_View_model.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dar import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.dart'; import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -20,6 +21,9 @@ class InsuranceViewModel extends BaseViewModel { List get insuranceApproval => _insuranceCardService.insuranceApproval; + GetAllSharedRecordsByStatusResponse get getAllSharedRecordsByStatusResponse => + _insuranceCardService.getAllSharedRecordsByStatusResponse; + Future getInsurance() async { hasError = false; _insuranceCardService.clearInsuranceCard(); @@ -41,7 +45,7 @@ class InsuranceViewModel extends BaseViewModel { error = _insuranceCardService.error; setState(ViewState.ErrorLocal); } else - setState(ViewState.Idle); + getFamilyFiles(); } Future getInsuranceApproval({int appointmentNo}) async { @@ -59,4 +63,13 @@ class InsuranceViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future getFamilyFiles() async { + await _insuranceCardService.getFamilyFiles(); + if (_insuranceCardService.hasError) { + error = _insuranceCardService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } } diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 1efdfb7c..032aeb1e 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -1,6 +1,6 @@ - import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart'; @@ -78,13 +78,32 @@ class LabsViewModel extends BaseViewModel { List get patientLabSpecialResult => _labsService.patientLabSpecialResult; + List get labResultList => _labsService.labResultList; + getLaboratoryResult( {String projectID, int clinicID, String invoiceNo, String orderNo}) async { setState(ViewState.Busy); - await _labsService.getLaboratoryResult(invoiceNo: invoiceNo,orderNo: orderNo,projectID: projectID,clinicID: clinicID); + await _labsService.getLaboratoryResult( + invoiceNo: invoiceNo, + orderNo: orderNo, + projectID: projectID, + clinicID: clinicID); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + getPatientLabResult({PatientLabOrders patientLabOrder}) async { + setState(ViewState.Busy); + await _labsService.getPatientLabResult( + patientLabOrder: patientLabOrder + ); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); diff --git a/lib/core/viewModels/medical/reports_monthly_view_model.dart b/lib/core/viewModels/medical/reports_monthly_view_model.dart new file mode 100644 index 00000000..2e5952ae --- /dev/null +++ b/lib/core/viewModels/medical/reports_monthly_view_model.dart @@ -0,0 +1,84 @@ +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +import '../../../core/enum/reportfilter_type.dart'; +import '../../../core/enum/viewstate.dart'; +import '../../../core/model/reports/Reports.dart'; +import '../../../core/service/medical/reports_service.dart'; +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class ReportsMonthlyViewModel extends BaseViewModel { + ReportFilterType filterType = ReportFilterType.Requested; + + ReportsService _reportsService = locator(); + + List reportsOrderRequestList = List(); + List reportsOrderReadyList = List(); + List reportsOrderCompletedList = List(); + List reportsOrderCanceledList = List(); + + List get appointHistoryList => + _reportsService.appointHistoryList; + + getReports() async { + setState(ViewState.Busy); + reportsOrderRequestList.clear(); + reportsOrderReadyList.clear(); + reportsOrderCompletedList.clear(); + reportsOrderCanceledList.clear(); + await _reportsService.getReports(); + if (_reportsService.hasError) { + error = _reportsService.error; + setState(ViewState.Error); + } else { + _filterList(); + setState(ViewState.Idle); + } + } + + getPatentAppointmentHistory() async { + setState(ViewState.Busy); + await _reportsService.getPatentAppointmentHistory(); + if (_reportsService.hasError) { + error = _reportsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + void _filterList() { + _reportsService.reportsList.forEach((report) { + switch (report.status) { + case 1: + reportsOrderRequestList.add(report); + break; + case 2: + reportsOrderReadyList.add(report); + break; + case 3: + reportsOrderCompletedList.add(report); + break; + case 4: + reportsOrderCanceledList.add(report); + break; + default: + } + }); + } + + + insertRequestForMedicalReport(AppointmentHistory appointmentHistory)async{ + setState(ViewState.Busy); + await _reportsService.insertRequestForMedicalReport(appointmentHistory); + if (_reportsService.hasError) { + error = _reportsService.error; + AppToast.showErrorToast(message: error); + setState(ViewState.ErrorLocal); + } else { + AppToast.showSuccessToast(message: 'The order was send '); + setState(ViewState.Idle); + } + } +} diff --git a/lib/locator.dart b/lib/locator.dart index b2e974a8..6839fbc2 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -12,6 +12,7 @@ import 'core/service/medical/medical_service.dart'; import 'core/service/medical/my_doctor_service.dart'; import 'core/service/medical/prescriptions_service.dart'; import 'core/service/medical/radiology_service.dart'; +import 'core/service/medical/reports_monthly_service.dart'; import 'core/service/medical/vital_sign_service.dart'; import 'core/viewModels/appointment_rate_view_model.dart'; import 'core/viewModels/feedback/feedback_view_model.dart'; @@ -22,6 +23,7 @@ import 'core/viewModels/medical/medical_view_model.dart'; import 'core/viewModels/medical/my_doctor_view_model.dart'; import 'core/viewModels/medical/prescriptions_view_model.dart'; import 'core/viewModels/medical/radiology_view_model.dart'; +import 'core/viewModels/medical/reports_monthly_view_model.dart'; import 'core/viewModels/medical/vital_sign_view_model.dart'; import 'core/viewModels/medical/reports_view_model.dart'; import 'core/viewModels/pharmacies_view_model.dart'; @@ -53,6 +55,7 @@ void setupLocator() { locator.registerLazySingleton(() => AppointmentRateService()); locator.registerLazySingleton(() => QrService()); locator.registerFactory(() => VaccineService()); + locator.registerLazySingleton(() => ReportsMonthlyService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -70,5 +73,6 @@ void setupLocator() { locator.registerFactory(() => DashboardViewModel()); locator.registerFactory(() => AppointmentRateViewModel()); locator.registerFactory(() => QrViewModel()); + locator.registerFactory(() => ReportsMonthlyViewModel()); } diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 9cfa41a9..2fa291df 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; @@ -97,9 +98,12 @@ class _InsuranceUpdateState extends State children: [ Container( child: ListView.builder( - itemCount: model.insuranceUpdate == null + itemCount: model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList == + null ? 0 - : model.insuranceUpdate.length, + : model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList.length, itemBuilder: (BuildContext context, int index) { return Container( margin: EdgeInsets.all(10.0), @@ -112,81 +116,63 @@ class _InsuranceUpdateState extends State child: Container( width: MediaQuery.of(context).size.width, padding: EdgeInsets.all(10.0), - child: Column( + child: Row( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ - Flex( - direction: Axis.horizontal, - children: [ - Expanded( - flex: 3, - child: Container( - margin: EdgeInsets.only( - top: 2.0, - left: 10.0, - right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text("TAMER FANASHEH ", - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - Text( - 'File No.' + - model - .insuranceUpdate[ - index] - .patientID - .toString(), - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - Text( - model.insuranceUpdate[index] - .createdOn, - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - ], - ), - ), + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, left: 10.0, right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index].patientName, + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.w500, + letterSpacing: 1.0)), + Text( + 'File No.' + + model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index].patientID.toString(), + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.w500, + letterSpacing: 1.0)), + ], ), - Expanded( - flex: 1, - child: Container( -// height: MediaQuery.of(context).size.height * 0.12, - margin: EdgeInsets.only(top: 20.0), - child: Column( - children: [ - Container( - child: Button( - label: 'Fetch', - ), - height: SizeConfig - .heightMultiplier * - 3.8, - width: - SizeConfig.screenWidth * - 4.2, - ), - ], - ), - ), - ) - ], + ), ), + Expanded( + flex: 2, + child: Container( + // height: MediaQuery.of(context).size.height * 0.12, + margin: EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: 'Update', + small: true, + textColor: Colors.white, + // color: Colors.grey, + ), + //height: 45, + // width:90 + ), + ], + ), + ), + ) ], ), ), diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 8eea389f..073a1d52 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -235,16 +235,21 @@ class _LandingPageState extends State with WidgetsBindingObserver { physics: NeverScrollableScrollPhysics(), controller: pageController, children: [ - HomePage(goToMyProfile: (){ - _changeCurrentTab(1); - },), + HomePage( + goToMyProfile: () { + _changeCurrentTab(1); + }, + ), MedicalProfilePage(), MyAdmissionsPage(), ToDo(), BookingOptions() ], // Please do not remove the BookingOptions from this array ), - bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab,index: currentTab,), + bottomNavigationBar: BottomNavBar( + changeIndex: _changeCurrentTab, + index: currentTab, + ), ); } @@ -307,6 +312,4 @@ class _LandingPageState extends State with WidgetsBindingObserver { _changeCurrentTab(2); } } - - } diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 216b8adb..01cb6725 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -27,8 +27,10 @@ class LaboratoryResultPage extends StatelessWidget { body: ListView.builder( itemBuilder: (context, index) => LaboratoryResultWidget( onTap: () => model.sendLabReportEmail(patientLabOrder: patientLabOrders), - billNo: model.patientLabSpecialResult[index].invoiceNo, + billNo: patientLabOrders.invoiceNo, details: model.patientLabSpecialResult[index].resultDataHTML, + orderNo: patientLabOrders.orderNo, + patientLabOrder: patientLabOrders, ), itemCount: model.patientLabSpecialResult.length, ), diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 83628076..5dccb514 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -73,7 +73,7 @@ class _MedicalProfilePageState extends State { itemCount: model.appoitmentAllHistoryResultList.length, scrollDirection: Axis.horizontal, - reverse: true, + reverse: !projectViewModel.isArabic, ), ], ), diff --git a/lib/pages/medical/reports/monthly_reports.dart b/lib/pages/medical/reports/monthly_reports.dart new file mode 100644 index 00000000..9c913705 --- /dev/null +++ b/lib/pages/medical/reports/monthly_reports.dart @@ -0,0 +1,18 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; + +class MonthlyReportsPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).monthlyReports, + body: Container(), + ), + ); + } +} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 114f3a1b..22e39c39 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -508,6 +508,7 @@ class TranslationBase { String get orderNo => localizedValues['OrderNo'][locale.languageCode]; String get orderDetails => localizedValues['OrderDetails'][locale.languageCode]; String get vitalSign => localizedValues['VitalSign'][locale.languageCode]; + String get monthlyReports => localizedValues['MonthlyReports'][locale.languageCode]; } diff --git a/lib/widgets/data_display/medical/laboratory_result_widget.dart b/lib/widgets/data_display/medical/laboratory_result_widget.dart index b84b1076..53356095 100644 --- a/lib/widgets/data_display/medical/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/laboratory_result_widget.dart @@ -1,5 +1,13 @@ +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; import '../text.dart'; @@ -7,8 +15,16 @@ class LaboratoryResultWidget extends StatefulWidget { final GestureTapCallback onTap; final String billNo; final String details; + final String orderNo; + final PatientLabOrders patientLabOrder; - const LaboratoryResultWidget({Key key, this.onTap, this.billNo, this.details}) + const LaboratoryResultWidget( + {Key key, + this.onTap, + this.billNo, + this.details, + this.orderNo, + this.patientLabOrder}) : super(key: key); @override @@ -17,9 +33,12 @@ class LaboratoryResultWidget extends StatefulWidget { class _LaboratoryResultWidgetState extends State { bool _isShowMore = false; + bool _isShowMoreGeneral = false; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return Container( margin: EdgeInsets.all(15), child: Column( @@ -45,7 +64,7 @@ class _LaboratoryResultWidgetState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Bill No'), + Texts('Invoice No'), Texts(widget.billNo), ], ), @@ -102,7 +121,7 @@ class _LaboratoryResultWidgetState extends State { )), child: Row( children: [ - Expanded(child: Texts('Result')), + Expanded(child: Texts('Special Result')), Container( width: 25, height: 25, @@ -132,12 +151,211 @@ class _LaboratoryResultWidgetState extends State { bottomRight: Radius.circular(5.0), )), duration: Duration(milliseconds: 7000), - child: Text(widget.details?? 'No Data'), - ) + child: Container( + width: double.infinity, + child: Text(widget.details ?? 'No Data')), + ), + SizedBox(height: 12,), + BaseView( + onModelReady: (model) => model.getPatientLabResult( + patientLabOrder: widget.patientLabOrder), + builder: (_, model, w) => NetworkBaseView( + baseViewModel: model, + child: Container( + child: Column( + children: [ + InkWell( + onTap: () { + setState(() { + _isShowMoreGeneral = !_isShowMoreGeneral; + }, + ); + }, + child: Container( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(5.0), + )), + child: Row( + children: [ + Expanded(child: Texts('General Result')), + Container( + width: 25, + height: 25, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.red[900]), + child: Icon( + _isShowMoreGeneral + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.white, + size: 22, + ), + ) + ], + ), + ), + ), + if (_isShowMoreGeneral) + AnimatedContainer( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(5.0), + bottomRight: Radius.circular(5.0), + ), + ), + duration: Duration(milliseconds: 7000), + child: Container( + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts('U/A'), + InkWell( + onTap: () { + model.getPatientLabResult( + patientLabOrder: + widget.patientLabOrder); + }, + child: Texts( + 'Flow Chart', + decoration: TextDecoration.underline, + color: Colors.blue, + ), + ), + ], + ), + Table( + border: TableBorder.symmetric( + inside: BorderSide( + width: 2.0, color: Colors.grey[300]), + ), + children: fullData(model.labResultList), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ) ], ), ], ), ); } + + List fullData(List labResultList) { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic ? Radius.circular(0.0): Radius.circular(10.0), + topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), + ), + ), + child: Center( + child: Texts( + 'Description', + color: Colors.white, + ), + ), + height: 60, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + + ), + child: Center( + child: Texts('Value', color: Colors.white), + ), + height: 60), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic ? Radius.circular(10.0):Radius.circular(0.0), + topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), + ), + ), + child: Center( + child: Texts('Range', color: Colors.white), + ), + height: 60), + ), + ], + ), + ); + labResultList.forEach((lab) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + lab.description, + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + lab.resultValue, + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + lab.referanceRange, + textAlign: TextAlign.center, + ), + ), + ), + ), + ], + ), + ); + }); + return tableRow; + } } diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index b18a5fd9..56e06939 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -74,7 +74,7 @@ class AppScaffold extends StatelessWidget { ) : buildBodyWidget(), bottomSheet: bottomSheet, - bottomNavigationBar: BottomBarSearch() + // bottomNavigationBar: BottomBarSearch() //floatingActionButton: FloatingSearchButton(), ); } diff --git a/pubspec.yaml b/pubspec.yaml index b5b359a9..4a87b43a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,7 +38,7 @@ dependencies: url_launcher: ^5.5.0 shared_preferences: ^0.5.8 flutter_flexible_toast: ^0.1.4 - firebase_messaging: 6.0.12 + firebase_messaging: ^7.0.0 # Progress bar progress_hud_v2: ^2.0.0 From c5794e5c709944692a1a2c889d377b66ec157f3f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 7 Sep 2020 10:26:05 +0300 Subject: [PATCH 12/15] Dental flow in my appointments --- lib/core/service/client/base_app_client.dart | 29 +++++++------- lib/pages/MyAppointments/MyAppointments.dart | 21 +++------- .../MyAppointments/models/ArrivedButtons.dart | 2 +- .../widgets/AppointmentActions.dart | 39 ++++++++++++++----- 4 files changed, 50 insertions(+), 41 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index bc5c8a3f..70883ccc 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -47,26 +47,25 @@ class BaseAppClient { : PATIENT_OUT_SA; if (body.containsKey('isDentalAllowedBackend')) { - body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') - ? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend'] : IS_DENTAL_ALLOWED_BACKEND - : IS_DENTAL_ALLOWED_BACKEND; + 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')) { - body['PatientType'] = body.containsKey('PatientType') - ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE - : PATIENT_TYPE; - } + body['PatientType'] = body.containsKey('PatientType') + ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE + : PATIENT_TYPE; - if (body.containsKey('PatientTypeID')) { - body['PatientTypeID'] = body.containsKey('PatientTypeID') - ? body['PatientTypeID'] != null - ? body['PatientTypeID'] - : PATIENT_TYPE_ID - : PATIENT_TYPE_ID; - } + 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/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 699990ac..26bdd21c 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -17,10 +17,8 @@ class MyAppointments extends StatefulWidget { List arrivedAppoList = []; List _patientBookedAppointmentListHospital = List(); - List _patientConfirmedAppointmentListHospital = List(); - List _patientArrivedAppointmentListHospital = List(); @override @@ -101,6 +99,8 @@ class _MyAppointmentsState extends State } }).catchError((err) { print(err); + AppToast.showErrorToast(message: err); + Navigator.of(context).pop(); }).showProgressBar( text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } @@ -204,11 +204,11 @@ class _MyAppointmentsState extends State } openAppointmentsTab() { - if (widget.bookedAppoList.length != 0) { + if (widget._patientBookedAppointmentListHospital.length != 0) { _tabController.index = 0; - } else if (widget.confirmedAppoList.length != 0) { + } else if (widget._patientConfirmedAppointmentListHospital.length != 0) { _tabController.index = 1; - } else if (widget.arrivedAppoList.length != 0) { + } else if (widget._patientArrivedAppointmentListHospital.length != 0) { _tabController.index = 2; return; } @@ -356,17 +356,6 @@ class _MyAppointmentsState extends State ), ), ) -// Container( -// child: new ListView.builder( -// itemCount: widget.arrivedAppoList.length, -// itemBuilder: (context, i) { -// return AppointmentCard( -// appo: widget.arrivedAppoList[i], -// onReloadAppointmentHistory: getPatientAppointmentHistory, -// ); -// }, -// ), -// ) : Container( child: Center( child: Column( diff --git a/lib/pages/MyAppointments/models/ArrivedButtons.dart b/lib/pages/MyAppointments/models/ArrivedButtons.dart index 4a288730..a89253c6 100644 --- a/lib/pages/MyAppointments/models/ArrivedButtons.dart +++ b/lib/pages/MyAppointments/models/ArrivedButtons.dart @@ -25,7 +25,7 @@ class ArrivedButtons { "title": "Lab", "subtitle": "Result", "icon": "assets/images/new-design/lab_result_icon.png", - "caller": "addReminder" + "caller": "labResult" }, { "title": "Vital Signs", diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index a876160f..19e82086 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -12,17 +12,18 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButton import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/PrescriptionReport.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart'; +import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:url_launcher/url_launcher.dart'; class AppointmentActions extends StatefulWidget { @@ -189,6 +190,10 @@ class _AppointmentActionsState extends State { case "VitalSigns": navigateToVitalSigns(widget.appo.appointmentNo, widget.appo.projectID); break; + + case "insertComplaint": + navigateToInsertComplaint(); + break; } } @@ -357,7 +362,8 @@ class _AppointmentActionsState extends State { } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } openAppointmentRadiology() { @@ -374,7 +380,8 @@ class _AppointmentActionsState extends State { }).catchError((err) { print(err); AppToast.showErrorToast(message: err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } openPrescriptionReport() { @@ -394,7 +401,8 @@ class _AppointmentActionsState extends State { }).catchError((err) { print(err); AppToast.showErrorToast(message: err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } Future navigateToMedicinePrescriptionReport( @@ -460,7 +468,10 @@ class _AppointmentActionsState extends State { } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + AppToast.showErrorToast( + message: err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } getCallRequestType() { @@ -475,7 +486,8 @@ class _AppointmentActionsState extends State { }); }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } showAskDocRequestDialog(List requestData) { @@ -520,7 +532,8 @@ class _AppointmentActionsState extends State { }).catchError((err) { print(err); AppToast.showErrorToast(message: err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } confirmAppointment() { @@ -537,7 +550,8 @@ class _AppointmentActionsState extends State { } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } navigateToInsuranceApprovals(int appoNo) { @@ -547,7 +561,14 @@ class _AppointmentActionsState extends State { navigateToVitalSigns(int appoNo, int projectID) { Navigator.push( - context, FadePage(page: VitalSignDetailsScreen(appointmentNo: appoNo, projectID: projectID))); + context, + FadePage( + page: VitalSignDetailsScreen( + appointmentNo: appoNo, projectID: projectID))); + } + + navigateToInsertComplaint() { + Navigator.push(context, FadePage(page: FeedbackHomePage())); } rateAppointment() { From b0f0b8734515fe7dfa53467bae344e4b25a626d6 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Sep 2020 11:43:13 +0300 Subject: [PATCH 13/15] 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( From 153335538a3a8d52153e08efbafa76004c45a393 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Sep 2020 17:59:58 +0300 Subject: [PATCH 14/15] done monthly reports --- lib/config/config.dart | 4 + lib/config/localized_values.dart | 8 + lib/core/service/medical/reports_service.dart | 35 +++- .../medical/reports_monthly_view_model.dart | 58 ++----- lib/main.dart | 2 +- lib/pages/medical/medical_profile_page.dart | 17 +- .../medical/reports/monthly_reports.dart | 153 +++++++++++++++++- .../medical/reports/user_agreement_page.dart | 25 +++ lib/uitl/translations_delegate_base.dart | 11 +- lib/widgets/buttons/secondary_button.dart | 2 +- lib/widgets/input/custom_switch.dart | 2 +- pubspec.yaml | 5 +- 12 files changed, 257 insertions(+), 65 deletions(-) create mode 100644 lib/pages/medical/reports/user_agreement_page.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 0165cb1b..a0bf52be 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -148,6 +148,10 @@ const CANCEL_LIVECARE_REQUEST = const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; + +const GET_USER_TERMS ='/Services/Patients.svc/REST/GetUserTermsAndConditions'; +const UPDATE_HEALTH_TERMS ='/services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; + //URL to get medicine and pharmacies list const CHANNEL = 3; const GENERAL_ID = 'Cs2020@2016\$2958'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 696e2665..f50ea02c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -451,4 +451,12 @@ const Map> localizedValues = { "MonthlyReports": {"en": "Monthly Reports", "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": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."}, "km":{"en":"KMs:","ar":"كم"}, + "PatientHealthSummaryReport":{"en":"Patient Health Summary Report","ar":" ملخص التقارير الشهرية"}, + "ToViewTheTermsAndConditions":{"en":"To View The Terms And Conditions Report","ar":" عرض الشروط والأحكام "}, + "ClickHere":{"en":"Click here","ar":"أنقر هنا"}, + "IAgreeToTheTermsAndConditions":{"en":"I agree to the terms and conditions ","ar":"أوافق على الشروط والاحكام "}, + "IAgreeToTheTermsAndConditionsSubtitle":{"en":"I agree to the terms and conditions ","ar":"هذا ملخص التقرير الصحي الشهري و الذي يسرد المؤشرات الصحية و نتائج التحاليل لأخر الزيارات. يرجى ملاحظة أن هذا التقرير هو تقرير يتم ارساله بشكل آلي من النظام و لا يعتبر رسمي و لا تؤخذ عليه أي قرارات طبية"}, + "Save":{"en":"Save","ar":"حفظ "}, + "UserAgreement":{"en":"User Agreement","ar":"اتفاقية الخصوصية "}, + "UpdateSuccessfully":{"en":"Update Successfully","ar":"تم التحديث بنجاح"}, }; diff --git a/lib/core/service/medical/reports_service.dart b/lib/core/service/medical/reports_service.dart index b8e5f426..316872ed 100644 --- a/lib/core/service/medical/reports_service.dart +++ b/lib/core/service/medical/reports_service.dart @@ -7,7 +7,7 @@ import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; class ReportsService extends BaseService { List reportsList = List(); List appointHistoryList = List(); - + String userAgreementContent = ""; RequestReports _requestReports = RequestReports( isReport: true, encounterType: 1, @@ -44,7 +44,7 @@ class ReportsService extends BaseService { hasError = false; Map body = new Map(); body['IsForMedicalReport'] = true; - await baseAppClient.post(GET_PATIENT_AppointmentHistory, + await baseAppClient.post(GET_PATIENT_AppointmentHistory, onSuccess: (dynamic response, int statusCode) { appointHistoryList = []; response['AppoimentAllHistoryResultList'].forEach((appoint) { @@ -56,6 +56,33 @@ class ReportsService extends BaseService { }, body: body); } + Future getUserTermsAndConditions() async { + hasError = false; + await baseAppClient.post(GET_USER_TERMS, + onSuccess: (dynamic response, int statusCode) { + userAgreementContent = response['UserAgreementContent']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + + Future updatePatientHealthSummaryReport({bool isSummary}) async { + Map body = Map(); + body['RSummaryReport'] = isSummary; + hasError = false; + await baseAppClient.post(UPDATE_HEALTH_TERMS, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + + Future insertRequestForMedicalReport( AppointmentHistory appointmentHistory) async { Map body = new Map(); @@ -63,7 +90,7 @@ class ReportsService extends BaseService { body['DoctorID'] = appointmentHistory.doctorID; body['SetupID'] = appointmentHistory.setupID; body['EncounterNo'] = appointmentHistory.appointmentNo; - body['EncounterType'] = 1;// appointmentHistory.appointmentType; + body['EncounterType'] = 1; // appointmentHistory.appointmentType; body['IsActive'] = appointmentHistory.isActiveDoctor; body['ProjectID'] = appointmentHistory.projectID; body['Remarks'] = ""; @@ -73,7 +100,7 @@ class ReportsService extends BaseService { body['Status'] = 1; body['CreatedBy'] = 102; hasError = false; - await baseAppClient.post(INSERT_REQUEST_FOR_MEDICAL_REPORT, + await baseAppClient.post(INSERT_REQUEST_FOR_MEDICAL_REPORT, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModels/medical/reports_monthly_view_model.dart b/lib/core/viewModels/medical/reports_monthly_view_model.dart index 2e5952ae..3ae196f5 100644 --- a/lib/core/viewModels/medical/reports_monthly_view_model.dart +++ b/lib/core/viewModels/medical/reports_monthly_view_model.dart @@ -13,72 +13,34 @@ class ReportsMonthlyViewModel extends BaseViewModel { ReportsService _reportsService = locator(); - List reportsOrderRequestList = List(); - List reportsOrderReadyList = List(); - List reportsOrderCompletedList = List(); - List reportsOrderCanceledList = List(); - List get appointHistoryList => - _reportsService.appointHistoryList; - getReports() async { + String get userAgreementContent => _reportsService.userAgreementContent; + + getUserTermsAndConditions() async{ setState(ViewState.Busy); - reportsOrderRequestList.clear(); - reportsOrderReadyList.clear(); - reportsOrderCompletedList.clear(); - reportsOrderCanceledList.clear(); - await _reportsService.getReports(); + await _reportsService.getUserTermsAndConditions(); if (_reportsService.hasError) { error = _reportsService.error; setState(ViewState.Error); } else { - _filterList(); setState(ViewState.Idle); } } - getPatentAppointmentHistory() async { - setState(ViewState.Busy); - await _reportsService.getPatentAppointmentHistory(); + updatePatientHealthSummaryReport({String message, bool isSummary})async{ + setState(ViewState.BusyLocal); + await _reportsService.updatePatientHealthSummaryReport(isSummary: isSummary); if (_reportsService.hasError) { error = _reportsService.error; - setState(ViewState.Error); + AppToast.showErrorToast(message: error); + setState(ViewState.ErrorLocal); } else { + AppToast.showSuccessToast(message: message); setState(ViewState.Idle); } } - void _filterList() { - _reportsService.reportsList.forEach((report) { - switch (report.status) { - case 1: - reportsOrderRequestList.add(report); - break; - case 2: - reportsOrderReadyList.add(report); - break; - case 3: - reportsOrderCompletedList.add(report); - break; - case 4: - reportsOrderCanceledList.add(report); - break; - default: - } - }); - } - insertRequestForMedicalReport(AppointmentHistory appointmentHistory)async{ - setState(ViewState.Busy); - await _reportsService.insertRequestForMedicalReport(appointmentHistory); - if (_reportsService.hasError) { - error = _reportsService.error; - AppToast.showErrorToast(message: error); - setState(ViewState.ErrorLocal); - } else { - AppToast.showSuccessToast(message: 'The order was send '); - setState(ViewState.Idle); - } - } } diff --git a/lib/main.dart b/lib/main.dart index f641f22e..0c6b2760 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -66,7 +66,7 @@ class MyApp extends StatelessWidget { hintColor: Colors.grey[400], disabledColor: Colors.grey[300], errorColor: Color.fromRGBO(235, 80, 60, 1.0), - scaffoldBackgroundColor:Hexcolor('#E0E0E0'),// Colors.grey[100], + scaffoldBackgroundColor:Hexcolor('#E9E9E9'),// Colors.grey[100], textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), textSelectionHandleColor: Color.fromRGBO(80, 100, 253, 1.0), canvasColor: Colors.white, diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 5dccb514..e78e18a9 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model. import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/reports/monthly_reports.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'; @@ -329,11 +330,17 @@ class _MedicalProfilePageState extends State { ), Expanded( flex: 1, - child: MedicalProfileItem( - title: TranslationBase.of(context).monthly, - imagePath: 'medical_history_icon.png', - subTitle: TranslationBase.of(context) - .monthlySubtitle, + child: InkWell( + onTap: (){ + Navigator.push(context, + FadePage(page: MonthlyReportsPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).monthly, + imagePath: 'medical_history_icon.png', + subTitle: TranslationBase.of(context) + .monthlySubtitle, + ), ), ), ]), diff --git a/lib/pages/medical/reports/monthly_reports.dart b/lib/pages/medical/reports/monthly_reports.dart index 9c913705..ae9cc295 100644 --- a/lib/pages/medical/reports/monthly_reports.dart +++ b/lib/pages/medical/reports/monthly_reports.dart @@ -1,17 +1,166 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/reports/user_agreement_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/input/custom_switch.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'; + +class MonthlyReportsPage extends StatefulWidget { + @override + _MonthlyReportsPageState createState() => _MonthlyReportsPageState(); +} + +class _MonthlyReportsPageState extends State { + bool isAgree = false; + bool isSummary = false; -class MonthlyReportsPage extends StatelessWidget { @override Widget build(BuildContext context) { return BaseView( builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).monthlyReports, - body: Container(), + body: SingleChildScrollView( + child: Container( + padding: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(9), + height: 55, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(8)), + shape: BoxShape.rectangle, + border: Border.all(color: Colors.grey)), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + TranslationBase.of(context).patientHealthSummaryReport, + bold: true, + ), + CustomSwitch( + value: isSummary, + activeColor: Colors.red, + inactiveColor: Colors.grey, + onChanged: () async { + setState(() { + isSummary = !isSummary; + }); + }, + ) + ], + ), + ), + SizedBox( + height: 15, + ), + Container( + margin: EdgeInsets.all(8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + model.user.emailAddress, + bold: true, + ), + ], + ), + ), + Divider( + height: 10.4, + thickness: 1.0, + ), + SizedBox( + height: 15, + ), + Container( + margin: EdgeInsets.all(8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Texts(TranslationBase.of(context) + .toViewTheTermsAndConditions), + ), + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: UserAgreementContent(), + ), + ); + }, + child: Texts( + TranslationBase.of(context).clickHere, + color: Colors.blue, + ), + ) + ], + ), + ), + SizedBox( + height: 5, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Checkbox( + value: isAgree, + onChanged: (value) { + setState(() { + isAgree = !isAgree; + }); + }, + activeColor: Colors.red, + ), + Texts(TranslationBase.of(context) + .iAgreeToTheTermsAndConditions), + ], + ), + Container( + margin: EdgeInsets.all(8), + width: double.infinity, + child: SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).save, + disabled: !isAgree, + loading: model.state == ViewState.BusyLocal, + onTap: () { + model.updatePatientHealthSummaryReport( + message: TranslationBase.of(context) + .updateSuccessfully, + isSummary: isSummary); + }, + ), + ), + Padding( + padding: const EdgeInsets.all(5.0), + child: Texts( + TranslationBase.of(context) + .iAgreeToTheTermsAndConditionsSubtitle, + fontWeight: FontWeight.normal, + ), + ), + SizedBox( + height: 12, + ), + Center(child: Image.asset('assets/images/report.jpg')) + ], + ), + ), + ), ), ); } diff --git a/lib/pages/medical/reports/user_agreement_page.dart b/lib/pages/medical/reports/user_agreement_page.dart new file mode 100644 index 00000000..9bb886e3 --- /dev/null +++ b/lib/pages/medical/reports/user_agreement_page.dart @@ -0,0 +1,25 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter_html/flutter_html.dart'; + +class UserAgreementContent extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getUserTermsAndConditions(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).userAgreement, + body: SingleChildScrollView( + child: Html( + data: model.userAgreementContent, + ), + ), + ), + ); + } +} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 6f069e9c..41a5a537 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -512,8 +512,15 @@ class TranslationBase { String get locationDialogMessage => localizedValues['locationDialogMessage'][locale.languageCode]; - String get km => - localizedValues['km'][locale.languageCode]; + String get km => localizedValues['km'][locale.languageCode]; + String get patientHealthSummaryReport => localizedValues['PatientHealthSummaryReport'][locale.languageCode]; + String get toViewTheTermsAndConditions => localizedValues['ToViewTheTermsAndConditions'][locale.languageCode]; + String get clickHere => localizedValues['ClickHere'][locale.languageCode]; + String get iAgreeToTheTermsAndConditions => localizedValues['IAgreeToTheTermsAndConditions'][locale.languageCode]; + String get iAgreeToTheTermsAndConditionsSubtitle => localizedValues['IAgreeToTheTermsAndConditionsSubtitle'][locale.languageCode]; + String get save => localizedValues['Save'][locale.languageCode]; + String get userAgreement => localizedValues['UserAgreement'][locale.languageCode]; + String get updateSuccessfully => localizedValues['UpdateSuccessfully'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index d805fc94..65bb8d36 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -171,7 +171,7 @@ class _SecondaryButtonState extends State width: MediaQuery.of(context).size.width, height: 100, decoration: BoxDecoration( - color: Theme.of(context).disabledColor, + color: Theme.of(context).primaryColor, ), ), ), diff --git a/lib/widgets/input/custom_switch.dart b/lib/widgets/input/custom_switch.dart index 338bdcf2..ddd1d77b 100644 --- a/lib/widgets/input/custom_switch.dart +++ b/lib/widgets/input/custom_switch.dart @@ -34,7 +34,7 @@ class _CustomSwitchState extends State void initState() { super.initState(); _animationController = - AnimationController(vsync: this, duration: Duration(milliseconds: 800)); + AnimationController(vsync: this, duration: Duration(milliseconds: 500)); _circleAnimation = Tween(begin: 0.0, end: 30.0).animate(CurvedAnimation( parent: _animationController, curve: Curves.easeOutQuint, diff --git a/pubspec.yaml b/pubspec.yaml index 918bca3a..ea73a56b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,6 +32,9 @@ dependencies: permission_handler: ^5.0.0+hotfix.3 device_info: ^0.4.2+4 + # Flutter Html View + flutter_html: ^1.0.2 + # Native flutter_device_type: ^0.2.0 local_auth: ^0.6.2+3 @@ -77,7 +80,7 @@ dependencies: table_calendar: ^2.2.3 # SVG Images - flutter_svg: ^0.17.4 + flutter_svg: ^0.18.0 # Location Helper map_launcher: ^0.8.1 From 9159928e27480404d6e91a7c83667da71f8dcebd Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 8 Sep 2020 15:08:13 +0300 Subject: [PATCH 15/15] edit on vaccine service --- lib/config/localized_values.dart | 2 +- lib/core/model/vaccine/my_vaccine.dart | 203 +++++--- lib/core/service/vaccine_service.dart | 45 +- lib/core/viewModels/vaccine_view_model.dart | 16 + .../insurance/insurance_card_screen.dart | 191 ++++---- lib/pages/landing/home_page.dart | 5 + lib/pages/vaccine/my_vaccines_screen.dart | 459 +++++++----------- 7 files changed, 456 insertions(+), 465 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f50ea02c..c0693161 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -421,7 +421,7 @@ const Map> localizedValues = { "MyVaccines": {"en": "My Vaccines", "ar": "تطعيماتي"}, "MyVaccinesSubtitle": {"en": "List", "ar": "قائمة"}, "Medical": {"en": "Medical", "ar": "التقارير"}, - "MedicalSubtitle": {"Report": "List", "ar": "الطبية"}, + "MedicalSubtitle": {"en": "Report", "ar": "الطبية"}, "Monthly": {"en": "Monthly", "ar": "تقارير"}, "MonthlySubtitle": {"en": "Report", "ar": "الشهرية"}, "Sick": {"en": "Sick", "ar": "الإجازات"}, diff --git a/lib/core/model/vaccine/my_vaccine.dart b/lib/core/model/vaccine/my_vaccine.dart index ac6e2e19..dc921c12 100644 --- a/lib/core/model/vaccine/my_vaccine.dart +++ b/lib/core/model/vaccine/my_vaccine.dart @@ -1,91 +1,152 @@ class VaccineModel { - String to; - String from; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; + String setupID; + int projectID; int patientID; - String tokenID; - int patientTypeID; - int patientType; + int invoiceNo; + String procedureID; + String vaccineName; + Null vaccineNameN; String invoiceDate; + int doctorID; + int clinicID; + String firstName; + String middleName; + String lastName; + Null firstNameN; + Null middleNameN; + Null lastNameN; + String dateofBirth; + int actualDoctorRate; + String age; + String clinicName; String doctorImageURL; String doctorName; + int doctorRate; String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + int noOfPatientsRate; + String patientName; String projectName; - String vaccineName; + String qR; + List speciality; + String vaccinationDate; - VaccineModel({ - this.to, - this.from, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.invoiceDate, - this.doctorImageURL, - this.doctorName, - this.doctorTitle, - this.projectName, - this.vaccineName, - }); + VaccineModel( + {this.setupID, + this.projectID, + this.patientID, + this.invoiceNo, + this.procedureID, + this.vaccineName, + this.vaccineNameN, + this.invoiceDate, + this.doctorID, + this.clinicID, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.dateofBirth, + this.actualDoctorRate, + this.age, + this.clinicName, + this.doctorImageURL, + this.doctorName, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.noOfPatientsRate, + this.patientName, + this.projectName, + this.qR, + this.speciality, + this.vaccinationDate}); VaccineModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + invoiceNo = json['InvoiceNo']; + procedureID = json['ProcedureID']; vaccineName = json['VaccineName']; - projectName = json['ProjectName']; - doctorTitle = json['DoctorTitle']; - doctorName = json['DoctorName']; - doctorImageURL = json['DoctorImageURL']; + vaccineNameN = json['VaccineNameN']; invoiceDate = json['InvoiceDate']; - to = json['To']; - from = json['From']; - versionID = json['VersionID']; - channel = json['Channel']; - languageID = json['LanguageID']; - iPAdress = json['IPAdress']; - generalid = json['generalid']; - patientOutSA = json['PatientOutSA']; - sessionID = json['SessionID']; - isDentalAllowedBackend = json['isDentalAllowedBackend']; - deviceTypeID = json['DeviceTypeID']; - patientID = json['PatientID']; - tokenID = json['TokenID']; - patientTypeID = json['PatientTypeID']; - patientType = json['PatientType']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + dateofBirth = json['DateofBirth']; + actualDoctorRate = json['ActualDoctorRate']; + age = json['Age']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + noOfPatientsRate = json['NoOfPatientsRate']; + patientName = json['PatientName']; + projectName = json['ProjectName']; + qR = json['QR']; + speciality = json['Speciality'].cast(); + vaccinationDate = json['VaccinationDate']; } Map toJson() { final Map data = new Map(); - data['To'] = this.to; - data['From'] = this.from; - data['VersionID'] = this.versionID; - data['Channel'] = this.channel; - data['LanguageID'] = this.languageID; - data['IPAdress'] = this.iPAdress; - data['generalid'] = this.generalid; - data['PatientOutSA'] = this.patientOutSA; - data['SessionID'] = this.sessionID; - data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; - data['DeviceTypeID'] = this.deviceTypeID; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; - data['TokenID'] = this.tokenID; - data['PatientTypeID'] = this.patientTypeID; - data['PatientType'] = this.patientType; + data['InvoiceNo'] = this.invoiceNo; + data['ProcedureID'] = this.procedureID; + data['VaccineName'] = this.vaccineName; + data['VaccineNameN'] = this.vaccineNameN; + data['InvoiceDate'] = this.invoiceDate; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['FirstNameN'] = this.firstNameN; + data['MiddleNameN'] = this.middleNameN; + data['LastNameN'] = this.lastNameN; + data['DateofBirth'] = this.dateofBirth; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['Age'] = this.age; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['PatientName'] = this.patientName; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['Speciality'] = this.speciality; + data['VaccinationDate'] = this.vaccinationDate; return data; } } diff --git a/lib/core/service/vaccine_service.dart b/lib/core/service/vaccine_service.dart index 189e26d8..9904b838 100644 --- a/lib/core/service/vaccine_service.dart +++ b/lib/core/service/vaccine_service.dart @@ -7,25 +7,10 @@ class VaccineService extends BaseService { List get vaccineList => _vaccineList; - VaccineModel _vaccineModel = VaccineModel( - to: "0", - from: "0", - channel: 3, - deviceTypeID: 2, - generalid: "Cs2020@2016\$2958", - iPAdress: "10.20.10.20", - isDentalAllowedBackend: false, - languageID: 2, - patientID: 1231755, - patientOutSA: 0, - patientType: 1, - patientTypeID: 1, - sessionID: "uoKFXSLUwEaHYPwKZNA", - tokenID: "@dm!n", - versionID: 5.5, - ); - Future getMyVaccine() async { + Map body = Map(); + body['To'] = "0"; + body['From'] = "0"; hasError = false; _vaccineList.clear(); await baseAppClient.post(GET_VACCINES, @@ -36,8 +21,28 @@ class VaccineService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _vaccineModel.toJson()); + }, body: body); } - Future sendEmail() async {} + Future sendEmail() async { + + Map body = Map(); + body['ListVaccines'] = vaccineList.map((v) => v.toJson()).toList(); + body['ListVaccines'] = user.emailAddress; + body['DateofBirth'] = user.dateofBirth; + body['PatientIditificationNum'] = user.patientIdentificationNo; + body['PatientMobileNumber'] = user.mobileNumber; + body['PatientName'] = user.firstName + " "+ user.lastName; + + hasError = false; + + await baseAppClient.post(GET_VACCINES, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + + } } diff --git a/lib/core/viewModels/vaccine_view_model.dart b/lib/core/viewModels/vaccine_view_model.dart index a3b6c057..233a945f 100644 --- a/lib/core/viewModels/vaccine_view_model.dart +++ b/lib/core/viewModels/vaccine_view_model.dart @@ -1,3 +1,5 @@ +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + import 'base_view_model.dart'; import '../../locator.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; @@ -22,4 +24,18 @@ class VaccineViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future sendEmail({String message}) async { + hasError = false; + setState(ViewState.BusyLocal); + await _vaccineService.sendEmail(); + if (_vaccineService.hasError) { + error = _vaccineService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + AppToast.showSuccessToast(message: message); + setState(ViewState.Idle); + } + } } diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index 70d164ff..6483b6b2 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.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/others/rounded_container.dart'; @@ -39,95 +40,117 @@ class _InsuranceCardState extends State { itemBuilder: (BuildContext context, int index) { return RoundedContainer( backgroundColor: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ExpansionTile( - title: Container( - height: 65.0, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.symmetric(vertical: 15.0), - child: Texts( - model.insurance[index].groupName, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ExpansionTile( + title: Container( + height: 65.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.symmetric(vertical: 15.0), + child: Texts( + model.insurance[index].groupName, + ), ), - ), - ], - ), - ), - children: [ - Divider( - color: Colors.black, - height: 25.0, - thickness: 0.5, - ), - Texts( - TranslationBase.of(context).companyName + - model.insurance[index].companyName, - fontSize: 20.0, - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 0.5, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Text( - TranslationBase.of(context).category + - model.insurance[index].subCategoryDesc, - style: TextStyle(fontSize: 18.5), - ), - Text( - TranslationBase.of(context).expirationDate + - convertDateFormat( - model.insurance[index].cardValidTo), - style: TextStyle(fontSize: 18.5), - ), - Text( - TranslationBase.of(context).patientCard + - model.insurance[index].patientCardID, - style: TextStyle(fontSize: 18.5), - ), - Text( - TranslationBase.of(context).policyNumber + - model - .insurance[index].insurancePolicyNumber, - style: TextStyle(fontSize: 18.5), - ), - ], - ), - Column( - children: [ - model.insurance[index].isActive == true - ? Text('Active', - style: TextStyle( - color: Colors.green, - fontWeight: FontWeight.w900, - fontSize: 17.9)) - : Text('Not Active', - style: TextStyle( - color: Colors.red, - fontWeight: FontWeight.w900, - fontSize: 17.9)) - ], - ), - SizedBox( - height: 14.5, + ], + ), ), - if (model.insurance[index].isActive == true) + children: [ Container( - child: Button( - label: TranslationBase.of(context).seeDetails, + padding: EdgeInsets.all(14), + width: double.infinity, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.grey,width: 0.2), + borderRadius: BorderRadius.all(Radius.circular(2)), + boxShadow: [ + BoxShadow( + color: Colors.white70, + ), + + ] + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).companyName + + model.insurance[index].companyName, + fontSize: 20.0, + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 0.5, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text( + TranslationBase.of(context).category + + model.insurance[index].subCategoryDesc, + style: TextStyle(fontSize: 18.5), + ), + Text( + TranslationBase.of(context).expirationDate + + convertDateFormat( + model.insurance[index].cardValidTo), + style: TextStyle(fontSize: 18.5), + ), + Text( + TranslationBase.of(context).patientCard + + model.insurance[index].patientCardID, + style: TextStyle(fontSize: 18.5), + ), + Text( + TranslationBase.of(context).policyNumber + + model + .insurance[index].insurancePolicyNumber, + style: TextStyle(fontSize: 18.5), + ), + ], + ), + Column( + children: [ + model.insurance[index].isActive == true + ? Text('Active', + style: TextStyle( + color: Colors.green, + fontWeight: FontWeight.w900, + fontSize: 17.9)) + : Text('Not Active', + style: TextStyle( + color: Colors.red, + fontWeight: FontWeight.w900, + fontSize: 17.9)) + ], + ), + SizedBox( + height: 14.5, + ), + if (model.insurance[index].isActive == true) + Container( + color: Colors.transparent, + child: SecondaryButton( + label: TranslationBase.of(context).seeDetails, + textColor: Colors.white, + ), + width: double.infinity, + ), + ], ), - width: 400.0, ), - ], - ), - ], + + + ], + ), + ], + ), ), ); }), diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index d0c8d382..d7afab94 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; @@ -592,6 +593,10 @@ class _HomePageState extends State { context, FadePage(page: AllHabibMedicalService())), ), DashboardItem( + onTap: (){ + Navigator.push(context, FadePage(page: FeedbackHomePage())); + + }, child: Container( width: double.infinity, padding: EdgeInsets.all(10), diff --git a/lib/pages/vaccine/my_vaccines_screen.dart b/lib/pages/vaccine/my_vaccines_screen.dart index cfb0415f..c825884c 100644 --- a/lib/pages/vaccine/my_vaccines_screen.dart +++ b/lib/pages/vaccine/my_vaccines_screen.dart @@ -1,15 +1,12 @@ -import 'dart:typed_data'; -import 'dart:convert'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; import '../base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; -import 'package:flutter_email_sender/flutter_email_sender.dart'; import 'package:popup_box/popup_box.dart'; class MyVaccines extends StatefulWidget { @@ -24,297 +21,193 @@ class _MyVaccinesState extends State { onModelReady: (model) => model.getVaccine(), builder: (BuildContext context, VaccineViewModel model, Widget child) => AppScaffold( - isShowAppBar: true, - appBarTitle: 'My Vaccines', - baseViewModel: model, - body: Container( - margin: EdgeInsets.only( - left: SizeConfig.screenWidth * 0.004, - right: SizeConfig.screenWidth * 0.004, - top: SizeConfig.screenWidth * 0.04, - ), - child: Column( - children: [ - RoundedContainer( - backgroundColor: Colors.white, - child: ExpansionTile( - title: Container( - height: 65.0, - child: Text('2018'), - ), - children: [ - Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.vaccineList == null - ? 0 - : model.vaccineList.length, - itemBuilder: (BuildContext context, int index) { - return Column( - children: [ - RoundedContainer( - child: Column( - children: [ - Row( + isShowAppBar: true, + appBarTitle: 'My Vaccines', + baseViewModel: model, + body: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: Column( + children: [ + RoundedContainer( + backgroundColor: Colors.white, + child: ExpansionTile( + title: Container( + height: 65.0, + child: Text('2018'), + ), + children: [ + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.vaccineList == null + ? 0 + : model.vaccineList.length, + itemBuilder: (BuildContext context, int index) { + return Column( + children: [ + RoundedContainer( + child: Column( children: [ - Column( + Row( children: [ - Padding( - padding: EdgeInsets.symmetric( - horizontal: 20.0, - vertical: 20.0), - child: Image.network( - model.vaccineList[index] - .doctorImageURL, - height: SizeConfig - .imageSizeMultiplier * - 23, - width: SizeConfig - .imageSizeMultiplier * - 20, - fit: BoxFit.fill, + Expanded( + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.0, + vertical: 20.0), + child: Image.network( + model.vaccineList[index] + .doctorImageURL, + height: SizeConfig + .imageSizeMultiplier * + 23, + width: SizeConfig + .imageSizeMultiplier * + 20, + fit: BoxFit.fill, + ), + ), + ], ), + flex: 2, ), - ], - ), - Container( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - model.vaccineList[index] - .doctorTitle + - model.vaccineList[index] - .doctorName, - style: TextStyle( - fontWeight: FontWeight.w900, - fontSize: 16.6, - ), - ), - SpaceBetweenTexts(space: 7.0), - Text( - model.vaccineList[index] - .projectName, - style: TextStyle( - fontSize: 17.0, - letterSpacing: 0.5, + Expanded( + child: Container( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + model.vaccineList[index] + .doctorTitle + + model.vaccineList[index] + .doctorName, + style: TextStyle( + fontWeight: FontWeight.w900, + fontSize: 16.6, + ), + ), + SpaceBetweenTexts(space: 7.0), + Text( + model.vaccineList[index] + .projectName, + style: TextStyle( + fontSize: 17.0, + letterSpacing: 0.5, + ), + ), + SpaceBetweenTexts(space: 7.0), + Text( + model.vaccineList[index] + .vaccineName, + style: TextStyle( + fontSize: 17.0, + ), + ), + SpaceBetweenTexts(space: 7.0), + Text( + 'Date Taken ' + + convertDateFormat(model + .vaccineList[index] + .invoiceDate), + style: + TextStyle(fontSize: 17.0), + ), + ], ), ), - SpaceBetweenTexts(space: 7.0), - Text( - model.vaccineList[index] - .vaccineName, - style: TextStyle( - fontSize: 17.0, - ), - ), - SpaceBetweenTexts(space: 7.0), - Text( - 'Date Taken ' + - convertDateFormat(model - .vaccineList[index] - .invoiceDate), - style: - TextStyle(fontSize: 17.0), - ), - ], - ), + flex: 5, + ), + ], ), ], ), - ], - ), - ), - ], - ); - }), - ) - ], - ), - ), - SpaceBetweenTexts(space: 165.0), - Flexible( - child: Container( - width: 350.0, - height: 80.0, - child: Button( - label: 'CHECK VACCINE AVAILABILITY', - backgroundColor: Color(0xff9EA3A4), + ), + ], + ); + }), + ) + ], + ), ), - ), + // SpaceBetweenTexts(space: 165.0), + + ], ), - Flexible( - child: Container( - width: 350.0, - height: 80.0, - child: Button( - label: 'SEND EMAIL', - backgroundColor: Color(0xffF62426), - onTap: () async { - await PopupBox.showPopupBox( - context: context, - button: MaterialButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(20), - ), - color: Colors.white, - child: Text( - 'CANCEL', - style: TextStyle(fontSize: 16.5), - ), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - willDisplayWidget: Column( - children: [ - Text( - 'Conform \nSend a copy of this report to the email' + - model.vaccineList[0].doctorName, - style: TextStyle( - fontSize: 20, - color: Colors.black26, - fontWeight: FontWeight.w900), + + ), + bottomSheet: Container( + color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(12), + height: MediaQuery.of(context).size.height *0.25, + width: double.infinity, + child: Column( + children: [ + Divider(height: 2,thickness: 1,), + SizedBox(height: 6,), + Container( + width: double.infinity, + // height: 80.0, + child: Button( + label: 'CHECK VACCINE AVAILABILITY', + backgroundColor: Color(0xff9EA3A4), + ), + ), + Container( + width: double.infinity, + // height: 80.0, + child: SecondaryButton( + label: 'SEND EMAIL', + color: Color(0xffF62426), + textColor: Colors.white, + disabled: model.vaccineList.length==0, + onTap: () async { + await PopupBox.showPopupBox( + context: context, + button: MaterialButton( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(3), ), - SizedBox( - height: 30.0, + color: Colors.white, + child: Text( + 'CANCEL', + style: TextStyle(fontSize: 16.5), ), - ], - )); - }, + onPressed: () { + Navigator.of(context).pop(); + }, + ), + willDisplayWidget: Column( + children: [ + Text( + 'Conform \nSend a copy of this report to the email' + + model.vaccineList[0].doctorName, + style: TextStyle( + fontSize: 20, + color: Colors.black26, + fontWeight: FontWeight.w900), + ), + SizedBox( + height: 30.0, + ), + ], + )); + }, + ), ), - ), + ], ), - ], + ), ), - -// child: ListView.builder( -// itemCount: model.vaccineList == null ? 0 : model.vaccineList.length, -// itemBuilder: (BuildContext context, int index) { -// return Column( -// children: [ -// RoundedContainer( -// backgroundColor: Colors.white, -// child: Column( -// children: [ -// ExpansionTile( -// title: Container( -// height: 60.0, -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Texts('2018'), -// ], -// ), -// ), -// children: [ -// Column( -// children: [ -// Row( -// children: [ -// Column( -// children: [ -// Padding( -// padding: EdgeInsets.symmetric( -// horizontal: 20.0, vertical: 20.0), -// child: Container( -// child: Image.network( -// model.vaccineList[index] -// .doctorImageURL, -// height: SizeConfig -// .imageSizeMultiplier * -// 23, -// width: SizeConfig -// .imageSizeMultiplier * -// 20, -// fit: BoxFit.fill, -// colorBlendMode: -// BlendMode.hardLight, -// ), -// ), -// ) -// ], -// ), -// Container( -// child: Column( -// mainAxisAlignment: -// MainAxisAlignment.start, -// crossAxisAlignment: -// CrossAxisAlignment.start, -// children: [ -// Text( -// model.vaccineList[index] -// .doctorTitle + -// model.vaccineList[index] -// .doctorName, -// style: TextStyle( -// fontWeight: FontWeight.w900, -// fontSize: 17.5), -// ), -// Text( -// model -// .vaccineList[index].projectName, -// style: TextStyle( -// fontSize: 19.0, -// letterSpacing: 0.3, -// color: Colors.grey, -// fontWeight: FontWeight.bold), -// ), -// Text( -// model -// .vaccineList[index].vaccineName, -// style: TextStyle( -// fontSize: 19.0, -// color: Colors.grey, -// fontWeight: FontWeight.bold), -// ), -// Text( -// 'Date Taken ' + -// convertDateFormat(model -// .vaccineList[index] -// .invoiceDate), -// style: TextStyle( -// fontSize: 19.0, -// color: Colors.grey, -// fontWeight: FontWeight.bold), -// ), -// ], -// ), -// ), -// ], -// ), -// ], -// ), -// ], -// ), -// ], -// ), -// ), -// Container( -// width: 300, -// child: Button( -// label: 'CHECK VACCINE AVAILABILITY', -// backgroundColor: Color(0xff9EA3A4), -// ), -// ), -// Container( -// width: 300, -// child: Button( -// label: 'SEND EMAIL', -// backgroundColor: Color(0xff9EA3A4), -// ), -// ), -// ], -// ); -// }, -// ), - ), - ), ); } - convertDateFormat(String Date) { const start = "/Date("; const end = "+0300)"; @@ -333,19 +226,7 @@ class _MyVaccinesState extends State { return newDate.toString(); } - emailSender() async { - final Email email = Email( - body: 'Email body', - subject: 'Email subject', - recipients: ['example@example.com'], - cc: ['cc@example.com'], - bcc: ['bcc@example.com'], - attachmentPaths: ['/path/to/attachment.zip'], - isHTML: false, - ); - await FlutterEmailSender.send(email); - } } class SpaceBetweenTexts extends StatelessWidget {