WD:select hospital by region changes

merge-update-with-lab-changes
taha.alam 7 months ago
parent 951a5a4932
commit e6fcb1fddf

@ -1,9 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="22.438" height="22.438" viewBox="0 0 22.438 22.438">
<g id="Clinic" transform="translate(-1 -1)">
<path id="Path_5237" data-name="Path 5237" d="M25,24h3.9v7.8H25Z" transform="translate(-12.293 -11.781)" fill="#2d343d"/>
<path id="Path_5238" data-name="Path 5238" d="M23.487,28.731V18H3V28.731H7.878V20.439a.488.488,0,0,1,.488-.488h9.756a.488.488,0,0,1,.488.488v8.292Z" transform="translate(-1.024 -8.708)" fill="#2d343d"/>
<path id="Path_5239" data-name="Path 5239" d="M15,24h3.9v7.8H15Z" transform="translate(-7.171 -11.781)" fill="#2d343d"/>
<path id="Path_5240" data-name="Path 5240" d="M22.463,5.878H16.122v-3.9A.977.977,0,0,0,15.146,1H9.292a.977.977,0,0,0-.976.976v3.9H1.976A.977.977,0,0,0,1,6.854v.488a.977.977,0,0,0,.976.976H22.463a.977.977,0,0,0,.976-.976V6.854a.977.977,0,0,0-.976-.976ZM13.683,4.9h-.976v.976a.488.488,0,0,1-.976,0V4.9h-.976a.488.488,0,0,1,0-.976h.976V2.951a.488.488,0,0,1,.976,0v.976h.976a.488.488,0,1,1,0,.976Z" transform="translate(0 0)" fill="#2d343d"/>
<path id="Path_5241" data-name="Path 5241" d="M22.951,42H1.488A.488.488,0,0,0,1,42.488v.488a1.465,1.465,0,0,0,1.463,1.463H21.975a1.465,1.465,0,0,0,1.463-1.463v-.488A.488.488,0,0,0,22.951,42Z" transform="translate(0 -21)" fill="#2d343d"/>
</g>
<svg data-name="Group 8404" height="26" id="Group_8404" viewBox="0 0 26 26"
width="26" xmlns="http://www.w3.org/2000/svg">
<rect data-name="Rectangle 17531" fill="#69a6e2" height="26" id="Rectangle_17531" rx="4"
width="26" />
<path d="M2.914,17.807s.731-.005,1.246-.005l3.9.019c.466,0,.854-.488.876-1.193l0-3.213c0-.685.311-1.221.793-1.252l1.2-.009c.483.029.814.572.814,1.253l0,3.231c.021.7.346,1.165.814,1.165l5.254.014.01-3.971c0-.683-.333-1.214-.82-1.245l-2.11-.01c-.467,0-.834-.486-.854-1.191l-.008-1.074c.023-.7.392-1.189.86-1.189l2.122.006c.482-.031.8-.592.8-1.274l.005-4.957a2.126,2.126,0,0,1-.693.69,2.164,2.164,0,0,1-.933.312l-3.569,0c-.465,0-.854.5-.876,1.2V8.295c-.022.7-.387,1.2-.854,1.2l-1.08-.008c-.468,0-.842-.482-.864-1.183l0-3.218c-.021-.705-.392-1.178-.859-1.178l-5.179,0V7.87c0,.684.324,1.231.808,1.263l2.122-.009c.48.031.82.595.82,1.275l-.007.916c0,.683-.328,1.23-.81,1.261l-2.126-.005c-.484.034-.808.572-.808,1.256Z" data-name="Path 5276"
fill="#fff"
id="Path_5276" transform="translate(2.327 2.327)" />
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -1,12 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="23.656" height="23.656" viewBox="0 0 23.656 23.656">
<g id="hospital" transform="translate(0)">
<g id="Group_8363" data-name="Group 8363" transform="translate(0 8.612)">
<path id="Path_5242" data-name="Path 5242" d="M3.1,186.392H.693a.693.693,0,0,0-.693.693v14.351H3.1Z" transform="translate(0 -186.392)" fill="#2d343d"/>
<path id="Path_5243" data-name="Path 5243" d="M447.357,186.392h-2.4v15.044h3.1V187.085A.693.693,0,0,0,447.357,186.392Z" transform="translate(-424.394 -186.392)" fill="#2d343d"/>
</g>
<g id="Group_8364" data-name="Group 8364" transform="translate(4.484)">
<path id="Path_5244" data-name="Path 5244" d="M0,0H4.631V2.41H0Z" transform="translate(8.549 19.025) rotate(90)" fill="#2d343d"/>
<path id="Path_5245" data-name="Path 5245" d="M111.043,2.847h-2.182V.693A.693.693,0,0,0,108.168,0h-7.454a.693.693,0,0,0-.693.693V2.847h-2.28a.693.693,0,0,0-.693.693V23.656H101.8V18.332a.693.693,0,0,1,.693-.693h3.8a.693.693,0,0,1,.693.693v5.324h4.753V3.54a.693.693,0,0,0-.693-.693Zm-9.789,12.4h-.746a.693.693,0,0,1,0-1.386h.746a.693.693,0,0,1,0,1.386Zm0-2.772h-.746a.693.693,0,0,1,0-1.386h.746a.693.693,0,0,1,0,1.386Zm0-2.772h-.746a.693.693,0,0,1,0-1.386h.746a.693.693,0,0,1,0,1.386Zm3.511,5.544h-.746a.693.693,0,1,1,0-1.386h.746a.693.693,0,0,1,0,1.386Zm0-2.772h-.746a.693.693,0,0,1,0-1.386h.746a.693.693,0,0,1,0,1.386Zm0-2.772h-.746a.693.693,0,1,1,0-1.386h.746a.693.693,0,0,1,0,1.386Zm1.024-4.145h-.7v.7a.693.693,0,1,1-1.386,0v-.7H103a.693.693,0,1,1,0-1.386h.7v-.7a.693.693,0,1,1,1.386,0v.7h.7a.693.693,0,1,1,0,1.386Zm2.488,9.689h-.746a.693.693,0,1,1,0-1.386h.746a.693.693,0,0,1,0,1.386Zm0-2.772h-.746a.693.693,0,0,1,0-1.386h.746a.693.693,0,0,1,0,1.386Zm0-2.772h-.746a.693.693,0,1,1,0-1.386h.746a.693.693,0,0,1,0,1.386Z" transform="translate(-97.048)" fill="#2d343d"/>
</g>
</g>
<svg data-name="Group 8404" height="26" id="Group_8404" viewBox="0 0 26 26"
width="26" xmlns="http://www.w3.org/2000/svg">
<rect data-name="Rectangle 17531" fill="#cc2229" height="26" id="Rectangle_17531" rx="4"
width="26" />
<path d="M2.914,17.807s.731-.005,1.246-.005l3.9.019c.466,0,.854-.488.876-1.193l0-3.213c0-.685.311-1.221.793-1.252l1.2-.009c.483.029.814.572.814,1.253l0,3.231c.021.7.346,1.165.814,1.165l5.254.014.01-3.971c0-.683-.333-1.214-.82-1.245l-2.11-.01c-.467,0-.834-.486-.854-1.191l-.008-1.074c.023-.7.392-1.189.86-1.189l2.122.006c.482-.031.8-.592.8-1.274l.005-4.957a2.126,2.126,0,0,1-.693.69,2.164,2.164,0,0,1-.933.312l-3.569,0c-.465,0-.854.5-.876,1.2V8.295c-.022.7-.387,1.2-.854,1.2l-1.08-.008c-.468,0-.842-.482-.864-1.183l0-3.218c-.021-.705-.392-1.178-.859-1.178l-5.179,0V7.87c0,.684.324,1.231.808,1.263l2.122-.009c.48.031.82.595.82,1.275l-.007.916c0,.683-.328,1.23-.81,1.261l-2.126-.005c-.484.034-.808.572-.808,1.256Z" data-name="Path 5276"
fill="#fff"
id="Path_5276" transform="translate(2.327 2.327)" />
</svg>

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -2146,11 +2146,16 @@ const Map localizedValues = {
"selectRegion": {"en": "Select Region", "ar": "اختر المنطقة"},
"selectFacitlity": {"en": "Select Facility", "ar": "اختر المنشأة"},
"selectDoctor": {"en": "Select Doctor", "ar": "اختر الطبيب"},
"hmgHospital": {"en": "HMG Hospital", "ar": "مستشفى HMG"},
"hmcHospital": {"en": "HMG Medical Center", "ar": "مركز إتش إم جي الطبي"},
"hmcHospitalCount": {
"en": "@ HMG Medical Center",
"ar": "@ مركز إتش إم جي الطبي"
},
"hmgHospitalCount": {"en": "@ HMG Hospital", "ar": "@ مستشفى HMG"},
"hmgHospital": {"en": "Hospital", "ar": "المستشفيات "},
"hmcHospital": {"en": "Medical Center", "ar": "المراكز الطبية"},
"hmcHospitalCountSingle": {
"en": "@ Medical Center",
"ar": "المراكز الطبية @"
},
"hmgHospitalCountSingle": {"en": "@ Hospital", "ar": "المستشفيات @"},
"hmcHospitalCountPlural": {
"en": "@ Medical Centers",
"ar": "المراكز الطبية @"
},
"hmgHospitalCountPlural": {"en": "@ Hospitals", "ar": "المستشفيات @"},
};

