WIP: doctor list by region

merge-update-with-lab-changes
taha.alam 11 months ago
parent c72892b1a6
commit cd460ee31b

@ -0,0 +1,9 @@
<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>

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -0,0 +1,12 @@
<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>

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -21,8 +21,8 @@ var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/';
// var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_URL = 'https://hmgwebservices.com/';
var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/';

@ -2140,4 +2140,8 @@ const Map localizedValues = {
"download": {"en": "Download", "ar": "تحميل"},
"share": {"en": "Share", "ar": "يشارك"},
"hmgHospital": {"en": "HMG Hospital", "ar": "مستشفى HMG"},
"hmcHospital": {"en": "HMC Hospital", "ar": "مستشفى HMC"},
"hmcHospitalCount": {"en": "@ HMC Hospital", "ar": "@ مستشفى HMC"},
"hmgHospitalCount": {"en": "@ HMG Hospital", "ar": "@ مستشفى HMC"},
};

@ -46,6 +46,9 @@ class DoctorList {
dynamic decimalDoctorRate;
String? projectBottomName;
String? projectTopName;
bool? isHMC;
String? region;
String? regionID;
DoctorList(
{this.clinicID,
@ -94,9 +97,14 @@ class DoctorList {
this.workingHours,
this.decimalDoctorRate,
this.projectBottomName,
this.projectTopName});
this.projectTopName,
this.isHMC,
this.region,
this.regionID,
});
DoctorList.fromJson(Map<String, dynamic> json) {
DoctorList.fromJson(Map<String, dynamic> json,
{String region = '', bool isHMC = false}) {
clinicID = json['ClinicID'];
appointmentNo = json['AppointmentNo'];
clinicName = json['ClinicName'];
@ -144,6 +152,8 @@ class DoctorList {
decimalDoctorRate = json['DecimalDoctorRate'];
projectBottomName = json['ProjectNameBottom'];
projectTopName = json['ProjectNameTop'];
this.isHMC = isHMC;
this.region = region;
}
Map<String, dynamic> toJson() {
@ -211,3 +221,164 @@ class PatientDoctorAppointmentList {
patientDoctorAppointmentList!.add(patientDoctorAppointment!);
}
}
// class PatientDoctorAppointmentListByRegion {
// String? filterName = "";
// String? distanceInKMs = "";
// List<DoctorList>? hmgDoctorList = [];
// List<DoctorList>? hmcDoctorList = [];
// String? projectTopName = "";
// String? projectBottomName = "";
//
// PatientDoctorAppointmentListByRegion({this.filterName, this.distanceInKMs, this.projectTopName, this.projectBottomName, DoctorList? hmcPatientDoctorAppointment, DoctorList? hmgPatientDoctorAppointment}) {
// hmcDoctorList!.add(hmcPatientDoctorAppointment!);
// hmgDoctorList!.add(hmgPatientDoctorAppointment!);
// }
// }
class PatientDoctorAppointmentListByRegion {
List<PatientDoctorAppointmentList>? hmgDoctorList = [];
List<PatientDoctorAppointmentList>? hmcDoctorList = [];
}
class RegionList {
Map<String, PatientDoctorAppointmentListByRegion?>? registeredDoctorMap;
}
/// dummy data
///
///
DoctorList doctor1 = DoctorList(
clinicID: 101,
appointmentNo: 12345,
clinicName: "Downtown Clinic",
doctorTitle: "Dr.",
iD: 1,
name: "John Doe",
projectID: 301,
projectName: "HealthCare Network",
actualDoctorRate: 500,
clinicRoomNo: 2,
date: "2025-01-10",
appointmentDate: "2025-01-15T10:00:00",
dayName: "Monday",
doctorID: 11,
doctorImageURL: "https://example.com/images/johndoe.jpg",
doctorProfile: null,
doctorProfileInfo: null,
doctorRate: 4,
gender: 1,
genderDescription: "Male",
isAppointmentAllowed: true,
isDoctorAllowVedioCall: false,
isDoctorDummy: false,
isLiveCare: true,
isLiveCareClinic: false,
isDoctorHasPrePostImages: true,
latitude: "24.7136",
longitude: "46.6753",
nationalityFlagURL: "https://example.com/images/flags/sa.png",
nationalityID: "SA",
nationalityName: "Saudi Arabia",
nearestFreeSlot: "2025-01-15T10:00:00",
noOfPatientsRate: 50,
originalClinicID: 102,
personRate: 4.5,
projectDistanceInKiloMeters: 5.0,
qR: "QR123",
qRString: "abcd1234",
rateNumber: 120,
serviceID: null,
setupID: "Setup001",
speciality: ["Cardiology", "Internal Medicine"],
specialityN: ["Cardiology"],
workingHours: "8 AM - 5 PM",
decimalDoctorRate: 4.5,
projectBottomName: "HealthCare Bottom",
projectTopName: "HealthCare Top",
isHMC: false,
region: "Riyadh",
);
DoctorList doctor2 = DoctorList(
clinicID: 102,
appointmentNo: 67890,
clinicName: "City Medical Center",
doctorTitle: "Dr.",
iD: 2,
name: "Jane Smith",
projectID: 302,
projectName: "MedicalGroup Network",
actualDoctorRate: 450,
clinicRoomNo: 5,
date: "2025-01-12",
appointmentDate: "2025-01-16T09:00:00",
dayName: "Wednesday",
doctorID: 12,
doctorImageURL: "https://example.com/images/janesmith.jpg",
doctorProfile: null,
doctorProfileInfo: null,
doctorRate: 5,
gender: 2,
genderDescription: "Female",
isAppointmentAllowed: true,
isDoctorAllowVedioCall: true,
isDoctorDummy: false,
isLiveCare: false,
isLiveCareClinic: true,
isDoctorHasPrePostImages: false,
latitude: "24.7742",
longitude: "46.7387",
nationalityFlagURL: "https://example.com/images/flags/us.png",
nationalityID: "US",
nationalityName: "United States",
nearestFreeSlot: "2025-01-16T09:00:00",
noOfPatientsRate: 70,
originalClinicID: 103,
personRate: 4.8,
projectDistanceInKiloMeters: 8.0,
qR: "QR567",
qRString: "efgh5678",
rateNumber: 200,
serviceID: null,
setupID: "Setup002",
speciality: ["Dermatology", "Cosmetic Surgery"],
specialityN: ["Dermatology"],
workingHours: "9 AM - 6 PM",
decimalDoctorRate: 4.8,
projectBottomName: "MedicalGroup Bottom",
projectTopName: "MedicalGroup Top",
isHMC: true,
region: "Riyadh",
);
// Dummy data for PatientDoctorAppointmentList
PatientDoctorAppointmentList patientList1 = PatientDoctorAppointmentList(
filterName: "Aryan",
distanceInKMs: "0",
projectTopName: "HealthCare",
projectBottomName: "Center",
patientDoctorAppointment: doctor1,
);
PatientDoctorAppointmentList patientList2 = PatientDoctorAppointmentList(
filterName: "Aryan",
distanceInKMs: "0",
projectTopName: "MedicalGroup",
projectBottomName: "Clinic",
patientDoctorAppointment: doctor2,
);
// Dummy data for PatientDoctorAppointmentListByRegion
PatientDoctorAppointmentListByRegion region1 =
PatientDoctorAppointmentListByRegion()
..hmgDoctorList = [patientList1]
..hmcDoctorList = [patientList2];
// Dummy data for RegionList
RegionList regionList = RegionList()
..registeredDoctorMap = {
"Region1": region1,
"Region2": region1,
};

@ -0,0 +1,268 @@
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/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:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class SearchResultsByRegion extends StatelessWidget {
List<DoctorList> doctorsList = [];
RegionList patientDoctorAppointmentListHospital;
bool isLiveCareAppointment;
bool isObGyneAppointment;
bool isDoctorNameSearch;
OBGyneProcedureListResponse? obGyneProcedureListResponse;
bool isDoctorSearchResult;
SearchResultsByRegion(
{required this.doctorsList,
required this.patientDoctorAppointmentListHospital,
this.isObGyneAppointment = false,
this.isDoctorNameSearch = false,
required this.isLiveCareAppointment,
required this.isDoctorSearchResult,
this.obGyneProcedureListResponse});
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
isShowDecPage: false,
isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: patientDoctorAppointmentListHospital
.registeredDoctorMap?.isNotEmpty ==
true
? ListView.separated(
addAutomaticKeepAlives: true,
physics: BouncingScrollPhysics(),
separatorBuilder: (context, index) {
return Container(
height: 12,
margin: EdgeInsets.only(left: 21, right: 21),
);
},
itemBuilder: (context, index) {
String key = patientDoctorAppointmentListHospital
.registeredDoctorMap?.keys
.toList()[index] ??
'';
return AppExpandableNotifier(
title: key,
isTitleSingleLine: false,
isDoctorSearchResult: isDoctorSearchResult,
bodyWidget: Column(
children: [
AppExpandableNotifier(
headerWidget: HospitalTitle(
iconUrl: 'assets/images/svg/HMG.svg',
title: TranslationBase.of(context).hmgHospital,
isHMC: false,
),
showDropDownIconWithCustomHeader: true,
bodyWidget: HospitalBodyWidget(
patientDoctorAppointmentListHospital:
patientDoctorAppointmentListHospital
.registeredDoctorMap?[key]?.hmgDoctorList,
isLiveCareAppointment: isLiveCareAppointment,
isObGyneAppointment: isObGyneAppointment,
isDoctorNameSearch: isDoctorNameSearch,
isDoctorSearchResult: isDoctorSearchResult,
),
),
SizedBox(
height: 8,
),
AppExpandableNotifier(
headerWidget: HospitalTitle(
iconUrl: 'assets/images/svg/HMC.svg',
title: TranslationBase.of(context).hmcHospital,
isHMC: true,
),
showDropDownIconWithCustomHeader: true,
bodyWidget: HospitalBodyWidget(
patientDoctorAppointmentListHospital:
patientDoctorAppointmentListHospital
.registeredDoctorMap?[key]?.hmcDoctorList,
isLiveCareAppointment: isLiveCareAppointment,
isObGyneAppointment: isObGyneAppointment,
isDoctorNameSearch: isDoctorNameSearch,
isDoctorSearchResult: isDoctorSearchResult,
),
)
],
));
// return AppExpandableNotifier(
// 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) {
// final doctor = patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList![_index];
// 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),
// );
},
itemCount: patientDoctorAppointmentListHospital
.registeredDoctorMap?.length ??
0,
)
: getNoDataWidget(context),
);
}
}
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(
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 HospitalTitle extends StatelessWidget {
final String title;
final String iconUrl;
final bool isHMC;
const HospitalTitle({super.key, required this.title, required this.iconUrl, required this.isHMC});
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
SvgPicture.asset(iconUrl),
SizedBox(width: 8,),
Text(
title,
style: TextStyle(
fontSize: 18, color:isHMC? Colors.greenAccent : Colors.red, fontWeight: FontWeight.w600),
),
],
),
);
}
}

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResultsByRegion.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/appointment_services/mock_doctor_response.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -10,6 +12,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../services/appointment_services/doctor_response_mapper.dart';
import '../SearchResults.dart';
class SearchByDoctor extends StatefulWidget {
@ -92,40 +95,50 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService();
var counter = 0;
var isHmc = false;
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
service.getDoctorsListByName(doctorNameController.text, languageID, context).then((res) {
// GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
RegionList regionHospitalList = RegionList();
setState(() {
if (res['DoctorList'].length != 0) {
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
var reg = region[counter%4];
doctorsList.add(new DoctorList.fromJson(v, region: reg,isHMC: isHmc));
isHmc = !isHmc;
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital =
_patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.getProjectCompleteName()).toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(
filterName: element.getProjectCompleteName(),
distanceInKMs: element.projectDistanceInKiloMeters.toString(),
projectTopName: element.projectTopName,
projectBottomName: element.projectBottomName,
patientDoctorAppointment: element));
}
});
regionHospitalList = DoctorMapper.getMappedDoctor(doctorsList);
// doctorsList.forEach((element) {
// List<PatientDoctorAppointmentList> doctorByHospital =
// _patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.getProjectCompleteName()).toList();
//
// if (doctorByHospital.length != 0) {
// _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
// } else {
// _patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(
// filterName: element.getProjectCompleteName(),
// distanceInKMs: element.projectDistanceInKiloMeters.toString(),
// projectTopName: element.projectTopName,
// projectBottomName: element.projectBottomName,
// patientDoctorAppointment: element));
// }
// });
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorSearchMsg']);
}
});
GifLoaderDialogUtils.hideDialog(context);
navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
// navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
navigateToSearchResults(context, regionHospitalList);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
@ -156,9 +169,17 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
context.read<ProjectViewModel>().analytics.appointment.book_appointment_doctor_search(query: doctorNameController.text);
}
navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) {
Navigator.push(context,
FadePage(page: SearchResults(isLiveCareAppointment: false, isDoctorNameSearch: true, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital, isDoctorSearchResult: true,)));
navigateToSearchResults(context, RegionList regionHospitalList) {
// Navigator.push(context,
// FadePage(page: SearchResults(isLiveCareAppointment: false, isDoctorNameSearch: true, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital, isDoctorSearchResult: true,)));
Navigator.push(context,
FadePage(page:
SearchResultsByRegion(
doctorsList: [],
patientDoctorAppointmentListHospital:regionHospitalList,
isLiveCareAppointment: false,
isDoctorSearchResult: true,
)));
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {

@ -98,12 +98,12 @@ class _DoctorViewState extends State<DoctorView> with AutomaticKeepAliveClientMi
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
),
widget.isShowDate
? Text(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.doctor.date)),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
)
: Container(),
// widget.isShowDate
// ? Text(
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.doctor.date)),
// style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
// )
// : Container(),
],
),
if (widget.doctor.doctorTitle != null) SizedBox(height: 6),
@ -138,11 +138,11 @@ class _DoctorViewState extends State<DoctorView> with AutomaticKeepAliveClientMi
// getDoctorSpeciality(this.doctor.speciality).trim(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
),
if (widget.doctor.nearestFreeSlot != null)
Text(
getDate(widget.doctor.nearestFreeSlot),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff359846), letterSpacing: -0.48, height: 18 / 12),
),
// if (widget.doctor.nearestFreeSlot != null)
// Text(
// getDate(widget.doctor.nearestFreeSlot),
// style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff359846), letterSpacing: -0.48, height: 18 / 12),
// ),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,

