Dental appointment booking implementation contd.

pull/72/head
haroon amjad 4 weeks ago
parent 8291e89ee7
commit 415c0eb3c7

@ -174,7 +174,7 @@ class ApiClientImp implements ApiClient {
} }
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// body['PatientID'] = 4767477; // body['PatientID'] = 4767884;
// body['PatientTypeID'] = 1; // body['PatientTypeID'] = 1;
// //
// body['PatientOutSA'] = 0; // body['PatientOutSA'] = 0;

@ -746,6 +746,8 @@ class ApiConsts {
static String TAMARA_URL = "https://mdlaboratories.com/tamaralive/Home/Checkout"; static String TAMARA_URL = "https://mdlaboratories.com/tamaralive/Home/Checkout";
static String GET_TAMARA_INSTALLMENTS_URL = "https://mdlaboratories.com/tamaralive/Home/GetInstallments"; static String GET_TAMARA_INSTALLMENTS_URL = "https://mdlaboratories.com/tamaralive/Home/GetInstallments";
// static String GET_TAMARA_INSTALLMENTS_URL = "https://epharmacy.hmg.com/tamara/Home/getinstallments";
// var payFortEnvironment = FortEnvironment.test; // var payFortEnvironment = FortEnvironment.test;
// var applePayMerchantId = "merchant.com.hmgwebservices.uat"; // var applePayMerchantId = "merchant.com.hmgwebservices.uat";
@ -764,17 +766,16 @@ class ApiConsts {
payFortEnvironment = FortEnvironment.test; payFortEnvironment = FortEnvironment.test;
applePayMerchantId = "merchant.com.hmgwebservices.uat"; applePayMerchantId = "merchant.com.hmgwebservices.uat";
SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx';
TAMARA_URL = "https://mdlaboratories.com/tamara/Home/Checkout"; TAMARA_URL = "https://epharmacy.hmg.com/tamara/Home/Checkout";
GET_TAMARA_INSTALLMENTS_URL = "https://mdlaboratories.com/tamara/Home/GetInstallments"; GET_TAMARA_INSTALLMENTS_URL = "https://epharmacy.hmg.com/tamara/Home/getinstallments";
break; break;
case AppEnvironmentTypeEnum.uat: case AppEnvironmentTypeEnum.uat:
baseUrl = "https://uat.hmgwebservices.com/"; baseUrl = "https://uat.hmgwebservices.com/";
payFortEnvironment = FortEnvironment.test; payFortEnvironment = FortEnvironment.test;
applePayMerchantId = "merchant.com.hmgwebservices.uat"; applePayMerchantId = "merchant.com.hmgwebservices.uat";
SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx';
TAMARA_URL = "https://mdlaboratories.com/tamara/Home/Checkout"; TAMARA_URL = "https://epharmacy.hmg.com/tamara/Home/Checkout";
// GET_TAMARA_INSTALLMENTS_URL = "https://mdlaboratories.com/tamara/Home/GetInstallments"; GET_TAMARA_INSTALLMENTS_URL = "https://epharmacy.hmg.com/tamara/Home/getinstallments";
GET_TAMARA_INSTALLMENTS_URL = "https://mdlaboratories.com/tamaralive/Home/GetInstallments";
break; break;
case AppEnvironmentTypeEnum.preProd: case AppEnvironmentTypeEnum.preProd:
@ -782,24 +783,24 @@ class ApiConsts {
payFortEnvironment = FortEnvironment.production; payFortEnvironment = FortEnvironment.production;
applePayMerchantId = "merchant.com.hmgwebservices"; applePayMerchantId = "merchant.com.hmgwebservices";
SERVICE_URL = "https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx"; SERVICE_URL = "https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx";
TAMARA_URL = "https://mdlaboratories.com/tamara/Home/Checkout"; TAMARA_URL = "https://epharmacy.hmg.com/tamara/Home/Checkout";
GET_TAMARA_INSTALLMENTS_URL = "https://mdlaboratories.com/tamara/Home/GetInstallments"; GET_TAMARA_INSTALLMENTS_URL = "https://epharmacy.hmg.com/tamara/Home/getinstallments";
break; break;
case AppEnvironmentTypeEnum.qa: case AppEnvironmentTypeEnum.qa:
baseUrl = "https://uat.hmgwebservices.com/"; baseUrl = "https://uat.hmgwebservices.com/";
payFortEnvironment = FortEnvironment.test; payFortEnvironment = FortEnvironment.test;
applePayMerchantId = "merchant.com.hmgwebservices.uat"; applePayMerchantId = "merchant.com.hmgwebservices.uat";
SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx';
TAMARA_URL = "https://mdlaboratories.com/tamara/Home/Checkout"; TAMARA_URL = "https://epharmacy.hmg.com/tamara/Home/Checkout";
GET_TAMARA_INSTALLMENTS_URL = "https://mdlaboratories.com/tamara/Home/GetInstallments"; GET_TAMARA_INSTALLMENTS_URL = "https://epharmacy.hmg.com/tamara/Home/getinstallments";
break; break;
case AppEnvironmentTypeEnum.staging: case AppEnvironmentTypeEnum.staging:
baseUrl = "https://uat.hmgwebservices.com/"; baseUrl = "https://uat.hmgwebservices.com/";
payFortEnvironment = FortEnvironment.test; payFortEnvironment = FortEnvironment.test;
applePayMerchantId = "merchant.com.hmgwebservices.uat"; applePayMerchantId = "merchant.com.hmgwebservices.uat";
SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx';
TAMARA_URL = "https://mdlaboratories.com/tamara/Home/Checkout"; TAMARA_URL = "https://epharmacy.hmg.com/tamara/Home/Checkout";
GET_TAMARA_INSTALLMENTS_URL = "https://mdlaboratories.com/tamara/Home/GetInstallments"; GET_TAMARA_INSTALLMENTS_URL = "https://epharmacy.hmg.com/tamara/Home/getinstallments";
break; break;
} }
} }

