WD:select hospital by region changes
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">
|
<svg data-name="Group 8404" height="26" id="Group_8404" viewBox="0 0 26 26"
|
||||||
<g id="Clinic" transform="translate(-1 -1)">
|
width="26" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path id="Path_5237" data-name="Path 5237" d="M25,24h3.9v7.8H25Z" transform="translate(-12.293 -11.781)" fill="#2d343d"/>
|
<rect data-name="Rectangle 17531" fill="#69a6e2" height="26" id="Rectangle_17531" rx="4"
|
||||||
<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"/>
|
width="26" />
|
||||||
<path id="Path_5239" data-name="Path 5239" d="M15,24h3.9v7.8H15Z" transform="translate(-7.171 -11.781)" fill="#2d343d"/>
|
<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"
|
||||||
<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"/>
|
fill="#fff"
|
||||||
<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"/>
|
id="Path_5276" transform="translate(2.327 2.327)" />
|
||||||
</g>
|
|
||||||
</svg>
|
</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">
|
<svg data-name="Group 8404" height="26" id="Group_8404" viewBox="0 0 26 26"
|
||||||
<g id="hospital" transform="translate(0)">
|
width="26" xmlns="http://www.w3.org/2000/svg">
|
||||||
<g id="Group_8363" data-name="Group 8363" transform="translate(0 8.612)">
|
<rect data-name="Rectangle 17531" fill="#cc2229" height="26" id="Rectangle_17531" rx="4"
|
||||||
<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"/>
|
width="26" />
|
||||||
<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"/>
|
<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"
|
||||||
</g>
|
fill="#fff"
|
||||||
<g id="Group_8364" data-name="Group 8364" transform="translate(4.484)">
|
id="Path_5276" transform="translate(2.327 2.327)" />
|
||||||
<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>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.0 KiB |
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ));
|
||||||
Loading…
Reference in New Issue