|
|
|
|
@ -28,11 +28,7 @@ class DentalComplaints extends StatefulWidget {
|
|
|
|
|
bool isDoctorNameSearch;
|
|
|
|
|
bool isFromHospitalSearchPage;
|
|
|
|
|
|
|
|
|
|
DentalComplaints(
|
|
|
|
|
{required this.searchInfo,
|
|
|
|
|
this.onSelectedMethod,
|
|
|
|
|
this.isDoctorNameSearch = false,
|
|
|
|
|
this.isFromHospitalSearchPage = false});
|
|
|
|
|
DentalComplaints({required this.searchInfo, this.onSelectedMethod, this.isDoctorNameSearch = false, this.isFromHospitalSearchPage = false});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_DentalComplaintsState createState() => _DentalComplaintsState();
|
|
|
|
|
@ -53,6 +49,8 @@ class _DentalComplaintsState extends State<DentalComplaints> {
|
|
|
|
|
|
|
|
|
|
late ProjectViewModel projectViewModel;
|
|
|
|
|
|
|
|
|
|
bool isDoctorsList = false;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) => checkIfHasDentalPlan());
|
|
|
|
|
@ -71,36 +69,66 @@ class _DentalComplaintsState extends State<DentalComplaints> {
|
|
|
|
|
backgroundColor: CustomColors.appBackgroudGreyColor,
|
|
|
|
|
body: Container(
|
|
|
|
|
child: !hasDentalPlan
|
|
|
|
|
? ListView.separated(
|
|
|
|
|
itemCount: complaintsList.length,
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
return Container(
|
|
|
|
|
child: DentalComplaintCard(
|
|
|
|
|
listDentalChiefComplain: complaintsList[index],
|
|
|
|
|
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>()
|
|
|
|
|
.appointment
|
|
|
|
|
.book_appointment_chief_complaints(appointment_type: 'regular', hospital: info.hospital, clinic: info.clinic, treatment: complaintsList[index]);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (BuildContext context, int index) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 14, right: 14),
|
|
|
|
|
child: mDivider(CustomColors.devider),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
? isDoctorsList
|
|
|
|
|
? Container(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
...List.generate(
|
|
|
|
|
patientDoctorAppointmentListHospital.length,
|
|
|
|
|
(index) => Padding(
|
|
|
|
|
padding: const EdgeInsets.all(14.0),
|
|
|
|
|
child: AppExpandableNotifier(
|
|
|
|
|
isExpand: true,
|
|
|
|
|
title:
|
|
|
|
|
patientDoctorAppointmentListHospital[index].filterName! + " - " + patientDoctorAppointmentListHospital[index].distanceInKMs! + " " + TranslationBase.of(context).km,
|
|
|
|
|
bodyWidget: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList!.map((doctor) {
|
|
|
|
|
return DoctorView(
|
|
|
|
|
doctor: doctor,
|
|
|
|
|
isLiveCareAppointment: false,
|
|
|
|
|
isContinueDentalPlan: hasDentalPlan,
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: ListView.separated(
|
|
|
|
|
itemCount: complaintsList.length,
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
return Container(
|
|
|
|
|
child: DentalComplaintCard(
|
|
|
|
|
listDentalChiefComplain: complaintsList[index],
|
|
|
|
|
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>()
|
|
|
|
|
.appointment
|
|
|
|
|
.book_appointment_chief_complaints(appointment_type: 'regular', hospital: info.hospital, clinic: info.clinic, treatment: complaintsList[index]);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (BuildContext context, int index) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 14, right: 14),
|
|
|
|
|
child: mDivider(CustomColors.devider),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
@ -284,9 +312,36 @@ class _DentalComplaintsState extends State<DentalComplaints> {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
setState(() {
|
|
|
|
|
res['List_DentalChiefComplain'].forEach((v) {
|
|
|
|
|
complaintsList.add(new ListDentalChiefComplain.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
if (res['DoctorList'].length != 0) {
|
|
|
|
|
isDoctorsList = true;
|
|
|
|
|
doctorsList.clear();
|
|
|
|
|
res['DoctorList'].forEach((v) {
|
|
|
|
|
doctorsList.add(new DoctorList.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
doctorsList.forEach((element) {
|
|
|
|
|
List<PatientDoctorAppointmentList> doctorByHospital = patientDoctorAppointmentListHospital
|
|
|
|
|
.where(
|
|
|
|
|
(elementClinic) => elementClinic.filterName == element.projectName,
|
|
|
|
|
)
|
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
|
|
if (doctorByHospital.length != 0) {
|
|
|
|
|
patientDoctorAppointmentListHospital[patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
|
|
|
|
|
} else {
|
|
|
|
|
patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(
|
|
|
|
|
filterName: element.projectName,
|
|
|
|
|
distanceInKMs: element.projectDistanceInKiloMeters.toString(),
|
|
|
|
|
projectTopName: element.projectTopName,
|
|
|
|
|
projectBottomName: element.projectBottomName,
|
|
|
|
|
patientDoctorAppointment: element));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
isDoctorsList = false;
|
|
|
|
|
res['List_DentalChiefComplain'].forEach((v) {
|
|
|
|
|
complaintsList.add(new ListDentalChiefComplain.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
|