LiveCare flow from clinic selection implemented

pull/122/head
haroon amjad 1 month ago
parent fe294ae8f6
commit a80410d64b

@ -454,8 +454,6 @@ var GET_ANCILLARY_ORDERS_DETAILS = 'Services/Doctors.svc/REST/GetOnlineAncillary
//Pharmacy wishlist //Pharmacy wishlist
// var GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; // var GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/";
var GET_DOCTOR_LIST_BY_TIME = "Services/Doctors.svc/REST/SearchDoctorsByTime";
// pharmacy // pharmacy
var PHARMACY_AUTORZIE_CUSTOMER = "AutorizeCustomer"; var PHARMACY_AUTORZIE_CUSTOMER = "AutorizeCustomer";
var PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer"; var PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer";
@ -553,7 +551,6 @@ var GET_FINAL_PRODUCTS =
'products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId='; 'products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId=';
var GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory'; var GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory';
var GET_DISEASE_BY_CLINIC_ID = 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID'; var GET_DISEASE_BY_CLINIC_ID = 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID';
var SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime';
var TIMER_MIN = 10; var TIMER_MIN = 10;

@ -188,13 +188,14 @@ class AppointmentCard extends StatelessWidget {
? 'Cardiology' ? 'Cardiology'
: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}", : "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}",
).toShimmer2(isShow: isLoading), ).toShimmer2(isShow: isLoading),
AppCustomChipWidget(
labelPadding: EdgeInsetsDirectional.only(start: -2.w, end: 6.w), // AppCustomChipWidget(
isIconPNG: true, // labelPadding: EdgeInsetsDirectional.only(start: -2.w, end: 6.w),
icon: getIt.get<AppState>().getAuthenticatedUser()?.gender == 1 ? AppAssets.maleImg : AppAssets.femaleImg, // isIconPNG: true,
iconSize: 18.h, // icon: getIt.get<AppState>().getAuthenticatedUser()?.gender == 1 ? AppAssets.maleImg : AppAssets.femaleImg,
labelText: isLoading ? 'Cardiology' : "Patient: ${getIt.get<AppState>().getAuthenticatedUser()!.firstName!}", // iconSize: 18.h,
).toShimmer2(isShow: isLoading), // labelText: isLoading ? 'Cardiology' : "Patient: ${getIt.get<AppState>().getAuthenticatedUser()!.firstName!}",
// ).toShimmer2(isShow: isLoading),
// if (!isFromMedicalReport) // if (!isFromMedicalReport)
// AppCustomChipWidget( // AppCustomChipWidget(
// icon: AppAssets.appointment_time_icon, // icon: AppAssets.appointment_time_icon,