@ -323,7 +323,7 @@ class Utils {
children: [ children: [
Lottie.asset(AppAnimations.loadingAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill), Lottie.asset(AppAnimations.loadingAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill),
SizedBox(height: 8.h), SizedBox(height: 8.h),
(loadingText ?? LocaleKeys.loadingText.tr()).toText16(color: AppColors.blackColor), (loadingText ?? LocaleKeys.loadingText.tr()).toText16(color: AppColors.blackColor, isCenter: true),
SizedBox(height: 8.h), SizedBox(height: 8.h),
], ],
).center; ).center;
@ -355,7 +355,7 @@ class Utils {
).center; ).center;
} }
static Widget getWarningWidget({String? loadingText, bool isShowActionButtons = false, Function? onConfirmTap, Function? onCancelTap}) { static Widget getWarningWidget({String? loadingText, bool isShowActionButtons = false, Widget? bodyWidget, Function? onConfirmTap, Function? onCancelTap}) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -364,6 +364,8 @@ class Utils {
SizedBox(height: 8.h), SizedBox(height: 8.h),
(loadingText ?? LocaleKeys.loadingText.tr()).toText14(color: AppColors.blackColor, letterSpacing: 0), (loadingText ?? LocaleKeys.loadingText.tr()).toText14(color: AppColors.blackColor, letterSpacing: 0),
SizedBox(height: 16.h), SizedBox(height: 16.h),
bodyWidget ?? SizedBox.shrink(),
SizedBox(height: 16.h),
isShowActionButtons isShowActionButtons
? Row( ? Row(
children: [ children: [

@ -10,6 +10,7 @@ import 'package:hmg_patient_app_new/features/book_appointments/models/resp_model
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctors_list_response_model.dart'; import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctors_list_response_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/book_appointments/models/resp_models/get_clinic_list_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/get_livecare_clinics_response_model.dart'; import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/get_livecare_clinics_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/get_patient_dental_plan_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/hospital_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/hospital_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart'; import 'package:hmg_patient_app_new/services/logger_service.dart';
@ -68,6 +69,9 @@ abstract class BookAppointmentsRepo {
required int serviceID, required int serviceID,
Function(dynamic)? onSuccess, Function(dynamic)? onSuccess,
Function(String)? onError}); Function(String)? onError});
Future<Either<Failure, GenericApiModel<List<PatientDentalPlanEstimationResponseModel>>>> getPatientDentalEstimation(
{required int projectID, Function(dynamic)? onSuccess, Function(String)? onError});
} }
class BookAppointmentsRepoImp implements BookAppointmentsRepo { class BookAppointmentsRepoImp implements BookAppointmentsRepo {
@ -656,4 +660,44 @@ class BookAppointmentsRepoImp implements BookAppointmentsRepo {
return Left(UnknownFailure(e.toString())); return Left(UnknownFailure(e.toString()));
} }
} }
@override
Future<Either<Failure, GenericApiModel<List<PatientDentalPlanEstimationResponseModel>>>> getPatientDentalEstimation(
{required int projectID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
Map<String, dynamic> mapDevice = {
"ProjectID": projectID,
};
try {
GenericApiModel<List<PatientDentalPlanEstimationResponseModel>>? apiResponse;
Failure? failure;
await apiClient.post(
HAS_DENTAL_PLAN,
body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
onError!(error);
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final list = response['List_IsPatientHasOnGoingEstimation'];
final estimationList = list.map((item) => PatientDentalPlanEstimationResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientDentalPlanEstimationResponseModel>();
apiResponse = GenericApiModel<List<PatientDentalPlanEstimationResponseModel>>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: estimationList,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
} }

@ -15,6 +15,7 @@ import 'package:hmg_patient_app_new/features/book_appointments/models/free_slot.
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctor_profile_response_model.dart'; import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctor_profile_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctors_list_response_model.dart'; import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctors_list_response_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/book_appointments/models/resp_models/get_clinic_list_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/get_patient_dental_plan_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/timeslots.dart'; import 'package:hmg_patient_app_new/features/book_appointments/models/timeslots.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/facility_selection.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/facility_selection.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/doctor_list_api_response.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/doctor_list_api_response.dart';
@ -55,6 +56,10 @@ class BookAppointmentsViewModel extends ChangeNotifier {
List<DoctorsListResponseModel> liveCareDoctorsList = []; List<DoctorsListResponseModel> liveCareDoctorsList = [];
List<PatientDentalPlanEstimationResponseModel> patientDentalPlanEstimationList = [];
int totalTimeNeededForDentalProcedure = 0;
bool isContinueDentalPlan = false;
GetClinicsListResponseModel selectedClinic = GetClinicsListResponseModel(); GetClinicsListResponseModel selectedClinic = GetClinicsListResponseModel();
DoctorsListResponseModel selectedDoctor = DoctorsListResponseModel(); DoctorsListResponseModel selectedDoctor = DoctorsListResponseModel();
GetLiveCareClinicsResponseModel selectedLiveCareClinic = GetLiveCareClinicsResponseModel(); GetLiveCareClinicsResponseModel selectedLiveCareClinic = GetLiveCareClinicsResponseModel();
@ -128,6 +133,8 @@ class BookAppointmentsViewModel extends ChangeNotifier {
clinicsList.clear(); clinicsList.clear();
doctorsList.clear(); doctorsList.clear();
liveCareClinicsList.clear(); liveCareClinicsList.clear();
patientDentalPlanEstimationList.clear();
isContinueDentalPlan = false;
// getLocation(); // getLocation();
notifyListeners(); notifyListeners();
} }
@ -275,11 +282,10 @@ class BookAppointmentsViewModel extends ChangeNotifier {
} }
//TODO: Make the API dynamic with parameters for ProjectID, isNearest, languageID, doctorId, doctorName //TODO: Make the API dynamic with parameters for ProjectID, isNearest, languageID, doctorId, doctorName
Future<void> getDoctorsList( Future<void> getDoctorsList({int projectID = 0, bool isNearest = false, int doctorId = 0, String doctorName = "", Function(dynamic)? onSuccess, Function(String)? onError}) async {
{int projectID = 0, bool isNearest = false, int doctorId = 0, String doctorName = "", isContinueDentalPlan = false, Function(dynamic)? onSuccess, Function(String)? onError}) async {
doctorsList.clear(); doctorsList.clear();
projectID = currentlySelectedHospitalFromRegionFlow != null ? int.parse(currentlySelectedHospitalFromRegionFlow!) : projectID; projectID = currentlySelectedHospitalFromRegionFlow != null ? int.parse(currentlySelectedHospitalFromRegionFlow!) : projectID;
final result = await bookAppointmentsRepo.getDoctorsList(selectedClinic.clinicID ?? 0, projectID, isNearest, doctorId, doctorName); final result = await bookAppointmentsRepo.getDoctorsList(selectedClinic.clinicID ?? 0, projectID, isNearest, doctorId, doctorName, isContinueDentalPlan: isContinueDentalPlan);
result.fold( result.fold(
(failure) async { (failure) async {
@ -901,4 +907,34 @@ class BookAppointmentsViewModel extends ChangeNotifier {
filteredDoctorList = getDoctorListAsPerSelection(); filteredDoctorList = getDoctorListAsPerSelection();
notifyListeners(); notifyListeners();
} }
Future<void> getPatientDentalEstimation({required int projectID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
patientDentalPlanEstimationList.clear();
totalTimeNeededForDentalProcedure = 0;
isContinueDentalPlan = false;
notifyListeners();
final result = await bookAppointmentsRepo.getPatientDentalEstimation(projectID: projectID);
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
(apiResponse) {
if (apiResponse.messageStatus == 2) {
onError!(apiResponse.errorMessage!);
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
patientDentalPlanEstimationList = apiResponse.data!;
patientDentalPlanEstimationList.forEach((v) {
totalTimeNeededForDentalProcedure += (v.neededTime ?? 0);
});
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
} }

@ -0,0 +1,40 @@
class PatientDentalPlanEstimationResponseModel {
dynamic setupID;
dynamic estimationNo;
int? projectID;
String? procedureId;
int? patientID;
int? sequenceNo;
int? neededTime;
String? procedureName;
String? procedureNameN;
PatientDentalPlanEstimationResponseModel(
{this.setupID, this.estimationNo, this.projectID, this.procedureId, this.patientID, this.sequenceNo, this.neededTime, this.procedureName, this.procedureNameN});
PatientDentalPlanEstimationResponseModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
estimationNo = json['EstimationNo'];
projectID = json['ProjectID'];
procedureId = json['ProcedureId'];
patientID = json['PatientID'];
sequenceNo = json['sequenceNo'];
neededTime = json['NeededTime'];
procedureName = json['ProcedureName'];
procedureNameN = json['ProcedureNameN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['EstimationNo'] = this.estimationNo;
data['ProjectID'] = this.projectID;
data['ProcedureId'] = this.procedureId;
data['PatientID'] = this.patientID;
data['sequenceNo'] = this.sequenceNo;
data['NeededTime'] = this.neededTime;
data['ProcedureName'] = this.procedureName;
data['ProcedureNameN'] = this.procedureNameN;
return data;
}
}

@ -23,8 +23,11 @@ import 'package:hmg_patient_app_new/presentation/book_appointment/select_livecar
import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/clinic_card.dart'; import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/clinic_card.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/input_widget.dart'; import 'package:hmg_patient_app_new/widgets/input_widget.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart'; import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -216,16 +219,124 @@ class _SelectClinicPageState extends State<SelectClinicPage> {
} }
//17 and 235 //17 and 235
void handleDoctorScreen(GetClinicsListResponseModel clinic) { void handleDoctorScreen(GetClinicsListResponseModel clinic) async {
if (widget.isFromRegionFlow) { if (widget.isFromRegionFlow) {
Navigator.of(context).push( //Dental Clinic Flow
CustomPageRoute( if (clinic.clinicID == 17) {
page: SelectDoctorPage(), LoaderBottomSheet.showLoader(loadingText: "Checking for an existing dental plan, Please wait...".needTranslation);
), await bookAppointmentsViewModel.getPatientDentalEstimation(projectID: int.parse(bookAppointmentsViewModel.currentlySelectedHospitalFromRegionFlow ?? "0")).then((value) {
); LoaderBottomSheet.hideLoader();
if (bookAppointmentsViewModel.patientDentalPlanEstimationList.isNotEmpty) {
showCommonBottomSheetWithoutHeight(
// title: LocaleKeys.notice.tr(context: context),
title: "Dental treatment plan".needTranslation,
context,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"You have an existing treatment plan: ".needTranslation.toText14(weight: FontWeight.w500),
SizedBox(height: 8.h),
Container(
width: double.infinity,
padding: EdgeInsets.all(16.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 20.h,
hasShadow: true,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: bookAppointmentsViewModel.patientDentalPlanEstimationList.length,
separatorBuilder: (_, __) {
return Column(
children: [
SizedBox(height: 8.h),
Divider(height: 1, color: AppColors.greyColor),
SizedBox(height: 8.h),
],
);
},
itemBuilder: (context, index) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
bookAppointmentsViewModel.patientDentalPlanEstimationList[index].procedureName!.toText12(isBold: true),
AppCustomChipWidget(icon: AppAssets.appointment_time_icon, labelText: "${bookAppointmentsViewModel.totalTimeNeededForDentalProcedure} Mins".needTranslation),
],
);
},
),
SizedBox(
height: 16.h,
),
Divider(height: 1, color: AppColors.greyColor),
SizedBox(
height: 8.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Total time required".needTranslation.toText14(isBold: true),
AppCustomChipWidget(icon: AppAssets.appointment_time_icon, labelText: "30 Mins".needTranslation),
],
)
],
),
),
SizedBox(height: 16.h),
"Would you like to continue it?".needTranslation.toText14(weight: FontWeight.w500),
SizedBox(height: 16.h),
Row(
children: [
Expanded(
child: CustomButton(
text: LocaleKeys.cancel.tr(),
onPressed: () {
Navigator.of(context).pop();
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor,
textColor: AppColors.whiteColor,
icon: AppAssets.cancel,
iconColor: AppColors.whiteColor,
),
),
SizedBox(width: 8.h),
Expanded(
child: CustomButton(
text: LocaleKeys.confirm.tr(),
onPressed: () async {},
backgroundColor: AppColors.bgGreenColor,
borderColor: AppColors.bgGreenColor,
textColor: Colors.white,
icon: AppAssets.confirm,
),
),
],
)
],
),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
} else {
// Navigate to Chief Complaint Screen
}
});
} else {
Navigator.of(context).push(
CustomPageRoute(
page: SelectDoctorPage(),
),
);
}
} else { } else {
var bottomSheetType = RegionBottomSheetType.FOR_CLINIIC; var bottomSheetType = RegionBottomSheetType.FOR_CLINIIC;
print("the cliininc id is ${clinic.clinicID}");
if (clinic.clinicID == 17 || clinic.clinicID == 235) { if (clinic.clinicID == 17 || clinic.clinicID == 235) {
bottomSheetType = RegionBottomSheetType.REGION_FOR_DENTAL_AND_LASER; bottomSheetType = RegionBottomSheetType.REGION_FOR_DENTAL_AND_LASER;
} }

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

@ -135,8 +135,8 @@ class _LandingPageState extends State<LandingPage> {
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderRadius: 12, borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), padding: EdgeInsets.fromLTRB(10.h, 0, 10.h, 0),
height: 40, height: 40.h,
), ),
Row( Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,

Loading…
Cancel
Save