@ -15,6 +15,11 @@ class HospitalsModel {
dynamic mainProjectID;
bool? projectOutSA;
bool? usingInDoctorApp;
bool? isHMC;
String? region;
String? regionArabic;
String? regionEnglish;
String? regionID;
HospitalsModel(
{this.desciption,
@ -32,7 +37,13 @@ class HospitalsModel {
this.longitude,
this.mainProjectID,
this.projectOutSA,
this.usingInDoctorApp});
this.usingInDoctorApp,
this.isHMC,
this.region,
this.regionArabic,
this.regionEnglish,
this.regionID,
});
HospitalsModel.fromJson(Map<String, dynamic> json) {
desciption = json['Desciption'];
@ -51,6 +62,16 @@ class HospitalsModel {
mainProjectID = json['MainProjectID'];
projectOutSA = json['ProjectOutSA'];
usingInDoctorApp = json['UsingInDoctorApp'];
this.isHMC = json["IsHMC"];
this.regionArabic = json['RegionNameN'];
this.regionEnglish = json['RegionName'];
}
String? getRegionName(bool isArabic) {
if (isArabic) {
return regionArabic;
}
return regionEnglish;
}
Map<String, dynamic> toJson() {

@ -1,3 +1,5 @@
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
class DoctorList {
int? clinicID;
dynamic appointmentNo;
@ -229,9 +231,21 @@ class PatientDoctorAppointmentList {
List<DoctorList>? patientDoctorAppointmentList = [];
String? projectTopName = "";
String? projectBottomName = "";
List<HospitalsModel> hospitalList = [];
PatientDoctorAppointmentList({this.filterName, this.distanceInKMs, this.projectTopName, this.projectBottomName, DoctorList? patientDoctorAppointment}) {
patientDoctorAppointmentList!.add(patientDoctorAppointment!);
PatientDoctorAppointmentList(
{this.filterName,
this.distanceInKMs,
this.projectTopName,
this.projectBottomName,
DoctorList? patientDoctorAppointment,
HospitalsModel? model}) {
if (model != null) {
hospitalList.add(model);
}
if (patientDoctorAppointment != null) {
patientDoctorAppointmentList!.add(patientDoctorAppointment!);
}
}
}

@ -26,8 +26,13 @@ class DentalComplaints extends StatefulWidget {
SearchInfo searchInfo;
Function? onSelectedMethod;
bool isDoctorNameSearch;
bool isFromHospitalSearchPage;
DentalComplaints({required this.searchInfo, this.onSelectedMethod, this.isDoctorNameSearch = false});
DentalComplaints(
{required this.searchInfo,
this.onSelectedMethod,
this.isDoctorNameSearch = false,
this.isFromHospitalSearchPage = false});
@override
_DentalComplaintsState createState() => _DentalComplaintsState();
@ -75,6 +80,12 @@ class _DentalComplaintsState extends State<DentalComplaints> {
languageID: languageID,
isDoctorNameSearch: widget.isDoctorNameSearch,
onSelectedMethod: widget.onSelectedMethod,
isFromHospitalSearchPage: widget.isFromHospitalSearchPage,
onDoctorFetched: widget.isFromHospitalSearchPage
? (doctorsList) {
Navigator.pop(context, doctorsList);
}
: null,
)..logAnalytics = () {
final info = widget.searchInfo;
locator<GAnalytics>()

@ -304,7 +304,7 @@ class RegionTitle extends StatelessWidget {
Row(
children: [
Text(
"${TranslationBase.of(context).hmgHospitalCount.replaceAll("@", hmgCount)} ,",
"${TranslationBase.of(context).HospitalString(num.parse(hmgCount)).replaceAll("@", hmgCount)} ,",
style: TextStyle(
fontSize: 14,
color: Color(0xFFD02127),
@ -314,7 +314,7 @@ class RegionTitle extends StatelessWidget {
width: 8,
),
Text(
"${TranslationBase.of(context).hmcHospitalCount.replaceAll("@", hmcCount)}",
"${TranslationBase.of(context).MedicalCenterString(num.parse(hmcCount)).replaceAll("@", hmcCount)}",
style: TextStyle(
fontSize: 14,
color: Color(0xFF40ACC9),
@ -368,8 +368,8 @@ class HospitalTitle extends StatelessWidget {
),
Text(
isHMC
? "${TranslationBase.of(context).hmcHospitalCount.replaceAll("@", itemCount)}"
: "${TranslationBase.of(context).hmgHospitalCount.replaceAll("@", itemCount)}",
? "${TranslationBase.of(context).MedicalCenterString(num.parse(itemCount)).replaceAll("@", itemCount)}"
: "${TranslationBase.of(context).HospitalString(num.parse(itemCount)).replaceAll("@", itemCount)}",
style: TextStyle(
fontSize: 12, color: Colors.black, fontWeight: FontWeight.w600),
),

@ -1,17 +1,13 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResultsByRegion.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/LaserClinic.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/SearchResultWithTab.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/SearchResultWithTabForHospital.dart';
import 'package:diplomaticquarterapp/services/appointment_services/doctor_response_mapper.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../config/size_config.dart';
import '../../../core/model/hospitals/hospitals_model.dart';
import '../../../core/viewModels/project_view_model.dart';
import '../../../models/Appointments/DoctorListResponse.dart';
@ -26,7 +22,6 @@ import '../../../uitl/translations_delegate_base.dart';
import '../../../widgets/transitions/fade_page.dart';
import '../../livecare/livecare_home.dart';
import '../DentalComplaints.dart';
import '../dialog/clinic_list_dialog.dart';
import 'LiveCareBookAppointment.dart';
class SearchByHospital extends StatefulWidget {
@ -37,6 +32,7 @@ class SearchByHospital extends StatefulWidget {
class _SearchByHospitalState extends State<SearchByHospital> {
HospitalsModel? selectedHospital;
bool nearestAppo = false;
RegionList? hospitalList;
String? selectedClinicName;
List<HospitalsModel> projectsList = [];
@ -64,161 +60,168 @@ class _SearchByHospitalState extends State<SearchByHospital> {
@override
Widget build(BuildContext context) {
AppGlobal.context = context;
return Column(
children: [
Padding(
padding: const EdgeInsets.only(left: 6, right: 6, top: 16),
child: Row(
children: <Widget>[
Checkbox(
activeColor: CustomColors.accentColor,
value: nearestAppo,
onChanged: (bool? value) {
nearestAppo = value ?? false;
setState(() {});
},
),
AutoSizeText(
TranslationBase.of(context).nearestAppo.trim(),
maxLines: 1,
minFontSize: 10,
style: TextStyle(
fontSize: SizeConfig.textMultiplier! * 1.4,
fontWeight: FontWeight.w600,
letterSpacing: -0.39,
height: 0.8,
),
),
// Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56)),
],
),
),
mHeight(8),
InkWell(
onTap: () {
openDropdown(projectDropdownKey);
},
child: Container(
width: double.infinity,
decoration: containerRadius(Colors.white, 12),
margin: EdgeInsets.only(left: 20, right: 20),
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
child: Row(
children: [
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).selectHospital,
style: TextStyle(
fontSize: 11,
letterSpacing: -0.44,
fontWeight: FontWeight.w600,
),
),
Container(
height: 18,
width: double.infinity,
child: DropdownButtonHideUnderline(
child: DropdownButton<HospitalsModel>(
key: projectDropdownKey,
hint: Text(TranslationBase.of(context).selectHospital),
value: selectedHospital,
iconSize: 0,
isExpanded: true,
style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black),
items: projectsList.map((HospitalsModel item) {
return DropdownMenuItem<HospitalsModel>(
value: item,
child: AutoSizeText(
item.name!,
maxLines: 1,
minFontSize: 10,
style: TextStyle(
fontSize: SizeConfig.textMultiplier! * 1.6,
fontWeight: FontWeight.w600,
letterSpacing: -0.39,
height: 0.8,
),
),
// Text('${item.name!}'),
);
}).toList(),
onChanged: (HospitalsModel? newValue) {
getClinicWrtHospital(newValue);
setState(() {
selectedHospital = newValue;
});
},
),
),
),
],
),
),
Icon(Icons.keyboard_arrow_down),
],
)),
),
if (clinicIds?.isNotEmpty == true) ...[
mHeight(8),
InkWell(
onTap: () {
showClickListDialog(context, clinicIds ?? List.empty(), onSelection: (ListClinicCentralized clincs) {
selectedClinic = clincs;
Navigator.pop(context);
setState(() {
dropdownTitle = clincs.clinicDescription!;
dropdownValue = clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString();
});
getDoctorsList(context);
context.read<ProjectViewModel>().analytics.appointment.book_appointment_select_clinic(appointment_type: 'regular', clinic: clincs.clinicDescription);
});
},
child: Container(
width: double.infinity,
decoration: containerRadius(Colors.white, 12),
margin: EdgeInsets.only(left: 20, right: 20),
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 8),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).selectClinic,
style: TextStyle(
fontSize: 11,
letterSpacing: -0.44,
fontWeight: FontWeight.w600,
),
),
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 2),
child: Text(
dropdownTitle,
style: TextStyle(
fontSize: 13,
letterSpacing: -0.44,
fontWeight: FontWeight.w600,
),
),
),
],
),
),
Icon(Icons.keyboard_arrow_down),
],
),
),
return (hospitalList != null)
? SearchResultWithTabForHospital(
patientDoctorAppointmentListHospital: hospitalList!,
doctorsList: [],
isDoctorSearchResult: false,
isLiveCareAppointment: false,
)
]
],
);
: SizedBox.shrink();
// return Column(
// children: [
// Padding(
// padding: const EdgeInsets.only(left: 6, right: 6, top: 16),
// child: Row(
// children: <Widget>[
// Checkbox(
// activeColor: CustomColors.accentColor,
// value: nearestAppo,
// onChanged: (bool? value) {
// nearestAppo = value ?? false;
// setState(() {});
// },
// ),
// AutoSizeText(
// TranslationBase.of(context).nearestAppo.trim(),
// maxLines: 1,
// minFontSize: 10,
// style: TextStyle(
// fontSize: SizeConfig.textMultiplier! * 1.4,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.39,
// height: 0.8,
// ),
// ),
// // Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56)),
// ],
// ),
// ),
// mHeight(8),
// InkWell(
// onTap: () {
// openDropdown(projectDropdownKey);
// },
// child: Container(
// width: double.infinity,
// decoration: containerRadius(Colors.white, 12),
// margin: EdgeInsets.only(left: 20, right: 20),
// padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
// child: Row(
// children: [
// Flexible(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// TranslationBase.of(context).selectHospital,
// style: TextStyle(
// fontSize: 11,
// letterSpacing: -0.44,
// fontWeight: FontWeight.w600,
// ),
// ),
// Container(
// height: 18,
// width: double.infinity,
// child: DropdownButtonHideUnderline(
// child: DropdownButton<HospitalsModel>(
// key: projectDropdownKey,
// hint: Text(TranslationBase.of(context).selectHospital),
// value: selectedHospital,
// iconSize: 0,
// isExpanded: true,
// style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black),
// items: projectsList.map((HospitalsModel item) {
// return DropdownMenuItem<HospitalsModel>(
// value: item,
// child: AutoSizeText(
// item.name!,
// maxLines: 1,
// minFontSize: 10,
// style: TextStyle(
// fontSize: SizeConfig.textMultiplier! * 1.6,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.39,
// height: 0.8,
// ),
// ),
// // Text('${item.name!}'),
// );
// }).toList(),
// onChanged: (HospitalsModel? newValue) {
// getClinicWrtHospital(newValue);
// setState(() {
// selectedHospital = newValue;
// });
// },
// ),
// ),
// ),
// ],
// ),
// ),
// Icon(Icons.keyboard_arrow_down),
// ],
// )),
// ),
// if (clinicIds?.isNotEmpty == true) ...[
// mHeight(8),
// InkWell(
// onTap: () {
// showClickListDialog(context, clinicIds ?? List.empty(), onSelection: (ListClinicCentralized clincs) {
// selectedClinic = clincs;
// Navigator.pop(context);
// setState(() {
// dropdownTitle = clincs.clinicDescription!;
// dropdownValue = clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString();
// });
// getDoctorsList(context);
//
// context.read<ProjectViewModel>().analytics.appointment.book_appointment_select_clinic(appointment_type: 'regular', clinic: clincs.clinicDescription);
// });
// },
// child: Container(
// width: double.infinity,
// decoration: containerRadius(Colors.white, 12),
// margin: EdgeInsets.only(left: 20, right: 20),
// padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 8),
// child: Row(
// children: [
// Expanded(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// TranslationBase.of(context).selectClinic,
// style: TextStyle(
// fontSize: 11,
// letterSpacing: -0.44,
// fontWeight: FontWeight.w600,
// ),
// ),
// Padding(
// padding: const EdgeInsets.only(top: 4, bottom: 2),
// child: Text(
// dropdownTitle,
// style: TextStyle(
// fontSize: 13,
// letterSpacing: -0.44,
// fontWeight: FontWeight.w600,
// ),
// ),
// ),
// ],
// ),
// ),
// Icon(Icons.keyboard_arrow_down),
// ],
// ),
// ),
// )
// ]
// ],
// );
}
void openDropdown(GlobalKey key) {
@ -263,16 +266,17 @@ class _SearchByHospitalState extends State<SearchByHospital> {
ClinicListService service = new ClinicListService();
List<HospitalsModel> projectsListLocal = [];
service.getProjectsList(languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
setState(() async {
res['ListProject'].forEach((v) {
projectsListLocal.add(new HospitalsModel.fromJson(v));
});
projectsList = projectsListLocal;
hospitalList = await DoctorMapper.getMappedHospitals(projectsList);
});
GifLoaderDialogUtils.hideDialog(context);
} else {}
GifLoaderDialogUtils.hideDialog(context);
locationUtils.getCurrentLocation();
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);

@ -0,0 +1,287 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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/components/LaserClinic.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/LiveCareBookAppointment.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/appointment_services/doctor_response_mapper.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../config/shared_pref_kay.dart';
import '../../../models/Appointments/DoctorListResponse.dart';
import '../../../services/authentication/auth_provider.dart';
import '../../../theme/colors.dart';
import '../../../uitl/gif_loader_dialog_utils.dart';
class ResultByClinic extends StatefulWidget {
HospitalsModel? selectedValue;
Function(RegionList) onClinicSelected;
ResultByClinic(
{super.key, this.selectedValue, required this.onClinicSelected});
@override
State<ResultByClinic> createState() => _ResultByClinicState();
}
class _ResultByClinicState extends State<ResultByClinic> {
List<ListClinicCentralized>? clinicIds = List.empty();
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback(
(_) => getClinicWrtHospital(widget.selectedValue));
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Expanded(
child: ListView.builder(
itemBuilder: (_, index) => InkWell(
onTap: () {
getDoctorsList(
context,
"${clinicIds?[index].clinicID.toString() ?? ''}-${clinicIds?[index].isLiveCareClinicAndOnline!.toString()}-${clinicIds?[index].liveCareClinicID.toString()}-${clinicIds?[index].liveCareServiceID.toString()}",
clinicIds?[index].clinicDescription!,
widget.selectedValue,
clinicIds?[index]);
},
child: Material(
color: CustomColors.white,
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
clinicIds?[index].clinicDescription ?? '',
style: TextStyle(
fontSize: 22,
color: Colors.black,
fontWeight: FontWeight.w700),
),
],
),
),
Padding(
padding: EdgeInsets.all(8),
child: Center(
child: Icon(
Icons.arrow_forward_ios,
color: CustomColors.black,
size: 16,
),
),
),
],
)),
),
),
itemCount: clinicIds?.length ?? 0,
))
],
);
}
getDoctorsList(
BuildContext context,
String? dropdownValue,
String? dropdownTitle,
HospitalsModel? selectedHospital,
ListClinicCentralized? selectedClinic) {
SearchInfo searchInfo = new SearchInfo();
if (dropdownValue != null) if (dropdownValue!.split("-")[0] == "17") {
searchInfo.ProjectID =
int.parse(selectedHospital?.mainProjectID.toString() ?? "");
searchInfo.ClinicID = int.parse(dropdownValue!.split("-")[0]);
searchInfo.hospital = selectedHospital;
searchInfo.clinic = selectedClinic;
searchInfo.date = DateTime.now();
if (context.read<ProjectViewModel>().isLogin) {
if (context.read<ProjectViewModel>().user.age! > 12) {
navigateToDentalComplaints(context, searchInfo);
} else {
callDoctorsSearchAPI(17);
}
} else {
navigateToDentalComplaints(context, searchInfo);
}
} else if (dropdownValue!.split("-")[0] == "253") {
navigateToLaserClinic(context);
// callDoctorsSearchAPI();
} else if (dropdownValue!.split("-")[1] == "true"
// && authProvider.isLogin &&
// authUser.patientType == 1
) {
Navigator.push(
context,
FadePage(
page: LiveCareBookAppointment(
clinicName: dropdownTitle,
liveCareClinicID: dropdownValue!.split("-")[2],
liveCareServiceID: dropdownValue!.split("-")[3]),
),
).then((value) {
print("navigation return ");
if (value == "false") return;
// setState(() {
// });
if (value == "livecare") {
Navigator.push(context, FadePage(page: LiveCareHome()));
}
if (value == "schedule") {
callDoctorsSearchAPI(int.parse(dropdownValue!.split("-")[0]));
}
});
setState(() {});
} else {
callDoctorsSearchAPI(int.parse(dropdownValue!.split("-")[0]));
}
}
Future navigateToLaserClinic(BuildContext context) async {
Navigator.push(
context,
FadePage(
page: LaserClinic(selectedHospital: widget.selectedValue!),
),
).then((value) {});
}
Future navigateToDentalComplaints(
BuildContext context, SearchInfo searchInfo) async {
Navigator.push(
context,
FadePage(
page: DentalComplaints(
searchInfo: searchInfo,
isFromHospitalSearchPage: true,
),
),
).then((value) {
if (value is RegionList) {
widget.onClinicSelected(value);
}
});
}
callDoctorsSearchAPI(int clinicID) {
var isArabic = context.read<ProjectViewModel>().isArabic;
int languageID = isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = [];
List<String> arr = [];
List<String> arrDistance = [];
List<String> result;
int numAll;
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =
[];
DoctorsListService service = new DoctorsListService();
service
.getDoctorsList(
clinicID,
widget.selectedValue?.mainProjectID.toString() != ""
? int.parse(
widget.selectedValue?.mainProjectID.toString() ?? "-1")
: 0,
false,
languageID,
null)
.then((res) async {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
RegionList regionHospitalList = RegionList();
if (res['DoctorList'].length != 0) {
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(
v,
));
});
regionHospitalList = await DoctorMapper.getMappedDoctor(doctorsList,
isArabic: isArabic);
var lat = await sharedPref.getDouble(USER_LAT);
var lng = await sharedPref.getDouble(USER_LONG);
var isLocationEnabled =
(lat != null && lat != 0.0) && (lng != null && lng != 0.0);
regionHospitalList = await DoctorMapper.sortList(
isLocationEnabled, regionHospitalList);
widget.onClinicSelected(regionHospitalList);
setState(() {});
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorSearchMsg']);
}
GifLoaderDialogUtils.hideDialog(context);
// navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err, localContext: context);
});
}
void getClinicWrtHospital(HospitalsModel? newValue) async {
AppGlobal.context = context;
GifLoaderDialogUtils.showMyDialog(context);
ClinicListService service = new ClinicListService();
List<HospitalsModel> projectsListLocal = [];
clinicIds = List.empty();
List<ListClinicCentralized> clinicId = [];
try {
Map res = await service.getClinicByHospital(
projectID: newValue?.mainProjectID.toString() ?? "");
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
List list = res['ListClinic'];
if (list.isEmpty) {
AppToast.showErrorToast(
message: TranslationBase.of(context).NoClinicFound,
);
}
res['ListClinic'].forEach((v) {
clinicId.add(ListClinicCentralized.fromJson(v));
});
clinicIds = clinicId;
setState(() {});
} else {
AppToast.showErrorToast(
message: TranslationBase.of(context).NoClinicFound,
);
}
} catch (e) {
print("the error is $e");
AppToast.showErrorToast(
message: TranslationBase.of(context).NoClinicFound,
);
GifLoaderDialogUtils.hideDialog(context);
}
}
}

