|
|
|
|
@ -89,11 +89,7 @@ class _SelectDoctorPageState extends State<SelectDoctorPage> {
|
|
|
|
|
bookAppointmentsViewModel.filterClinics("");
|
|
|
|
|
textFocusNode.unfocus();
|
|
|
|
|
},
|
|
|
|
|
child: Utils.buildSvgWithAssets(
|
|
|
|
|
icon: AppAssets.close_bottom_sheet_icon,
|
|
|
|
|
width: 20.h,
|
|
|
|
|
height: 20.h,
|
|
|
|
|
fit: BoxFit.scaleDown),
|
|
|
|
|
child: Utils.buildSvgWithAssets(icon: AppAssets.close_bottom_sheet_icon, width: 20.h, height: 20.h, fit: BoxFit.scaleDown),
|
|
|
|
|
)
|
|
|
|
|
: null,
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
@ -111,8 +107,11 @@ class _SelectDoctorPageState extends State<SelectDoctorPage> {
|
|
|
|
|
padding: EdgeInsets.only(top: 24.h),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
itemCount:
|
|
|
|
|
bookAppointmentsVM.isDoctorsListLoading ? 5 : (bookAppointmentsVM.isLiveCareSchedule ? bookAppointmentsVM.liveCareDoctorsList.length : bookAppointmentsVM.doctorsList.length),
|
|
|
|
|
itemCount: bookAppointmentsVM.isDoctorsListLoading
|
|
|
|
|
? 5
|
|
|
|
|
: (bookAppointmentsVM.isLiveCareSchedule
|
|
|
|
|
? (bookAppointmentsVM.liveCareDoctorsList.isNotEmpty ? bookAppointmentsVM.liveCareDoctorsList.length : 1)
|
|
|
|
|
: (bookAppointmentsVM.doctorsList.isNotEmpty ? bookAppointmentsVM.doctorsList.length : 1)),
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return bookAppointmentsVM.isDoctorsListLoading
|
|
|
|
|
? DoctorCard(
|
|
|
|
|
@ -120,47 +119,49 @@ class _SelectDoctorPageState extends State<SelectDoctorPage> {
|
|
|
|
|
isLoading: true,
|
|
|
|
|
bookAppointmentsViewModel: bookAppointmentsViewModel,
|
|
|
|
|
)
|
|
|
|
|
: AnimationConfiguration.staggeredList(
|
|
|
|
|
position: index,
|
|
|
|
|
duration: const Duration(milliseconds: 500),
|
|
|
|
|
child: SlideAnimation(
|
|
|
|
|
verticalOffset: 100.0,
|
|
|
|
|
child: FadeInAnimation(
|
|
|
|
|
child: AnimatedContainer(
|
|
|
|
|
duration: Duration(milliseconds: 300),
|
|
|
|
|
curve: Curves.easeInOut,
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
|
|
|
|
|
child: DoctorCard(
|
|
|
|
|
doctorsListResponseModel: bookAppointmentsVM.isLiveCareSchedule ? bookAppointmentsVM.liveCareDoctorsList[index] : bookAppointmentsVM.doctorsList[index],
|
|
|
|
|
isLoading: false,
|
|
|
|
|
bookAppointmentsViewModel: bookAppointmentsViewModel,
|
|
|
|
|
).onPress(() async {
|
|
|
|
|
bookAppointmentsVM
|
|
|
|
|
.setSelectedDoctor(bookAppointmentsVM.isLiveCareSchedule ? bookAppointmentsVM.liveCareDoctorsList[index] : bookAppointmentsVM.doctorsList[index]);
|
|
|
|
|
// bookAppointmentsVM.setSelectedDoctor(DoctorsListResponseModel());
|
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
|
await bookAppointmentsVM.getDoctorProfile(onSuccess: (dynamic respData) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: DoctorProfilePage(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}, onError: (err) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: err),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
: checkIsDoctorsListEmpty()
|
|
|
|
|
? Utils.getNoDataWidget(context, noDataText: "No Doctor found for selected criteria...".needTranslation)
|
|
|
|
|
: AnimationConfiguration.staggeredList(
|
|
|
|
|
position: index,
|
|
|
|
|
duration: const Duration(milliseconds: 500),
|
|
|
|
|
child: SlideAnimation(
|
|
|
|
|
verticalOffset: 100.0,
|
|
|
|
|
child: FadeInAnimation(
|
|
|
|
|
child: AnimatedContainer(
|
|
|
|
|
duration: Duration(milliseconds: 300),
|
|
|
|
|
curve: Curves.easeInOut,
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
|
|
|
|
|
child: DoctorCard(
|
|
|
|
|
doctorsListResponseModel: bookAppointmentsVM.isLiveCareSchedule ? bookAppointmentsVM.liveCareDoctorsList[index] : bookAppointmentsVM.doctorsList[index],
|
|
|
|
|
isLoading: false,
|
|
|
|
|
bookAppointmentsViewModel: bookAppointmentsViewModel,
|
|
|
|
|
).onPress(() async {
|
|
|
|
|
bookAppointmentsVM
|
|
|
|
|
.setSelectedDoctor(bookAppointmentsVM.isLiveCareSchedule ? bookAppointmentsVM.liveCareDoctorsList[index] : bookAppointmentsVM.doctorsList[index]);
|
|
|
|
|
// bookAppointmentsVM.setSelectedDoctor(DoctorsListResponseModel());
|
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
|
await bookAppointmentsVM.getDoctorProfile(onSuccess: (dynamic respData) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: DoctorProfilePage(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}, onError: (err) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: err),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h),
|
|
|
|
|
),
|
|
|
|
|
@ -173,4 +174,12 @@ class _SelectDoctorPageState extends State<SelectDoctorPage> {
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool checkIsDoctorsListEmpty() {
|
|
|
|
|
if (bookAppointmentsViewModel.isLiveCareSchedule) {
|
|
|
|
|
return bookAppointmentsViewModel.liveCareDoctorsList.isEmpty;
|
|
|
|
|
} else {
|
|
|
|
|
return bookAppointmentsViewModel.doctorsList.isEmpty;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|