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/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..66c0c855 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,14 @@ class DoctorList { return data; } } + +class PatientDoctorAppointmentList { + String filterName = ""; + String distanceInKMs = ""; + List patientDoctorAppointmentList = List(); + + PatientDoctorAppointmentList( + {this.filterName, this.distanceInKMs, DoctorList patientDoctorAppointment}) { + patientDoctorAppointmentList.add(patientDoctorAppointment); + } +} 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/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 5d74cc59..c52002b4 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(); } @@ -47,53 +33,32 @@ 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: 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 + " - " +widget + .patientDoctorAppointmentListHospital[index].distanceInKMs + " KMs" , 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..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,51 +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()); + arr.add(new DoctorList.fromJson(v).projectName); + arrDistance.add(new DoctorList.fromJson(v) + .projectDistanceInKiloMeters + .toString()); + }); + } else {} + }); -// print(DoctorList -// .fromJson(v) -// .projectName); -// print(DoctorList -// .fromJson(v) -// .projectDistanceInKiloMeters); -// distinctIds = result.toSet().toList(); - }); - } 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( @@ -156,7 +242,6 @@ class _SearchByClinicState extends State { Navigator.push( context, MaterialPageRoute( -// builder: (context) => SearchResults(doctorsList: docList) builder: (context) => BranchView( doctorsList: docList, result: result, @@ -164,6 +249,5 @@ class _SearchByClinicState extends State { resultDistance: resultDistance), ), ); - //builder: (context) => SearchResults(doctorsList: docList))); } } diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 3e817878..1e7deb38 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,35 @@ 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, + distanceInKMs: element.projectDistanceInKiloMeters.toString(), + patientDoctorAppointment: element)); + } + }); } else {} }); - navigateToSearchResults(context, doctorsList); + + navigateToSearchResults( + context, doctorsList, _patientDoctorAppointmentListHospital); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -107,7 +137,7 @@ class _SearchByDoctorState extends State { _onDocTextChanged(content) { print(content); - if (content.length >= 4) { + if (content.length >= 3) { setState(() { _isButtonDisabled = false; }); @@ -123,10 +153,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 ""; + } } } 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 }; 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); + } + }