@ -28,6 +28,9 @@ import 'package:diplomaticquarterapp/pages/webRTC/call_page.dart';
import 'package:diplomaticquarterapp/pages/webRTC/call_page_bkp.dart';
import 'package:diplomaticquarterapp/splashPage.dart';
import 'models/Appointments/DoctorListResponse.dart';
import 'pages/BookAppointment/SearchResultsByRegion.dart';
const String INIT_ROUTE = '/';
const String HOME = 'home';
const String SPLASH = '/';

@ -21,6 +21,8 @@ import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:flutter/cupertino.dart';
import 'mock_doctor_response.dart';
class DoctorsListService extends BaseService {
AppSharedPreferences sharedPref = AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
@ -131,13 +133,15 @@ class DoctorsListService extends BaseService {
"License": true
};
dynamic localRes;
dynamic localRes = response;
await baseAppClient.post(GET_DOCTORS_LIST_URL, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
// 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);
}

@ -0,0 +1,42 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
class DoctorMapper{
static RegionList getMappedDoctor( List<DoctorList> doctorList ){
RegionList regionList = RegionList();
doctorList.forEach((element) {
var regionDoctorList = regionList.registeredDoctorMap?[element.region];
regionDoctorList ??= PatientDoctorAppointmentListByRegion();
List<PatientDoctorAppointmentList> doctorByHospital = [];
if(element.isHMC == true ){
doctorByHospital = regionDoctorList.hmcDoctorList?.where((elementClinic) => elementClinic.filterName == element.getProjectCompleteName()).toList() ?? [];
}else{
doctorByHospital = regionDoctorList.hmcDoctorList?.where((elementClinic) => elementClinic.filterName == element.getProjectCompleteName()).toList() ?? [];
}
if(doctorByHospital.isNotEmpty){
doctorByHospital.first.patientDoctorAppointmentList?.add(element);
}else{
doctorByHospital.add(
PatientDoctorAppointmentList(
filterName: element.getProjectCompleteName(),
distanceInKMs: element.projectDistanceInKiloMeters.toString(),
projectTopName: element.projectTopName,
projectBottomName: element.projectBottomName,
patientDoctorAppointment: element)
);
}
if(element.isHMC == true ){
regionDoctorList.hmcDoctorList = doctorByHospital;
}else{
regionDoctorList.hmgDoctorList = doctorByHospital;
}
regionList.registeredDoctorMap?[element.region!] = regionDoctorList;
});
return regionList;
}
}

File diff suppressed because one or more lines are too long

@ -4,6 +4,8 @@ import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResultsByRegion.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart';

@ -3044,6 +3044,10 @@ class TranslationBase {
String get download => localizedValues["download"][locale.languageCode];
String get share => localizedValues["share"][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];
}

@ -27,6 +27,7 @@ class AppExpandableNotifier extends StatefulWidget {
bool isDoctorSearchResult = false;
final String? projectTitleTop;
final String? projectTitleBottom;
final bool showDropDownIconWithCustomHeader;
AppExpandableNotifier(
{this.headerWidget,
@ -41,7 +42,9 @@ class AppExpandableNotifier extends StatefulWidget {
this.isDisabled = false,
this.isDoctorSearchResult = false,
this.projectTitleTop = "",
this.projectTitleBottom = ""});
this.projectTitleBottom = "",
this.showDropDownIconWithCustomHeader = false,
});
_AppExpandableNotifier createState() => _AppExpandableNotifier();
}
@ -86,9 +89,10 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
color: widget.widgetColor != null ? widget.widgetColor : Colors.white,
child: Column(
children: <Widget>[
SizedBox(
child: widget.headerWidget,
),
if(widget.showDropDownIconWithCustomHeader == false)
...{ SizedBox(
child: widget.headerWidget,
),},
ScrollOnExpand(
scrollOnExpand: true,
scrollOnCollapse: false,
@ -112,52 +116,83 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (_mainTitle.isNotEmpty && widget.isTitleSingleLine)
!widget.hasCounter
? Text(
_mainTitle,
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1),
)
: Row(
children: [
Text(
_mainTitle,
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1),
),
SizedBox(
width: 10.0,
if(widget.showDropDownIconWithCustomHeader)
...{
Expanded(
child: SizedBox(
child: widget.headerWidget,
))} else
...{
//todo use the custom header to show the drop down
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (_mainTitle.isNotEmpty &&
widget.isTitleSingleLine)
!widget.hasCounter
? Text(
_mainTitle,
style: TextStyle(fontSize: 20,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.72,
height: 1),
)
: Row(
children: [
Text(
_mainTitle,
style: TextStyle(fontSize: 20,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.72,
height: 1),
),
SizedBox(
width: 10.0,
),
CircleAvatar(
backgroundColor: CustomColors
.accentColor,
radius: 12.0,
child: Text(
widget.counter,
style: TextStyle(fontSize: 14,
fontWeight: FontWeight.w600,
color: Colors.white,
letterSpacing: -0.72),
),
CircleAvatar(
backgroundColor: CustomColors.accentColor,
radius: 12.0,
child: Text(
widget.counter,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.72),
),
)
],
),
if (_title.isNotEmpty && !widget.isTitleSingleLine)
Text(
_title,
maxLines: 1,
style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2E303A), letterSpacing: -1.44, height: 25 / 24),
),
if (_subTitle.isNotEmpty && !widget.isTitleSingleLine)
Text(
_subTitle,
maxLines: 1,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 23 / 12),
),
],
),
),
Icon(
)
],
),
if (_title.isNotEmpty &&
!widget.isTitleSingleLine)
Text(
_title,
maxLines: 1,
style: TextStyle(fontSize: 24,
fontWeight: FontWeight.w700,
color: Color(0xff2E303A),
letterSpacing: -1.44,
height: 25 / 24),
),
if (_subTitle.isNotEmpty &&
!widget.isTitleSingleLine)
Text(
_subTitle,
maxLines: 1,
style: TextStyle(fontSize: 14,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.72,
height: 23 / 12),
),
],
),
),}
,Icon(
widget.expandFlag ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
color: Color(0xff2E303A),
// size: 30.0,

Loading…
Cancel
Save