@ -212,7 +212,9 @@ class _SelectClinicPageState extends State<SelectClinicPage> {
CustomPageRoute( CustomPageRoute(
page: SelectLivecareClinicPage(onNegativeClicked: (){ page: SelectLivecareClinicPage(onNegativeClicked: (){
handleDoctorScreen(clinic); handleDoctorScreen(clinic);
},), },
selectedClinic: clinic,
),
), ),
); );
} else { } else {

@ -1,22 +1,37 @@
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.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/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/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/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.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/immediate_livecare/immediate_livecare_view_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/models/resp_models/get_livecare_immediate_clinics_response_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart';
import 'package:hmg_patient_app_new/services/navigation_service.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/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.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:provider/provider.dart';
class SelectLivecareClinicPage extends StatelessWidget { class SelectLivecareClinicPage extends StatelessWidget {
final VoidCallback? onNegativeClicked; final VoidCallback? onNegativeClicked;
const SelectLivecareClinicPage({super.key, this.onNegativeClicked}); late GetClinicsListResponseModel selectedClinic;
SelectLivecareClinicPage({super.key, this.onNegativeClicked, required this.selectedClinic});
late ImmediateLiveCareViewModel immediateLiveCareViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
immediateLiveCareViewModel = Provider.of<ImmediateLiveCareViewModel>(context, listen: false);
return Scaffold( return Scaffold(
backgroundColor: AppColors.bgScaffoldColor, backgroundColor: AppColors.bgScaffoldColor,
body: Column( body: Column(
@ -103,7 +118,36 @@ class SelectLivecareClinicPage extends StatelessWidget {
children: [ children: [
CustomButton( CustomButton(
text: "Yes please, I am in a hurry".needTranslation, text: "Yes please, I am in a hurry".needTranslation,
onPressed: () {}, onPressed: () async {
Navigator.pop(context);
GetLiveCareClinicListResponseModel liveCareClinic = GetLiveCareClinicListResponseModel(
iD: selectedClinic.liveCareClinicID,
serviceID: selectedClinic.liveCareServiceID,
serviceName: selectedClinic.clinicDescription,
serviceNameN: selectedClinic.clinicDescriptionN,
);
immediateLiveCareViewModel.setLiveCareSelectedCallType(1);
immediateLiveCareViewModel.setImmediateLiveCareSelectedClinic(liveCareClinic);
LoaderBottomSheet.showLoader(loadingText: "Fetching fees, Please wait...".needTranslation);
await immediateLiveCareViewModel.getLiveCareImmediateAppointmentFees(onSuccess: (val) {
LoaderBottomSheet.hideLoader();
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).push(
CustomPageRoute(
page: ImmediateLiveCarePaymentDetails(),
),
);
}, onError: (err) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: err),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
});
},
backgroundColor: AppColors.primaryRedColor, backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedColor,
textColor: AppColors.whiteColor, textColor: AppColors.whiteColor,

@ -1,15 +1,23 @@
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/enums.dart'; import 'package:hmg_patient_app_new/core/enums.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.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/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.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/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/my_appointments/appointment_via_region_viewmodel.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/region_bottomsheet/region_list_widget.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/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:provider/provider.dart';
import '../../widgets/common_bottom_sheet.dart';
class HealthCalculatorResultPage extends StatelessWidget { class HealthCalculatorResultPage extends StatelessWidget {
HealthCalculatorsTypeEnum calculatorType; HealthCalculatorsTypeEnum calculatorType;
@ -26,7 +34,15 @@ class HealthCalculatorResultPage extends StatelessWidget {
padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 20.h), padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 20.h),
child: CustomButton( child: CustomButton(
text: LocaleKeys.bookAppo.tr(), text: LocaleKeys.bookAppo.tr(),
onPressed: () {}, onPressed: () {
// Navigate to booking page
var bottomSheetType = RegionBottomSheetType.FOR_CLINIIC;
openRegionListBottomSheet(context, bottomSheetType);
getIt.get<BookAppointmentsViewModel>().setSelectedClinic(
GetClinicsListResponseModel(clinicID: 108, clinicDescription: "Bariatics", clinicDescriptionN: "Bariatics"),
);
getIt.get<BookAppointmentsViewModel>().setIsDoctorsListLoading(true);
},
icon: null, icon: null,
fontSize: 16.f, fontSize: 16.f,
backgroundColor: AppColors.primaryRedColor, backgroundColor: AppColors.primaryRedColor,
@ -38,6 +54,19 @@ class HealthCalculatorResultPage extends StatelessWidget {
); );
} }
void openRegionListBottomSheet(BuildContext context, RegionBottomSheetType type) {
getIt.get<BookAppointmentsViewModel>().setProjectID(null);
getIt.get<AppointmentViaRegionViewmodel>().flush();
getIt.get<AppointmentViaRegionViewmodel>().setBottomSheetType(type);
showCommonBottomSheetWithoutHeight(context,
title: "",
titleWidget: Consumer<AppointmentViaRegionViewmodel>(builder: (_, data, __) => LocaleKeys.selectRegion.tr().toText20(weight: FontWeight.w600)),
isDismissible: false, child: Consumer<AppointmentViaRegionViewmodel>(builder: (_, data, __) {
return RegionBottomSheetBody();
}), callBackFunc: () {});
}
Widget getCalculatorResultWidget({required HealthCalculatorsTypeEnum type, dynamic calculatedResult}) { Widget getCalculatorResultWidget({required HealthCalculatorsTypeEnum type, dynamic calculatedResult}) {
switch (calculatorType) { switch (calculatorType) {
case HealthCalculatorsTypeEnum.bmi: case HealthCalculatorsTypeEnum.bmi:

@ -155,8 +155,8 @@ class ServicesPage extends StatelessWidget {
AppAssets.smartwatch_icon, AppAssets.smartwatch_icon,
bgColor: AppColors.whiteColor, bgColor: AppColors.whiteColor,
true, true,
// route: AppRoutes.smartWatches, route: AppRoutes.smartWatches,
route: AppRoutes.huaweiHealthExample, // route: AppRoutes.huaweiHealthExample,
), ),
]; ];

@ -74,7 +74,7 @@ class _InsuranceHomePageState extends State<InsuranceHomePage> {
padding: EdgeInsets.only(top: 24.h), padding: EdgeInsets.only(top: 24.h),
child: PatientInsuranceCard( child: PatientInsuranceCard(
insuranceCardDetailsModel: insuranceVM.patientInsuranceList.first, insuranceCardDetailsModel: insuranceVM.patientInsuranceList.first,
isInsuranceExpired: DateTime.now().isAfter(DateUtil.convertStringToDate(insuranceVM.patientInsuranceList.first.cardValidTo))), isInsuranceExpired: DateTime.now().isAfter(DateUtil.convertStringToDate(insuranceVM.patientInsuranceList.first.cardValidTo))).paddingSymmetrical(24.w, 0.h),
) )
: Padding( : Padding(
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.12), padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.12),

@ -4,15 +4,18 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:health/health.dart'; import 'package:health/health.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.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/size_utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.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/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/smartwatches/health_dashboard/health_dashboard.dart'; import 'package:hmg_patient_app_new/presentation/smartwatches/health_dashboard/health_dashboard.dart';
import 'package:hmg_patient_app_new/services/dialog_service.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/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.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:url_launcher/url_launcher.dart';
class SmartwatchInstructionsPage extends StatelessWidget { class SmartwatchInstructionsPage extends StatelessWidget {
const SmartwatchInstructionsPage({super.key}); const SmartwatchInstructionsPage({super.key});
@ -178,19 +181,20 @@ class SmartwatchInstructionsPage extends StatelessWidget {
await Health().getHealthConnectSdkStatus().then((val) { await Health().getHealthConnectSdkStatus().then((val) {
print('Health Connect SDK Status: $val'); print('Health Connect SDK Status: $val');
if (val == HealthConnectSdkStatus.sdkAvailable) { if (val == HealthConnectSdkStatus.sdkAvailable) {
// Navigator.of(context).push( Navigator.of(context).push(
// FadePage( CustomPageRoute(
// page: HealthDashboard(), // Replace with the actual vital signs page page: HealthDashboard(),
// // page: HealthApp(), // Replace with the actual vital signs page ),
// ), );
// );
} else { } else {
// Utils.showAppDialog(context, LocaleKeys.error.tr(context: context), LocaleKeys.healthConnectNotInstalled.tr(), () { getIt.get<DialogService>().showErrorBottomSheet(
// Navigator.pop(context); message: "Seems like you do not have Health Connect App installed. Please install it from the Play Store to sync your health data.".needTranslation,
// Uri uri = Uri.parse("https://play.google.com/store/apps/details?id=com.google.android.apps.healthdata"); onOkPressed: () {
// launchUrl(uri, mode: LaunchMode.externalApplication); Navigator.pop(context);
// }); Uri uri = Uri.parse("https://play.google.com/store/apps/details?id=com.google.android.apps.healthdata");
// return; launchUrl(uri, mode: LaunchMode.externalApplication);
});
return;
} }
}); });
}, },

Loading…
Cancel
Save