|
|
|
@ -89,25 +89,23 @@ class _SearchDoctorByNameState extends State<SearchDoctorByName> {
|
|
|
|
child: SizedBox(
|
|
|
|
child: SizedBox(
|
|
|
|
height: 56.h,
|
|
|
|
height: 56.h,
|
|
|
|
width: 56.h,
|
|
|
|
width: 56.h,
|
|
|
|
child: DecoratedBox(decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
child: DecoratedBox(
|
|
|
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
borderRadius: 10.h,
|
|
|
|
borderRadius: 10.h,
|
|
|
|
hasShadow: false,
|
|
|
|
hasShadow: false,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Utils.buildSvgWithAssets(icon: AppAssets.ic_filters,
|
|
|
|
child: Utils.buildSvgWithAssets(
|
|
|
|
|
|
|
|
icon: AppAssets.ic_filters,
|
|
|
|
height: 24.h,
|
|
|
|
height: 24.h,
|
|
|
|
width: 24.h, ).paddingAll(16.h).onPress((){
|
|
|
|
width: 24.h,
|
|
|
|
|
|
|
|
).paddingAll(16.h).onPress(() {
|
|
|
|
context.read<DoctorFilterViewModel>()
|
|
|
|
context.read<DoctorFilterViewModel>()
|
|
|
|
..clearSelection()
|
|
|
|
..clearSelection()
|
|
|
|
..clearSearchFilters()
|
|
|
|
..clearSearchFilters()
|
|
|
|
..getFiltersFromDoctorList(
|
|
|
|
..getFiltersFromDoctorList(bookAppointmentsViewModel.doctorsList)
|
|
|
|
bookAppointmentsViewModel.doctorsList
|
|
|
|
..setSelections(bookAppointmentsViewModel.selectedFacilityForFilters?.toList(), bookAppointmentsViewModel.selectedRegionForFilters?.toList(),
|
|
|
|
)..setSelections(
|
|
|
|
bookAppointmentsViewModel.selectedClinicForFilters, bookAppointmentsViewModel.selectedHospitalForFilters, bookAppointmentsViewModel.applyFilters);
|
|
|
|
bookAppointmentsViewModel.selectedFacilityForFilters?.toList(),
|
|
|
|
|
|
|
|
bookAppointmentsViewModel.selectedRegionForFilters?.toList(),
|
|
|
|
|
|
|
|
bookAppointmentsViewModel.selectedClinicForFilters,
|
|
|
|
|
|
|
|
bookAppointmentsViewModel.selectedHospitalForFilters,
|
|
|
|
|
|
|
|
bookAppointmentsViewModel.applyFilters) ;
|
|
|
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
Navigator.of(context).push(
|
|
|
|
PageRouteBuilder(
|
|
|
|
PageRouteBuilder(
|
|
|
|
pageBuilder: (context, animation, secondaryAnimation) => DoctorsFilters(), // Replace YourNewPage with your actual page widget
|
|
|
|
pageBuilder: (context, animation, secondaryAnimation) => DoctorsFilters(), // Replace YourNewPage with your actual page widget
|
|
|
|
@ -136,9 +134,43 @@ class _SearchDoctorByNameState extends State<SearchDoctorByName> {
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
|
|
|
|
if (bookAppointmentsVM.isDoctorSearchByNameStarted)
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
CustomButton(
|
|
|
|
|
|
|
|
text: LocaleKeys.byClinic.tr(context: context),
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
bookAppointmentsVM.sortFilteredDoctorList(true);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
backgroundColor: bookAppointmentsVM.isSortByClinic ? AppColors.bgRedLightColor : AppColors.whiteColor,
|
|
|
|
|
|
|
|
borderColor: bookAppointmentsVM.isSortByClinic ? AppColors.primaryRedColor : AppColors.textColor.withOpacity(0.2),
|
|
|
|
|
|
|
|
textColor: bookAppointmentsVM.isSortByClinic ? AppColors.primaryRedColor : AppColors.blackColor,
|
|
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
|
|
|
borderRadius: 10,
|
|
|
|
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
|
|
|
height: 40.h,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(width: 8.h),
|
|
|
|
|
|
|
|
CustomButton(
|
|
|
|
|
|
|
|
text: LocaleKeys.byHospital.tr(context: context),
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
bookAppointmentsVM.sortFilteredDoctorList(false);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
backgroundColor: bookAppointmentsVM.isSortByClinic ? AppColors.whiteColor : AppColors.bgRedLightColor,
|
|
|
|
|
|
|
|
borderColor: bookAppointmentsVM.isSortByClinic ? AppColors.textColor.withOpacity(0.2) : AppColors.primaryRedColor,
|
|
|
|
|
|
|
|
textColor: bookAppointmentsVM.isSortByClinic ? AppColors.blackColor : AppColors.primaryRedColor,
|
|
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
|
|
|
borderRadius: 10,
|
|
|
|
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
|
|
|
height: 40.h,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
).paddingSymmetrical(0.h, 0.h),
|
|
|
|
bookAppointmentsVM.isDoctorSearchByNameStarted
|
|
|
|
bookAppointmentsVM.isDoctorSearchByNameStarted
|
|
|
|
? ListView.separated(
|
|
|
|
? ListView.separated(
|
|
|
|
padding: EdgeInsets.only(top: 24.h),
|
|
|
|
padding: EdgeInsets.only(top: 20.h),
|
|
|
|
shrinkWrap: true,
|
|
|
|
shrinkWrap: true,
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
itemCount: bookAppointmentsVM.isDoctorsListLoading ? 5 : bookAppointmentsVM.filteredDoctorList.length,
|
|
|
|
itemCount: bookAppointmentsVM.isDoctorsListLoading ? 5 : bookAppointmentsVM.filteredDoctorList.length,
|
|
|
|
@ -261,6 +293,7 @@ class _SearchDoctorByNameState extends State<SearchDoctorByName> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
void dispose() {
|
|
|
|
bookAppointmentsViewModel.doctorsList.clear();
|
|
|
|
bookAppointmentsViewModel.doctorsList.clear();
|
|
|
|
|