|
|
|
|
@ -3,15 +3,19 @@ import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/app_state.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/dependencies.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/get_clinic_list_response_model.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/features/doctor_filter/doctor_filter_view_model.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/presentation/book_appointment/doctor_filter/doctors_filter.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/presentation/book_appointment/doctor_profile_page.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/presentation/book_appointment/select_doctor_page.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/doctor_card.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
|
|
|
|
@ -214,28 +218,46 @@ class _SearchDoctorByNameState extends State<SearchDoctorByName> {
|
|
|
|
|
bookAppointmentsViewModel: bookAppointmentsViewModel,
|
|
|
|
|
isDoctorNameSearch: true,
|
|
|
|
|
).paddingSymmetrical(16.h, 0.h).onPress(() async {
|
|
|
|
|
bookAppointmentsVM.setSelectedDoctor(bookAppointmentsVM.filteredDoctorList[index]);
|
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
|
await bookAppointmentsVM.getDoctorProfile(
|
|
|
|
|
onSuccess: (dynamic respData) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: DoctorProfilePage(isDoctorAllowedToBook: true),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
onError: (err) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: err),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
if (bookAppointmentsVM.filteredDoctorList[index].clinicID == 17 && getIt.get<AppState>().getAuthenticatedUser()!.age! < 12) {
|
|
|
|
|
bookAppointmentsViewModel.setProjectID(bookAppointmentsVM.filteredDoctorList[index].projectID.toString());
|
|
|
|
|
bookAppointmentsViewModel.setSelectedClinic(GetClinicsListResponseModel(
|
|
|
|
|
clinicID: bookAppointmentsVM.filteredDoctorList[index].clinicID,
|
|
|
|
|
clinicDescription: bookAppointmentsVM.filteredDoctorList[index].clinicName,
|
|
|
|
|
isLiveCareClinicAndOnline: false,
|
|
|
|
|
liveCareServiceID: 0,
|
|
|
|
|
liveCareClinicID: 0));
|
|
|
|
|
bookAppointmentsViewModel.setIsDoctorsListLoading(true);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: SelectDoctorPage(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
bookAppointmentsVM.setSelectedDoctor(bookAppointmentsVM.filteredDoctorList[index]);
|
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
|
await bookAppointmentsVM.getDoctorProfile(
|
|
|
|
|
onSuccess: (dynamic respData) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: DoctorProfilePage(isDoctorAllowedToBook: true),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
onError: (err) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: err),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Column(
|
|
|
|
|
// children: bookAppointmentsVM.doctorsList[index].map<Widget>((entry) {
|
|
|
|
|
// final doctorIndex = entry.key;
|
|
|
|
|
|