@ -44,7 +44,7 @@ class ResultByFacility extends StatelessWidget {
if (patientDoctorAppointmentListHospital
.registeredDoctorMap?[selectedRegion]?.hmcSize ==
0) return;
onFacilitySelected(false);
onFacilitySelected(true);
},
child: HospitalTitle(
iconUrl: 'assets/images/svg/HMC.svg',
@ -108,23 +108,24 @@ class HospitalTitle extends StatelessWidget {
children: [
Text(
isHMC
? "${TranslationBase.of(context).hmcHospitalCount.replaceAll("@", itemCount)}"
: "${TranslationBase.of(context).hmgHospitalCount.replaceAll("@", itemCount)}",
? "${TranslationBase.of(context).MedicalCenterString(num.parse(itemCount)).replaceAll("@", itemCount)}"
: "${TranslationBase.of(context).HospitalString(num.parse(itemCount)).replaceAll("@", itemCount)}",
style: TextStyle(
fontSize: 12,
color: Colors.black,
fontWeight: FontWeight.w600),
),
Visibility(
visible: nearest != double.infinity,
visible: nearest != double.infinity &&
nearest != "0" &&
nearest != 0,
child: Row(
children: [
SizedBox(
width: 8,
),
Icon(
Icons.location_on,
color: Colors.black,
SvgPicture.asset(
'assets/images/svg/location.svg',
),
SizedBox(
width: 8,

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResp
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
typedef OnHospitalSelected = Function(String, int);
@ -118,9 +119,8 @@ class HospitalBodyWidget extends StatelessWidget {
"0"),
child: Row(
children: [
Icon(
Icons.location_on,
color: Colors.black,
SvgPicture.asset(
'assets/images/svg/location.svg',
),
SizedBox(
width: 8,

@ -3,6 +3,8 @@ import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
typedef OnRegionSelected = Function(String);
class ResultByRegion extends StatelessWidget {
List<DoctorList> doctorsList = [];
@ -98,19 +100,35 @@ class RegionTitle extends StatelessWidget {
),
Row(
children: [
Text(
"${TranslationBase.of(context).hmgHospitalCount.replaceAll("@", hmgCount)} ,",
style: TextStyle(
SvgPicture.asset(
'assets/images/svg/HMG.svg',
width: 10,
height: 10,
),
SizedBox(
width: 8,
),
Text(
"${TranslationBase.of(context).HospitalString(num.parse(hmgCount)).replaceAll("@", hmgCount)} ,",
style: TextStyle(
fontSize: 14,
color: Color(0xFFD02127),
fontWeight: FontWeight.w600),
),
SizedBox(
SizedBox(
width: 8,
),
SvgPicture.asset(
'assets/images/svg/HMC.svg',
width: 10,
height: 10,
),
SizedBox(
width: 8,
),
Text(
"${TranslationBase.of(context).hmcHospitalCount.replaceAll("@", hmcCount)}",
style: TextStyle(
"${TranslationBase.of(context).MedicalCenterString(num.parse(hmcCount)).replaceAll("@", hmcCount)}",
style: TextStyle(
fontSize: 14,
color: Color(0xFF40ACC9),
fontWeight: FontWeight.w600),

@ -25,13 +25,17 @@ class SearchResultWithTab extends StatefulWidget {
OBGyneProcedureListResponse? obGyneProcedureListResponse;
bool isDoctorSearchResult;
bool isForHospital;
SearchResultWithTab({required this.doctorsList,
required this.patientDoctorAppointmentListHospital,
this.isObGyneAppointment = false,
this.isDoctorNameSearch = false,
required this.isLiveCareAppointment,
required this.isDoctorSearchResult,
this.obGyneProcedureListResponse});
this.obGyneProcedureListResponse,
this.isForHospital = false,
});
@override
State<SearchResultWithTab> createState() => _SearchResultWithTabState();
@ -43,6 +47,7 @@ class _SearchResultWithTabState extends State<SearchResultWithTab> {
String selectedRegion = "";
bool isHMCSelected = false;
int selectedHospitalIndex = -1;
ScrollController scrollController = ScrollController();
@override
void initState() {
@ -52,6 +57,7 @@ class _SearchResultWithTabState extends State<SearchResultWithTab> {
changePageViewIndex(pageIndex) {
_controller.jumpToPage(pageIndex);
scrollController.jumpTo(pageIndex);
}
@ -74,10 +80,15 @@ class _SearchResultWithTabState extends State<SearchResultWithTab> {
Container(
width: double.infinity,
padding: EdgeInsets.only(left: 20, right: 20, top: 12),
child: Row(
children: [
Expanded(
child: showProgress(
child: SizedBox(
height: 100,
child: ListView(
scrollDirection: Axis.horizontal,
controller: scrollController,
children: [
SizedBox(
width: MediaQuery.of(context).size.width / 4,
child: showProgress(
title: TranslationBase.of(context).selectRegion,
status: _currentIndex == 0
? TranslationBase.of(context).inPrgress
@ -94,10 +105,12 @@ class _SearchResultWithTabState extends State<SearchResultWithTab> {
_currentIndex = 0;
changePageViewIndex(0);
});
}),
),
Expanded(
child: showProgress(
},
),
),
SizedBox(
width: MediaQuery.of(context).size.width / 4,
child: showProgress(
title: TranslationBase.of(context).selectFacitlity,
status: _currentIndex == 1
? TranslationBase.of(context).inPrgress
@ -115,10 +128,12 @@ class _SearchResultWithTabState extends State<SearchResultWithTab> {
_currentIndex = 1;
changePageViewIndex(1);
});
}),
),
Expanded(
child: showProgress(
},
),
),
SizedBox(
width: MediaQuery.of(context).size.width / 4,
child: showProgress(
title: TranslationBase.of(context).selectBranch,
status: _currentIndex == 2
? TranslationBase.of(context).inPrgress
@ -136,26 +151,60 @@ class _SearchResultWithTabState extends State<SearchResultWithTab> {
_currentIndex = 2;
changePageViewIndex(2);
});
}),
),
showProgress(
title: TranslationBase.of(context).selectDoctor,
status: _currentIndex == 3
? TranslationBase.of(context).inPrgress
: TranslationBase.of(context).locked,
color: _currentIndex == 3
? CustomColors.orange
: _currentIndex > 4
? CustomColors.green
: CustomColors.grey2,
isNeedBorder: false,
onTap: () {
setState(() {
_currentIndex = 3;
changePageViewIndex(3);
});
}),
],
},
),
),
(widget.isForHospital)
? SizedBox(
width: MediaQuery.of(context).size.width / 4,
child: showProgress(
title:
TranslationBase.of(context).selectClinic,
status: _currentIndex == 3
? TranslationBase.of(context).inPrgress
: TranslationBase.of(context).locked,
color: _currentIndex == 3
? CustomColors.orange
: _currentIndex > 4
? CustomColors.green
: CustomColors.grey2,
isNeedBorder: false,
onTap: () {
setState(() {
_currentIndex = 3;
changePageViewIndex(3);
});
},
),
)
: SizedBox.shrink(),
SizedBox(
width: MediaQuery.of(context).size.width / 4,
child: showProgress(
title: TranslationBase.of(context).selectDoctor,
status: _currentIndex ==
((widget.isForHospital) ? 4 : 3)
? TranslationBase.of(context).inPrgress
: TranslationBase.of(context).locked,
color: _currentIndex ==
((widget.isForHospital) ? 4 : 3)
? CustomColors.orange
: _currentIndex ==
((widget.isForHospital) ? 5 : 4)
? CustomColors.green
: CustomColors.grey2,
isNeedBorder: false,
onTap: () {
setState(() {
_currentIndex =
((widget.isForHospital) ? 4 : 3);
changePageViewIndex(_currentIndex);
});
},
),
),
],
),
),
),
mHeight(24),
@ -189,7 +238,7 @@ class _SearchResultWithTabState extends State<SearchResultWithTab> {
selectedRegion: selectedRegion,
onFacilitySelected: (isHMCSelected) {
setState(() {
isHMCSelected = isHMCSelected;
this.isHMCSelected = isHMCSelected;
_currentIndex = 2;
changePageViewIndex(2);
});
@ -200,12 +249,15 @@ class _SearchResultWithTabState extends State<SearchResultWithTab> {
paitientDoctorAppointmentList: (isHMCSelected) ?
widget.patientDoctorAppointmentListHospital
.registeredDoctorMap![selectedRegion]!
.hmgDoctorList ?? []
: widget.patientDoctorAppointmentListHospital
.registeredDoctorMap?[selectedRegion]
?.hmcDoctorList ?? [],
isHMCSelected: isHMCSelected,
isLiveCareAppointment: widget.isLiveCareAppointment,
.hmcDoctorList ??
[]
: widget
.patientDoctorAppointmentListHospital
.registeredDoctorMap?[selectedRegion]
?.hmgDoctorList ??
[],
isHMCSelected: isHMCSelected,
isLiveCareAppointment: widget.isLiveCareAppointment,
isDoctorSearchResult: widget.isDoctorSearchResult,
onHospitalSelected: (hospital, index) {
setState(() {
@ -218,7 +270,7 @@ class _SearchResultWithTabState extends State<SearchResultWithTab> {
(selectedRegion != '' && selectedHospitalIndex != -1)
? ResultByDoctor(
doctorsList: widget.doctorsList,
patientDoctorAppointmentListHospital: (isHMCSelected)
patientDoctorAppointmentListHospital: (!isHMCSelected)
? widget
.patientDoctorAppointmentListHospital
.registeredDoctorMap![selectedRegion]!
@ -470,10 +522,7 @@ class RegionTitle extends StatelessWidget {
Row(
children: [
Text(
"${TranslationBase
.of(context)
.hmgHospitalCount
.replaceAll("@", hmgCount)} ,",
"${TranslationBase.of(context).HospitalString(num.parse(hmgCount)).replaceAll("@", hmgCount)} ,",
style: TextStyle(
fontSize: 14,
color: Color(0xFFD02127),
@ -483,10 +532,7 @@ class RegionTitle extends StatelessWidget {
width: 8,
),
Text(
"${TranslationBase
.of(context)
.hmcHospitalCount
.replaceAll("@", hmcCount)}",
"${TranslationBase.of(context).MedicalCenterString(num.parse(hmcCount)).replaceAll("@", hmcCount)}",
style: TextStyle(
fontSize: 14,
color: Color(0xFF40ACC9),
@ -539,14 +585,8 @@ class HospitalTitle extends StatelessWidget {
),
Text(
isHMC
? "${TranslationBase
.of(context)
.hmcHospitalCount
.replaceAll("@", itemCount)}"
: "${TranslationBase
.of(context)
.hmgHospitalCount
.replaceAll("@", itemCount)}",
? "${TranslationBase.of(context).MedicalCenterString(num.parse(itemCount)).replaceAll("@", itemCount)}"
: "${TranslationBase.of(context).HospitalString(num.parse(itemCount)).replaceAll("@", itemCount)}",
style: TextStyle(
fontSize: 12, color: Colors.black, fontWeight: FontWeight.w600),
),

@ -0,0 +1,701 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByClinic.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByDoctors.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByFacility.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByHospital.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByRegion.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class SearchResultWithTabForHospital extends StatefulWidget {
List<DoctorList> doctorsList = [];
RegionList patientDoctorAppointmentListHospital;
bool isLiveCareAppointment;
bool isObGyneAppointment;
bool isDoctorNameSearch;
OBGyneProcedureListResponse? obGyneProcedureListResponse;
bool isDoctorSearchResult;
bool isForHospital;
SearchResultWithTabForHospital({
required this.doctorsList,
required this.patientDoctorAppointmentListHospital,
this.isObGyneAppointment = false,
this.isDoctorNameSearch = false,
required this.isLiveCareAppointment,
required this.isDoctorSearchResult,
this.obGyneProcedureListResponse,
this.isForHospital = true,
});
@override
State<SearchResultWithTabForHospital> createState() =>
_SearchResultWithTabForHospitalState();
}
class _SearchResultWithTabForHospitalState
extends State<SearchResultWithTabForHospital> {
int _currentIndex = 0;
late PageController _controller;
String selectedRegion = "";
HospitalsModel? selectedHospital;
bool isHMCSelected = false;
int selectedHospitalIndex = -1;
ScrollController scrollController = ScrollController();
RegionList? doctorList;
@override
void initState() {
super.initState();
_controller = new PageController();
}
changePageViewIndex(pageIndex) {
_controller.jumpToPage(pageIndex);
scrollController.jumpTo(pageIndex.toDouble());
}
@override
Widget build(BuildContext context) {
return SizedBox(
child: widget.patientDoctorAppointmentListHospital.registeredDoctorMap
?.isNotEmpty ==
true
? SizedBox(
height: SizeConfig.realScreenHeight! * .9,
width: SizeConfig.realScreenWidth,
child: Column(children: <Widget>[
Container(
width: double.infinity,
padding: EdgeInsets.only(left: 20, right: 20, top: 12),
child: SizedBox(
height: 100,
child: ListView(
scrollDirection: Axis.horizontal,
controller: scrollController,
children: [
SizedBox(
width: MediaQuery.of(context).size.width / 4,
child: showProgress(
title: TranslationBase.of(context).selectRegion,
status: _currentIndex == 0
? TranslationBase.of(context).inPrgress
: _currentIndex > 0
? TranslationBase.of(context).completed
: TranslationBase.of(context).locked,
color: _currentIndex == 0
? CustomColors.orange
: CustomColors.green,
onTap: () {
setState(() {
selectedHospitalIndex = -1;
selectedRegion = "";
doctorList = null;
_currentIndex = 0;
changePageViewIndex(0);
});
},
),
),
SizedBox(
width: MediaQuery.of(context).size.width / 4,
child: showProgress(
title: TranslationBase.of(context).selectFacitlity,
status: _currentIndex == 1
? TranslationBase.of(context).inPrgress
: _currentIndex > 1
? TranslationBase.of(context).completed
: TranslationBase.of(context).locked,
color: _currentIndex == 1
? CustomColors.orange
: _currentIndex > 1
? CustomColors.green
: CustomColors.grey2,
onTap: () {
setState(() {
selectedHospitalIndex = -1;
doctorList = null;
_currentIndex = 1;
changePageViewIndex(1);
});
},
),
),
SizedBox(
width: MediaQuery.of(context).size.width / 4,
child: showProgress(
title: TranslationBase.of(context).selectBranch,
status: _currentIndex == 2
? TranslationBase.of(context).inPrgress
: _currentIndex > 1
? TranslationBase.of(context).completed
: TranslationBase.of(context).locked,
color: _currentIndex == 2
? CustomColors.orange
: _currentIndex > 2
? CustomColors.green
: CustomColors.grey2,
onTap: () {
setState(() {
selectedHospitalIndex = -1;
doctorList = null;
_currentIndex = 2;
changePageViewIndex(2);
});
},
),
),
SizedBox(
width: MediaQuery.of(context).size.width / 4,
child: showProgress(
title: TranslationBase.of(context).selectClinic,
status: _currentIndex == 3
? TranslationBase.of(context).inPrgress
: _currentIndex > 3
? TranslationBase.of(context).completed
: TranslationBase.of(context).locked,
color: _currentIndex == 3
? CustomColors.orange
: _currentIndex > 3
? CustomColors.green
: CustomColors.grey2,
onTap: () {
setState(() {
_currentIndex = 3;
doctorList = null;
changePageViewIndex(3);
});
},
),
),
SizedBox(
width: MediaQuery.of(context).size.width / 4,
child: showProgress(
title: TranslationBase.of(context).selectDoctor,
status: _currentIndex ==
((widget.isForHospital) ? 4 : 3)
? TranslationBase.of(context).inPrgress
: TranslationBase.of(context).locked,
color: _currentIndex ==
((widget.isForHospital) ? 4 : 3)
? CustomColors.orange
: _currentIndex ==
((widget.isForHospital) ? 5 : 4)
? CustomColors.green
: CustomColors.grey2,
isNeedBorder: false,
onTap: () {
setState(() {
_currentIndex =
((widget.isForHospital) ? 4 : 3);
changePageViewIndex(_currentIndex);
});
},
),
),
],
),
),
),
mHeight(24),
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
ResultByRegion(
doctorsList: widget.doctorsList,
patientDoctorAppointmentListHospital:
widget.patientDoctorAppointmentListHospital,
onRegionSelected: (key) {
setState(() {
selectedRegion = key;
_currentIndex = 1;
changePageViewIndex(1);
});
}),
(selectedRegion != "")
? ResultByFacility(
doctorsList: widget.doctorsList,
patientDoctorAppointmentListHospital:
widget.patientDoctorAppointmentListHospital,
selectedRegion: selectedRegion,
onFacilitySelected: (isHMCSelected) {
setState(() {
this.isHMCSelected = isHMCSelected;
_currentIndex = 2;
changePageViewIndex(2);
});
},
)
: SizedBox.shrink(),
(selectedRegion != '')
? ResultByHospital(
doctorsList: widget.doctorsList,
paitientDoctorAppointmentList: (isHMCSelected)
? widget
.patientDoctorAppointmentListHospital
.registeredDoctorMap![selectedRegion]!
.hmcDoctorList ??
[]
: widget
.patientDoctorAppointmentListHospital
.registeredDoctorMap?[selectedRegion]
?.hmgDoctorList ??
[],
isHMCSelected: isHMCSelected,
isLiveCareAppointment:
widget.isLiveCareAppointment,
isDoctorSearchResult: widget.isDoctorSearchResult,
onHospitalSelected: (hospitalName, index) {
setState(() {
selectedHospitalIndex = index;
selectedHospital = (!isHMCSelected)
? widget
.patientDoctorAppointmentListHospital
.registeredDoctorMap![selectedRegion]!
.hmgDoctorList![selectedHospitalIndex]
.hospitalList
.first
: widget
.patientDoctorAppointmentListHospital
.registeredDoctorMap![selectedRegion]!
.hmcDoctorList![selectedHospitalIndex]
.hospitalList
.first;
_currentIndex = 3;
changePageViewIndex(3);
});
})
: SizedBox.shrink(),
(selectedHospital != null &&
selectedRegion != '' &&
selectedHospitalIndex != -1)
? ResultByClinic(
onClinicSelected: (doctorList) {
setState(() {
this.doctorList = doctorList;
_currentIndex = 4;
changePageViewIndex(4);
});
},
selectedValue: selectedHospital)
: SizedBox.shrink(),
(selectedRegion != '' &&
selectedHospitalIndex != -1 &&
doctorList != null)
? ResultByDoctor(
doctorsList: widget.doctorsList,
patientDoctorAppointmentListHospital:
(!isHMCSelected)
? doctorList!
.registeredDoctorMap![
selectedRegion]!
.hmgDoctorList!
.first
.patientDoctorAppointmentList ??
[]
: doctorList!
.registeredDoctorMap?[
selectedRegion]
?.hmcDoctorList!
.first
.patientDoctorAppointmentList ??
[],
isLiveCareAppointment:
widget.isLiveCareAppointment,
isDoctorSearchResult: widget.isDoctorSearchResult,
isObGyneAppointment: widget.isObGyneAppointment,
isDoctorNameSearch: widget.isDoctorNameSearch)
: SizedBox.shrink(),
],
),
),
]),
)
: getNoDataWidget(context),
);
}
String getTitle() {
switch (_currentIndex) {
case 0:
return TranslationBase.of(context).selectRegion;
case 1:
return TranslationBase.of(context).selectFacitlity;
case 2:
return TranslationBase.of(context).selectBranch;
case 3:
return TranslationBase.of(context).selectClinic;
case 4:
return TranslationBase.of(context).selectDoctor;
}
return "";
}
Widget showProgress(
{String? title,
String? status,
Color? color,
bool isNeedBorder = true,
Function()? onTap}) {
return InkWell(
onTap: () {
if (status == TranslationBase.of(context).completed) {
onTap?.call();
}
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
width: 26,
height: 26,
decoration: containerRadius(color!, 200),
child: Icon(
Icons.done,
color: Colors.white,
size: 16,
),
),
if (isNeedBorder)
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: mDivider(Colors.grey),
)),
],
),
mHeight(8),
Text(
title!,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
letterSpacing: -0.44,
),
),
mHeight(2),
Container(
padding: EdgeInsets.all(5),
decoration: containerRadius(color!.withOpacity(0.2), 4),
child: Text(
status!,
style: TextStyle(
fontSize: 8,
fontWeight: FontWeight.w600,
letterSpacing: -0.32,
color: color,
),
),
),
],
)
],
),
);
}
}
class HospitalBodyWidget extends StatelessWidget {
final List<PatientDoctorAppointmentList>?
patientDoctorAppointmentListHospital;
final bool isLiveCareAppointment;
final bool isObGyneAppointment;
final bool isDoctorNameSearch;
final bool isDoctorSearchResult;
final OBGyneProcedureListResponse? obGyneProcedureListResponse;
const HospitalBodyWidget({
super.key,
this.patientDoctorAppointmentListHospital,
required this.isLiveCareAppointment,
required this.isObGyneAppointment,
required this.isDoctorNameSearch,
required this.isDoctorSearchResult,
this.obGyneProcedureListResponse,
});
@override
Widget build(BuildContext context) {
return ListView.separated(
addAutomaticKeepAlives: true,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: patientDoctorAppointmentListHospital?.length ?? 0,
separatorBuilder: (context, index) {
return Container(
height: 12,
margin: EdgeInsets.only(left: 21, right: 21),
);
},
itemBuilder: (context, index) {
return AppExpandableNotifier(
applyBackgroundColor: false,
widgetColor: CustomColors.appBackgroudGrey2Color,
title: (patientDoctorAppointmentListHospital?[index].distanceInKMs !=
"0")
? patientDoctorAppointmentListHospital![index].filterName! +
" - " +
patientDoctorAppointmentListHospital![index].distanceInKMs! +
" " +
TranslationBase.of(context).km
: patientDoctorAppointmentListHospital![index].filterName,
projectTitleTop:
patientDoctorAppointmentListHospital![index].projectTopName,
projectTitleBottom: (patientDoctorAppointmentListHospital![index]
.distanceInKMs !=
"0")
? patientDoctorAppointmentListHospital![index]
.projectBottomName
.toString() +
" - " +
patientDoctorAppointmentListHospital![index].distanceInKMs! +
" " +
TranslationBase.of(context).km
: patientDoctorAppointmentListHospital![index]
.projectBottomName
.toString(),
isTitleSingleLine: false,
isDoctorSearchResult: isDoctorSearchResult,
isExpand:
patientDoctorAppointmentListHospital?.length == 1 ? true : false,
bodyWidget: ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
padding:
EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21),
itemBuilder: (context, _index) {
// print("the index of patientDoctorAppointmentList is ${_index}");
// print("the index of parent is ${index}");
final doctor = patientDoctorAppointmentListHospital![index]
.patientDoctorAppointmentList![_index];
// print('the doctor is ${doctor.toJson()}');
return DoctorView(
doctor: doctor,
isLiveCareAppointment: isLiveCareAppointment,
isObGyneAppointment: isObGyneAppointment,
isDoctorNameSearch: isDoctorNameSearch,
obGyneProcedureListResponse: obGyneProcedureListResponse,
isShowDate: false,
onTap: () {
context
.read<ProjectViewModel>()
.analytics
.appointment
.book_appointment_select_doctor(
appointment_type: 'regular', doctor: doctor);
});
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: patientDoctorAppointmentListHospital?[index]
.patientDoctorAppointmentList
?.length ??
0),
);
},
);
}
}
class RegionTitle extends StatelessWidget {
final String title;
final String hmcCount;
final String hmgCount;
const RegionTitle(
{super.key,
required this.title,
required this.hmcCount,
required this.hmgCount});
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontSize: 22, color: Colors.black, fontWeight: FontWeight.w700),
),
SizedBox(
height: 8,
),
Row(
children: [
Text(
"${TranslationBase.of(context).HospitalString(num.parse(hmgCount)).replaceAll("@", hmgCount)} ,",
style: TextStyle(
fontSize: 14,
color: Color(0xFFD02127),
fontWeight: FontWeight.w600),
),
SizedBox(
width: 8,
),
Text(
"${TranslationBase.of(context).MedicalCenterString(num.parse(hmcCount)).replaceAll("@", hmcCount)}",
style: TextStyle(
fontSize: 14,
color: Color(0xFF40ACC9),
fontWeight: FontWeight.w600),
),
],
),
],
),
);
}
}
class HospitalTitle extends StatelessWidget {
final String title;
final String iconUrl;
final bool isHMC;
final String itemCount;
const HospitalTitle(
{super.key,
required this.title,
required this.iconUrl,
required this.isHMC,
required this.itemCount});
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
SvgPicture.asset(iconUrl),
SizedBox(
width: 8,
),
Text(
title,
style: TextStyle(
fontSize: 18,
color: isHMC ? Color(0xFF40ACC9) : Color(0xFFD02127),
fontWeight: FontWeight.w600),
),
],
),
SizedBox(
height: 6,
),
Text(
isHMC
? "${TranslationBase.of(context).MedicalCenterString(num.parse(itemCount)).replaceAll("@", itemCount)}"
: "${TranslationBase.of(context).HospitalString(num.parse(itemCount)).replaceAll("@", itemCount)}",
style: TextStyle(
fontSize: 12, color: Colors.black, fontWeight: FontWeight.w600),
),
],
),
);
}
}
///todo the current content of the application
/// return AppExpandableNotifier(
// paddingValue: 10,
// applyBackgroundToOnlyHeader: true,
// completeHeaderColor: CustomColors.appBackgroudGrey2Color,
// headerWidget: RegionTitle(
// title: key,
// hmcCount:
// "${widget.patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmcSize ?? 0}",
// hmgCount:
// "${widget.patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmgSize ?? 0}",
// ),
// showDropDownIconWithCustomHeader: true,
// isTitleSingleLine: false,
// isDoctorSearchResult: widget.isDoctorSearchResult,
// widgetColor: Color(0xFFF8F8F8),
// bodyWidget: Column(
// children: [
// Padding(
// padding: const EdgeInsets.all(8.0),
// child: AppExpandableNotifier(
// paddingValue: 8,
// applyBackgroundColor: false,
// applyBackgroundToOnlyHeader: true,
// completeHeaderColor: Colors.white,
// headerRadius: BorderRadius.circular(16),
// headerWidget: HospitalTitle(
// iconUrl: 'assets/images/svg/HMG.svg',
// title: TranslationBase.of(context).hmgHospital,
// isHMC: false,
// itemCount:
// "${widget.patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmgSize ?? 0}",
// ),
// showDropDownIconWithCustomHeader: true,
// bodyWidget: HospitalBodyWidget(
// patientDoctorAppointmentListHospital:
// widget.patientDoctorAppointmentListHospital
// .registeredDoctorMap?[key]?.hmgDoctorList,
// isLiveCareAppointment: widget.isLiveCareAppointment,
// isObGyneAppointment: widget.isObGyneAppointment,
// isDoctorNameSearch: widget.isDoctorNameSearch,
// isDoctorSearchResult: widget.isDoctorSearchResult,
// ),
// ),
// ),
// Padding(
// padding: const EdgeInsets.only(
// bottom: 8.0, left: 8, right: 8),
// child: AppExpandableNotifier(
// paddingValue: 8,
// applyBackgroundColor: false,
// applyBackgroundToOnlyHeader: true,
// completeHeaderColor: Colors.white,
// headerRadius: BorderRadius.circular(16),
// headerWidget: HospitalTitle(
// iconUrl: 'assets/images/svg/HMC.svg',
// title: TranslationBase.of(context).hmcHospital,
// isHMC: true,
// itemCount:
// "${widget.patientDoctorAppointmentListHospital.registeredDoctorMap?[key]?.hmcSize ?? 0}",
// ),
// showDropDownIconWithCustomHeader: true,
// bodyWidget: HospitalBodyWidget(
// patientDoctorAppointmentListHospital:
// widget.patientDoctorAppointmentListHospital
// .registeredDoctorMap?[key]?.hmcDoctorList,
// isLiveCareAppointment: widget.isLiveCareAppointment,
// isObGyneAppointment: widget.isObGyneAppointment,
// isDoctorNameSearch: widget.isDoctorNameSearch,
// isDoctorSearchResult: widget.isDoctorSearchResult,
// ),
// ),
// ),
// ],
// ));

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
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/appointment_services/doctor_response_mapper.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -16,8 +17,15 @@ class DentalComplaintCard extends StatefulWidget {
var languageID;
Function? onSelectedMethod;
bool isDoctorNameSearch;
bool isFromHospitalSearchPage;
Function(RegionList)? onDoctorFetched;
DentalComplaintCard({required this.listDentalChiefComplain, this.languageID, this.onSelectedMethod, this.isDoctorNameSearch = false});
DentalComplaintCard({required this.listDentalChiefComplain,
this.languageID,
this.onSelectedMethod,
this.isDoctorNameSearch = false,
this.isFromHospitalSearchPage = false,
this.onDoctorFetched});
@override
_DentalComplaintCardState createState() => _DentalComplaintCardState();
@ -33,6 +41,9 @@ class _DentalComplaintCardState extends State<DentalComplaintCard> {
// if(widget.isDoctorNameSearch) {
// widget.onSelectedMethod();
// } else {
// if (widget.isFromHospitalSearchPage) {
// getChiefComplaintsDoctorMappedList();
// } else
getChiefComplaintsList();
// }
},
@ -110,4 +121,41 @@ class _DentalComplaintCardState extends State<DentalComplaintCard> {
Future navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) async {
Navigator.push(context, FadePage(page: SearchResults(doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital, isLiveCareAppointment: false, isDoctorSearchResult: true,)));
}
void getChiefComplaintsDoctorMappedList() {
var isArabic = context.read<ProjectViewModel>().isArabic;
int languageID =
Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =
[];
GifLoaderDialogUtils.showMyDialog(context);
ClinicListService service = new ClinicListService();
service
.getChiefComplaintDoctorList(widget.listDentalChiefComplain!.iD!,
widget.listDentalChiefComplain.projectID!, languageID, context)
.then((res) async {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
RegionList regionHospitalList = RegionList();
print(res['List_DentalDoctorChiefComplaintMapping']);
setState(() async {
doctorsList.clear();
res['List_DentalDoctorChiefComplaintMapping'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
regionHospitalList = await DoctorMapper.getMappedDoctor(doctorsList,
isArabic: isArabic);
widget.onDoctorFetched?.call(regionHospitalList);
});
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
}

@ -1,6 +1,7 @@
import 'dart:math';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -117,4 +118,92 @@ class DoctorMapper{
unsorted.registeredDoctorMap = sortedMap;
return unsorted;
}
static Future<RegionList> getMappedHospitals(
List<HospitalsModel> hospitalList, {
bool isArabic = false,
}) async {
final regionList = RegionList();
final sharedPref = AppSharedPreferences();
for (final hospital in hospitalList) {
final region = hospital.getRegionName(isArabic);
if (region == null) continue;
final regionData = regionList.registeredDoctorMap?.putIfAbsent(
region,
() => PatientDoctorAppointmentListByRegion(),
);
List<PatientDoctorAppointmentList>? targetList = hospital.isHMC == true
? regionData?.hmcDoctorList
: regionData?.hmgDoctorList;
List<PatientDoctorAppointmentList> existingEntry = targetList
?.where(
(entry) => entry.filterName == hospital.legalName,
)
.toList() ??
[];
if (existingEntry.isNotEmpty) {
existingEntry.first.hospitalList.add(hospital);
} else {
final newEntry = PatientDoctorAppointmentList(
filterName: hospital.legalName,
distanceInKMs: hospital.distanceInKilometers?.toString(),
projectTopName: hospital.name,
projectBottomName: hospital.legalName,
model: hospital);
final distance = hospital.distanceInKilometers;
if (distance != null) {
if (regionData!.distance > distance) {
regionData.distance = distance;
}
if (hospital.isHMC == true && distance < regionData.hmcDistance) {
regionData.hmcDistance = distance;
} else if (distance < regionData.hmgDistance) {
regionData.hmgDistance = distance;
}
} else if (await sharedPref.getDouble(USER_LAT) != null &&
await sharedPref.getDouble(USER_LONG) != null &&
hospital.latitude != null &&
hospital.longitude != null) {
final lat = await sharedPref.getDouble(USER_LAT);
final long = await sharedPref.getDouble(USER_LONG);
double calculatedDistance = calculateDistance(
lat,
long,
double.parse(hospital.latitude!),
double.parse(hospital.longitude!),
).abs();
if (regionData!.distance > calculatedDistance) {
regionData.distance = calculatedDistance;
}
if (hospital.isHMC == true &&
calculatedDistance < regionData.hmcDistance) {
regionData.hmcDistance = calculatedDistance;
} else if (calculatedDistance < regionData.hmgDistance) {
regionData.hmgDistance = calculatedDistance;
}
print("Calculated distance: $calculatedDistance");
}
targetList?.add(newEntry);
}
regionData?.hmcSize = regionData.hmcDoctorList?.length ?? 0;
regionData?.hmgSize = regionData.hmgDoctorList?.length ?? 0;
regionList.registeredDoctorMap?[region] = regionData;
}
return regionList;
}
}

@ -3273,12 +3273,36 @@ class TranslationBase {
String get selectDoctor => localizedValues["selectDoctor"][locale.languageCode];
String get hmgHospital => localizedValues["hmgHospital"][locale.languageCode];
String get hmcHospital => localizedValues["hmcHospital"][locale.languageCode];
String get hmcHospitalCount => localizedValues["hmcHospitalCount"][locale.languageCode];
String get hmgHospitalCount => localizedValues["hmgHospitalCount"][locale.languageCode];
String get hmcHospitalCountSingle =>
localizedValues["hmcHospitalCountSingle"][locale.languageCode];
String get hmgHospitalCountSingle =>
localizedValues["hmgHospitalCountSingle"][locale.languageCode];
String get hmcHospitalCountPlural =>
localizedValues["hmcHospitalCountPlural"][locale.languageCode];
String get hmgHospitalCountPlural =>
localizedValues["hmgHospitalCountPlural"][locale.languageCode];
String get nearest => localizedValues["nearest"][locale.languageCode];
String get kilometerUnit =>
localizedValues["kilometerUnit"][locale.languageCode];
String HospitalString(num value) {
if (value == 1 || value == 0)
return localizedValues["hmgHospitalCountSingle"][locale
.languageCode]; else
return localizedValues["hmgHospitalCountPlural"][locale.languageCode];
}
String MedicalCenterString(num value) {
if (value == 1 || value == 0)
return localizedValues["hmcHospitalCountSingle"][locale
.languageCode]; else
return localizedValues["hmcHospitalCountPlural"][locale.languageCode];
}
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save