|
|
|
|
@ -27,8 +27,7 @@ class ResultByClinic extends StatefulWidget {
|
|
|
|
|
HospitalsModel? selectedValue;
|
|
|
|
|
Function(RegionList) onClinicSelected;
|
|
|
|
|
|
|
|
|
|
ResultByClinic(
|
|
|
|
|
{super.key, this.selectedValue, required this.onClinicSelected});
|
|
|
|
|
ResultByClinic({super.key, this.selectedValue, required this.onClinicSelected});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
State<ResultByClinic> createState() => _ResultByClinicState();
|
|
|
|
|
@ -40,8 +39,7 @@ class _ResultByClinicState extends State<ResultByClinic> {
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback(
|
|
|
|
|
(_) => getClinicWrtHospital(widget.selectedValue));
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) => getClinicWrtHospital(widget.selectedValue));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -52,66 +50,56 @@ class _ResultByClinicState extends State<ResultByClinic> {
|
|
|
|
|
child: clinicIds?.isNotEmpty == true
|
|
|
|
|
? 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),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
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,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(8),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.arrow_forward_ios,
|
|
|
|
|
color: CustomColors.black,
|
|
|
|
|
size: 16,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
itemCount: clinicIds?.length ?? 0,
|
|
|
|
|
),
|
|
|
|
|
itemCount: clinicIds?.length ?? 0,
|
|
|
|
|
)
|
|
|
|
|
: getNoDataWidget(context)),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDoctorsList(
|
|
|
|
|
BuildContext context,
|
|
|
|
|
String? dropdownValue,
|
|
|
|
|
String? dropdownTitle,
|
|
|
|
|
HospitalsModel? selectedHospital,
|
|
|
|
|
ListClinicCentralized? selectedClinic) {
|
|
|
|
|
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.ProjectID = int.parse(selectedHospital?.mainProjectID.toString() ?? "");
|
|
|
|
|
searchInfo.ClinicID = int.parse(dropdownValue!.split("-")[0]);
|
|
|
|
|
searchInfo.hospital = selectedHospital;
|
|
|
|
|
searchInfo.clinic = selectedClinic;
|
|
|
|
|
@ -136,10 +124,7 @@ class _ResultByClinicState extends State<ResultByClinic> {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: LiveCareBookAppointment(
|
|
|
|
|
clinicName: dropdownTitle,
|
|
|
|
|
liveCareClinicID: dropdownValue!.split("-")[2],
|
|
|
|
|
liveCareServiceID: dropdownValue!.split("-")[3]),
|
|
|
|
|
page: LiveCareBookAppointment(clinicName: dropdownTitle, liveCareClinicID: dropdownValue!.split("-")[2], liveCareServiceID: dropdownValue!.split("-")[3]),
|
|
|
|
|
),
|
|
|
|
|
).then((value) {
|
|
|
|
|
print("navigation return ");
|
|
|
|
|
@ -169,8 +154,7 @@ class _ResultByClinicState extends State<ResultByClinic> {
|
|
|
|
|
).then((value) {});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future navigateToDentalComplaints(
|
|
|
|
|
BuildContext context, SearchInfo searchInfo) async {
|
|
|
|
|
Future navigateToDentalComplaints(BuildContext context, SearchInfo searchInfo) async {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
@ -195,20 +179,11 @@ class _ResultByClinicState extends State<ResultByClinic> {
|
|
|
|
|
List<String> arrDistance = [];
|
|
|
|
|
List<String> result;
|
|
|
|
|
int numAll;
|
|
|
|
|
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =
|
|
|
|
|
[];
|
|
|
|
|
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)
|
|
|
|
|
.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) {
|
|
|
|
|
@ -221,15 +196,12 @@ class _ResultByClinicState extends State<ResultByClinic> {
|
|
|
|
|
));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
regionHospitalList = await DoctorMapper.getMappedDoctor(doctorsList,
|
|
|
|
|
isArabic: isArabic);
|
|
|
|
|
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);
|
|
|
|
|
var isLocationEnabled = (lat != null && lat != 0.0) && (lng != null && lng != 0.0);
|
|
|
|
|
regionHospitalList = await DoctorMapper.sortList(isLocationEnabled, regionHospitalList);
|
|
|
|
|
widget.onClinicSelected(regionHospitalList);
|
|
|
|
|
setState(() {});
|
|
|
|
|
} else {
|
|
|
|
|
@ -258,8 +230,7 @@ class _ResultByClinicState extends State<ResultByClinic> {
|
|
|
|
|
clinicIds = List.empty();
|
|
|
|
|
List<ListClinicCentralized> clinicId = [];
|
|
|
|
|
try {
|
|
|
|
|
Map res = await service.getClinicByHospital(
|
|
|
|
|
projectID: newValue?.mainProjectID.toString() ?? "");
|
|
|
|
|
Map res = await service.getClinicByHospital(projectID: newValue?.mainProjectID.toString() ?? "");
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
List list = res['ListClinic'];
|
|
|
|
|
|