Merge pull request 'haroon_dev' (#122) from haroon_dev into master

Reviewed-on: https://34.17.182.140/Haroon6138/HMG_Patient_App_New/pulls/122
pull/123/head
Haroon6138 1 month ago
commit 7d0a42fd32

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 KiB

@ -0,0 +1,6 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect y="0.601562" width="23.9969" height="22.797" rx="2" fill="white"/>
<path d="M3.89483 19.6919H5.25951L9.53761 19.7099C10.0472 19.7099 10.4728 19.171 10.4952 18.3841L10.4998 14.8137C10.4998 14.0545 10.8393 13.4526 11.3673 13.4203L12.6758 13.4135C13.2038 13.4435 13.5663 14.0509 13.5663 14.8062L13.5617 18.3938C13.5841 19.1792 13.942 19.6911 14.4515 19.6911L20.206 19.7009L20.2145 15.2862C20.2145 14.5278 19.8481 13.9371 19.3201 13.9056L17.0071 13.895C16.4967 13.895 16.0941 13.3523 16.0718 12.5677L16.0626 11.3741C16.0888 10.5926 16.492 10.055 17.0062 10.055L19.3331 10.0648C19.8604 10.0279 20.206 9.40653 20.206 8.64733L20.2191 3.13971C20.0284 3.44995 19.7683 3.71155 19.4592 3.9044C19.1502 4.09726 18.8006 4.21561 18.438 4.2507H14.5277C14.0174 4.2507 13.5925 4.80324 13.5702 5.58629V9.12432C13.5479 9.90891 13.1453 10.4614 12.635 10.4614L11.4535 10.4539C10.9393 10.4539 10.5298 9.91549 10.5091 9.13859L10.5137 5.5615C10.4913 4.77922 10.0842 4.2537 9.57463 4.2537H3.88712V8.65484C3.88712 9.41481 4.2412 10.0234 4.77307 10.0588L7.0999 10.0513C7.62255 10.0843 7.99901 10.7104 7.99901 11.465L7.98971 12.4888C7.98971 13.2457 7.63179 13.8545 7.10376 13.8868L4.77693 13.88C4.23812 13.9123 3.88637 14.5143 3.88637 15.2719L3.89483 19.6919ZM23.4458 2.82947V21.225C23.4166 21.8304 23.1537 22.4008 22.7125 22.8168C22.2713 23.2327 21.6862 23.4621 21.0797 23.456H2.90571C2.30022 23.4627 1.7159 23.2331 1.27653 22.8168C0.837163 22.4004 0.577278 21.8296 0.55191 21.225V2.79492C0.578988 2.18963 0.83989 1.61869 1.27973 1.20167C1.71956 0.784655 2.30404 0.553881 2.91031 0.558667L21.0627 0.569183C21.6742 0.567661 22.2628 0.801845 22.7061 1.22271C23.1495 1.64357 23.4135 2.21911 23.4434 2.82947H23.4458Z" fill="#359846"/>
<path d="M2.90647 24.0008C2.1569 24.0072 1.43431 23.7215 0.891776 23.2046C0.349239 22.6877 0.0293805 21.9805 0 21.232V2.78688C0.0273547 2.03703 0.345295 1.32752 0.886609 0.807527C1.42792 0.287533 2.15027 -0.00228064 2.90112 1.35172e-05L21.0665 0.0097788C21.8214 0.0135641 22.5462 0.306465 23.0918 0.827809C23.6374 1.34915 23.9624 2.05973 24 2.81317V21.2185C23.9697 21.9678 23.6496 22.6765 23.1073 23.1948C22.5649 23.7132 21.8425 24.001 21.092 23.9978L2.90647 24.0008ZM2.90647 1.1095C2.44487 1.10277 1.99877 1.27528 1.66216 1.591C1.32554 1.90672 1.12475 2.34036 1.10225 2.80115V21.2192C1.12864 21.6782 1.33199 22.1088 1.66958 22.4211C2.00717 22.7334 2.45276 22.9027 2.91267 22.8936H21.0735C21.5349 22.9007 21.9813 22.7297 22.3193 22.4158C22.6574 22.102 22.861 21.6698 22.8878 21.2095V2.8327C22.858 2.36642 22.6513 1.92972 22.3098 1.61053C21.9684 1.29135 21.5179 1.11417 21.0504 1.11551H20.7764L20.7579 8.64454C20.7579 9.74989 20.1868 10.5572 19.3724 10.6134H19.3324L17.0062 10.6029C16.833 10.6029 16.6329 10.9186 16.6168 11.3893L16.6261 12.5597C16.6407 13.0627 16.857 13.3356 17.0109 13.3356L19.357 13.3507C20.1768 13.3991 20.7718 14.2127 20.7718 15.2827L20.7617 20.2495L14.4554 20.2352C13.6249 20.2352 13.0446 19.5014 13.0138 18.4061L13.0176 14.8012C13.0176 14.3289 12.8313 13.9852 12.6589 13.9599L11.3927 13.9711C11.2303 13.9919 11.054 14.3348 11.054 14.8102L11.0494 18.3843C11.0187 19.4573 10.3697 20.2577 9.53922 20.2577L5.25877 20.2359C4.69918 20.2359 3.90019 20.2359 3.90019 20.2359L3.34527 20.2419L3.33991 15.2624C3.33991 14.1671 3.92019 13.3683 4.75072 13.3199H4.78389H7.08761C7.23616 13.2999 7.44325 12.9963 7.44325 12.4733L7.4517 11.4479C7.4517 10.9518 7.2354 10.6148 7.07915 10.5863L4.76078 10.5953H4.74076C3.91562 10.54 3.33906 9.73467 3.33906 8.63778V3.68678L9.57849 3.68153C10.4136 3.68153 11.0409 4.46103 11.0717 5.52792L11.0671 9.12229C11.0802 9.57228 11.2804 9.88248 11.4582 9.88248L12.6435 9.893C12.7866 9.893 13.0076 9.60835 13.0222 9.09375V5.56923C13.0522 4.4885 13.7011 3.68002 14.5324 3.68002L18.4279 3.68528C18.6954 3.65252 18.9522 3.56118 19.1798 3.41711C19.4074 3.27304 19.6002 3.07984 19.7441 2.85223L20.7395 1.10574L2.90647 1.1095ZM5.25651 19.1332L9.53687 19.152C9.69081 19.152 9.9218 18.8731 9.93874 18.3685L9.94334 14.8117C9.94334 13.7171 10.5136 12.9184 11.3288 12.8692H11.3573L12.6874 12.8564L12.7051 12.8609C13.5226 12.9101 14.116 13.7266 14.116 14.8027L14.1113 18.3903C14.1229 18.8011 14.2715 19.1325 14.4493 19.1325L19.651 19.1445L19.6595 15.2834C19.6595 14.8119 19.4725 14.4742 19.2939 14.4526L17.0009 14.4429C16.1727 14.4429 15.5469 13.6598 15.5161 12.583L15.5068 11.3766C15.5438 10.2805 16.1735 9.50089 17.004 9.50089L19.3047 9.5099C19.4532 9.48221 19.6503 9.15218 19.6503 8.64605L19.6603 4.43345C19.2983 4.65266 18.8876 4.7796 18.4649 4.80228H18.4357L14.5239 4.79702C14.3653 4.79702 14.1344 5.1047 14.1198 5.59853V9.11703C14.0882 10.2201 13.4625 11.0092 12.6312 11.0092L11.4466 10.9995C10.6145 10.9995 9.98407 10.2193 9.95405 9.14933L9.95875 5.55421C9.94566 5.1073 9.74785 4.79702 9.57389 4.79702L4.43981 4.80228V8.6483C4.43981 9.12598 4.62604 9.477 4.79845 9.50239L7.11767 9.49337H7.13694C7.95669 9.54645 8.55169 10.3754 8.55169 11.4607L8.54315 12.4853C8.54315 13.5622 7.9513 14.3794 7.13694 14.4293H7.10302L4.7993 14.4241C4.6238 14.4441 4.43981 14.7825 4.43981 15.2609L4.44366 19.1272L5.25651 19.1332Z" fill="white"/>
<path d="M2.26614 20.5312L1.73264 20.1909C4.0904 16.2827 7.40269 13.037 11.3589 10.7576C11.6375 10.6038 11.933 10.4533 12.2386 10.2957C14.1607 9.41494 15.8961 8.17444 17.3511 6.64118C18.7944 5.0393 19.8921 3.15779 20.5755 1.11328L21.1758 1.31835C20.4653 3.44482 19.322 5.401 17.8176 7.0641C16.31 8.65125 14.5155 9.93942 12.5288 10.8598C12.2286 11.0136 11.9392 11.1672 11.6591 11.321C7.80001 13.5489 4.56854 16.7178 2.26614 20.5312Z" fill="#359846"/>
</svg>

After

Width:  |  Height:  |  Size: 5.5 KiB

@ -454,8 +454,6 @@ var GET_ANCILLARY_ORDERS_DETAILS = 'Services/Doctors.svc/REST/GetOnlineAncillary
//Pharmacy wishlist
// var GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/";
var GET_DOCTOR_LIST_BY_TIME = "Services/Doctors.svc/REST/SearchDoctorsByTime";
// pharmacy
var PHARMACY_AUTORZIE_CUSTOMER = "AutorizeCustomer";
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=';
var GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory';
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;
@ -703,7 +700,7 @@ var GET_PRESCRIPTION_INSTRUCTIONS_PDF = 'Services/ChatBot_Service.svc/REST/Chatb
class ApiConsts {
static const maxSmallScreen = 660;
static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod;
static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat;
// static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT

@ -221,6 +221,7 @@ class AppAssets {
static const String trade_down_yellow = '$svgBasePath/trade_down_yellow.svg';
static const String trade_down_red = '$svgBasePath/trade_down_red.svg';
static const String pharmacy_icon = '$svgBasePath/phramacy_icon.svg';
//bottom navigation//
static const String homeBottom = '$svgBasePath/home_bottom.svg';
@ -249,6 +250,10 @@ class AppAssets {
// PNGS //
static const String hmgLogo = '$pngBasePath/hmg_logo.png';
static const String liveCareService = '$pngBasePath/livecare_service.png';
static const String homeHealthCareService = '$pngBasePath/home_health_care.png';
static const String pharmacyService = '$pngBasePath/pharmacy_service.png';
static const String maleImg = '$pngBasePath/male_img.png';
static const String femaleImg = '$pngBasePath/female_img.png';
static const String babyGirlImg = '$pngBasePath/baby_girl_img.png';

@ -925,4 +925,11 @@ class Utils {
return "";
}
static bool isDateToday(DateTime dateToCheck) {
final DateTime now = DateTime.now();
final DateTime today = DateTime(now.year, now.month, now.day);
final DateTime checkDate = DateTime(dateToCheck.year, dateToCheck.month, dateToCheck.day);
return checkDate == today;
}
}

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/utils/date_util.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/appointemnet_filters.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/ask_doctor_request_type_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/get_tamara_installments_details_response_model.dart';
@ -226,7 +227,10 @@ class MyAppointmentsViewModel extends ChangeNotifier {
filteredAppointmentList.addAll(patientAppointmentsHistoryList);
if (patientArrivedAppointmentsHistoryList.isNotEmpty) {
getPatientAppointmentQueueDetails(appointmentNo: patientArrivedAppointmentsHistoryList.first.appointmentNo, patientID: patientArrivedAppointmentsHistoryList.first.patientID);
if (Utils.isDateToday(DateUtil.convertStringToDate(patientArrivedAppointmentsHistoryList.first.appointmentDate))) {
// getPatientAppointmentQueueDetails(appointmentNo: patientArrivedAppointmentsHistoryList.first.appointmentNo, patientID: patientArrivedAppointmentsHistoryList.first.patientID);
getPatientAppointmentQueueDetails();
}
}
print('Upcoming Appointments: ${patientUpcomingAppointmentsHistoryList.length}');
@ -670,10 +674,11 @@ class MyAppointmentsViewModel extends ChangeNotifier {
);
}
Future<void> getPatientAppointmentQueueDetails({required int appointmentNo, required int patientID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
Future<void> getPatientAppointmentQueueDetails({Function(dynamic)? onSuccess, Function(String)? onError}) async {
isAppointmentQueueDetailsLoading = true;
notifyListeners();
final result = await myAppointmentsRepo.getPatientAppointmentQueueDetails(appointmentNo: appointmentNo, patientID: patientID);
final result = await myAppointmentsRepo.getPatientAppointmentQueueDetails(
appointmentNo: patientArrivedAppointmentsHistoryList.first.appointmentNo, patientID: patientArrivedAppointmentsHistoryList.first.patientID);
isAppointmentQueueDetailsLoading = false;
@ -692,7 +697,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
isPatientHasQueueAppointment = true;
patientQueueDetailsList = apiResponse.data!;
for (var element in patientQueueDetailsList) {
if (element.patientID == patientID) {
if (element.patientID == patientArrivedAppointmentsHistoryList.first.patientID) {
currentPatientQueueDetails = element;
currentQueueStatus = element.callType!;
// currentQueueStatus = 2;
@ -701,7 +706,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
}
// patientQueueDetailsList.first.callType = 1;
patientQueueDetailsList.removeWhere((element) => element.patientID == patientID);
patientQueueDetailsList.removeWhere((element) => element.patientID == patientArrivedAppointmentsHistoryList.first.patientID);
} else {
isPatientHasQueueAppointment = false;
}

@ -114,7 +114,7 @@ class AppointmentQueuePage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"IMD W-A-2".needTranslation.toText17(isBold: true),
myAppointmentsVM.patientQueueDetailsList[index].queueNo!.toText17(isBold: true),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [

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

@ -149,7 +149,7 @@ class AppointmentCheckinBottomSheet extends StatelessWidget {
onSuccess: (apiResponse) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(context, title: "Success".needTranslation, child: Utils.getSuccessWidget(loadingText: LocaleKeys.success.tr()), callBackFunc: () async {
await myAppointmentsViewModel.getPatientAppointmentQueueDetails(appointmentNo: patientAppointmentHistoryResponseModel.appointmentNo, patientID: patientAppointmentHistoryResponseModel.patientID);
await myAppointmentsViewModel.getPatientAppointmentQueueDetails();
Navigator.of(context).pop();
Navigator.pushAndRemoveUntil(
context,

@ -54,7 +54,7 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
void initState() {
authVM = context.read<AuthenticationViewModel>();
scheduleMicrotask(() {
bookAppointmentsViewModel.selectedTabIndex = 0;
// bookAppointmentsViewModel.selectedTabIndex = 0;
bookAppointmentsViewModel.initBookAppointmentViewModel();
bookAppointmentsViewModel.getLocation();
immediateLiveCareViewModel.initImmediateLiveCare();
@ -68,6 +68,7 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
immediateLiveCareViewModel = Provider.of<ImmediateLiveCareViewModel>(context, listen: false);
appState = getIt.get<AppState>();
regionalViewModel = Provider.of<AppointmentViaRegionViewmodel>(context, listen: true);
getSelectedTabData(bookAppointmentsViewModel.selectedTabIndex);
return Scaffold(
backgroundColor: AppColors.bgScaffoldColor,
body: Column(
@ -85,6 +86,7 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
CustomTabBar(
activeTextColor: Color(0xffED1C2B),
activeBackgroundColor: Color(0xffED1C2B).withValues(alpha: .1),
initialIndex: bookAppointmentsVM.selectedTabIndex,
tabs: [
CustomTabBarModel(null, "General".needTranslation),
CustomTabBarModel(null, "LiveCare".needTranslation),
@ -323,8 +325,10 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
).paddingSymmetrical(24.h, 0.h);
case 1:
//TODO: Get LiveCare type Select UI from Hussain
return appState.isAuthenticated
? Column(
return
// appState.isAuthenticated
// ?
Column(
children: [
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
@ -445,7 +449,8 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
),
],
).paddingSymmetrical(24.h, 0.h)
: getLiveCareNotLoggedInUI();
// : getLiveCareNotLoggedInUI()
;
default:
SizedBox.shrink();
}

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

@ -1,22 +1,37 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.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/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/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/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/theme/colors.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 {
final VoidCallback? onNegativeClicked;
const SelectLivecareClinicPage({super.key, this.onNegativeClicked});
late GetClinicsListResponseModel selectedClinic;
SelectLivecareClinicPage({super.key, this.onNegativeClicked, required this.selectedClinic});
late ImmediateLiveCareViewModel immediateLiveCareViewModel;
@override
Widget build(BuildContext context) {
immediateLiveCareViewModel = Provider.of<ImmediateLiveCareViewModel>(context, listen: false);
return Scaffold(
backgroundColor: AppColors.bgScaffoldColor,
body: Column(
@ -103,7 +118,36 @@ class SelectLivecareClinicPage extends StatelessWidget {
children: [
CustomButton(
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,
borderColor: AppColors.primaryRedColor,
textColor: AppColors.whiteColor,

@ -1,15 +1,23 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.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/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/my_appointments/appointment_via_region_viewmodel.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/widgets/appbar/collapsing_list_view.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 {
HealthCalculatorsTypeEnum calculatorType;
@ -26,7 +34,15 @@ class HealthCalculatorResultPage extends StatelessWidget {
padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 20.h),
child: CustomButton(
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,
fontSize: 16.f,
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}) {
switch (calculatorType) {
case HealthCalculatorsTypeEnum.bmi:

@ -1,5 +1,6 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:get_it/get_it.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_export.dart';
@ -17,6 +18,8 @@ import 'package:hmg_patient_app_new/presentation/contact_us/contact_us.dart';
import 'package:hmg_patient_app_new/presentation/habib_wallet/habib_wallet_page.dart';
import 'package:hmg_patient_app_new/presentation/habib_wallet/recharge_wallet_page.dart';
import 'package:hmg_patient_app_new/presentation/hmg_services/services_view.dart';
import 'package:hmg_patient_app_new/presentation/home/data/landing_page_data.dart';
import 'package:hmg_patient_app_new/presentation/home/widgets/large_service_card.dart';
import 'package:hmg_patient_app_new/presentation/medical_file/medical_file_page.dart';
import 'package:hmg_patient_app_new/services/dialog_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
@ -95,15 +98,15 @@ class ServicesPage extends StatelessWidget {
LoaderBottomSheet.hideLoader();
});
}),
HmgServicesComponentModel(
3,
"Home Health Care".needTranslation,
"".needTranslation,
AppAssets.homeBottom,
bgColor: AppColors.primaryRedColor,
true,
route: AppRoutes.homeHealthCarePage,
),
// HmgServicesComponentModel(
// 3,
// "Home Health Care".needTranslation,
// "".needTranslation,
// AppAssets.homeBottom,
// bgColor: AppColors.primaryRedColor,
// true,
// route: AppRoutes.homeHealthCarePage,
// ),
// HmgServicesComponentModel(
// 11,
// "Virtual Tour".needTranslation,
@ -155,8 +158,8 @@ class ServicesPage extends StatelessWidget {
AppAssets.smartwatch_icon,
bgColor: AppColors.whiteColor,
true,
// route: AppRoutes.smartWatches,
route: AppRoutes.huaweiHealthExample,
route: AppRoutes.smartWatches,
// route: AppRoutes.huaweiHealthExample,
),
];
@ -169,13 +172,11 @@ class ServicesPage extends StatelessWidget {
body: CollapsingListView(
title: "Explore Services".needTranslation,
isLeading: false,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 24.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 16.h),
"Medical & Care Services".needTranslation.toText18(isBold: true),
"Medical & Care Services".needTranslation.toText18(isBold: true).paddingSymmetrical(24.w, 0),
SizedBox(height: 16.h),
GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
@ -191,9 +192,40 @@ class ServicesPage extends StatelessWidget {
itemBuilder: (BuildContext context, int index) {
return ServiceGridViewItem(hmgServices[index], index, false, isHealthToolIcon: false);
},
).paddingSymmetrical(24.w, 0),
SizedBox(height: 24.h),
"HMG Services".needTranslation.toText18(isBold: true).paddingSymmetrical(24.w, 0),
SizedBox(height: 16.h),
SizedBox(
height: 350.h,
child: ListView.separated(
scrollDirection: Axis.horizontal,
itemCount: LandingPageData.getServiceCardsList.length,
shrinkWrap: true,
padding: EdgeInsets.symmetric(horizontal: 24.w),
itemBuilder: (context, index) {
return AnimationConfiguration.staggeredList(
position: index,
duration: const Duration(milliseconds: 1000),
child: SlideAnimation(
horizontalOffset: 100.0,
child: FadeInAnimation(
child: LargeServiceCard(
serviceCardData: LandingPageData.getServiceCardsList[index],
image: LandingPageData.getServiceCardsList[index].icon,
title: LandingPageData.getServiceCardsList[index].title,
subtitle: LandingPageData.getServiceCardsList[index].subtitle,
icon: LandingPageData.getServiceCardsList[index].largeCardIcon,
),
),
),
);
},
separatorBuilder: (BuildContext cxt, int index) => SizedBox(width: 16.w),
),
),
SizedBox(height: 24.h),
"Personal Services".needTranslation.toText18(isBold: true),
"Personal Services".needTranslation.toText18(isBold: true).paddingSymmetrical(24.w, 0),
SizedBox(height: 16.h),
Row(
children: [
@ -336,9 +368,9 @@ class ServicesPage extends StatelessWidget {
),
),
],
),
).paddingSymmetrical(24.w, 0),
SizedBox(height: 24.h),
"Health Tools".needTranslation.toText18(isBold: true),
"Health Tools".needTranslation.toText18(isBold: true).paddingSymmetrical(24.w, 0),
SizedBox(height: 16.h),
GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
@ -359,9 +391,9 @@ class ServicesPage extends StatelessWidget {
isHealthToolIcon: true,
);
},
),
).paddingSymmetrical(24.w, 0),
SizedBox(height: 24.h),
"Support Services".needTranslation.toText18(isBold: true),
"Support Services".needTranslation.toText18(isBold: true).paddingSymmetrical(24.w, 0),
SizedBox(height: 16.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -490,12 +522,11 @@ class ServicesPage extends StatelessWidget {
],
)
],
),
).paddingSymmetrical(24.w, 0),
SizedBox(height: 24.h),
],
),
),
),
);
}
}

@ -142,44 +142,42 @@ class LandingPageData {
static List<ServiceCardData> getServiceCardsList = [
ServiceCardData(
icon: AppAssets.liveCareService,
serviceName: "livecare",
icon: AppAssets.small_livecare_icon,
title: "LiveCare",
subtitle: "Explore our app, View our services and offers",
largeCardIcon: AppAssets.livecare_icon,
backgroundColor: Colors.transparent,
iconColor: Colors.transparent,
textColor: Colors.transparent,
isBold: true,
),
ServiceCardData(
icon: AppAssets.lab_result_icon,
title: "Dermatology",
subtitle: "Explore our app, View our services and offers",
largeCardIcon: AppAssets.livecare_icon,
backgroundColor: AppColors.whiteColor,
iconColor: AppColors.blackColor,
textColor: AppColors.blackColor,
largeCardIcon: AppAssets.liveCareService,
backgroundColor: AppColors.successColor,
iconColor: AppColors.whiteColor,
isBold: false,
),
ServiceCardData(
icon: AppAssets.my_prescription_icon,
// ServiceCardData(
// icon: AppAssets.homeBottom,
// title: "Dermatology",
// subtitle: "Explore our app, View our services and offers",
// largeCardIcon: AppAssets.homeBottom,
// backgroundColor: AppColors.primaryRedColor,
// isBold: false,
// ),
ServiceCardData(
serviceName: "home_health_care",
icon: AppAssets.homeBottom,
title: "Home Health Care",
subtitle: "Explore our app, View our services and offers",
largeCardIcon: AppAssets.livecare_icon,
backgroundColor: AppColors.whiteColor,
iconColor: AppColors.blackColor,
textColor: AppColors.blackColor,
largeCardIcon: AppAssets.homeHealthCareService,
backgroundColor: AppColors.primaryRedColor,
iconColor: AppColors.whiteColor,
isBold: false,
),
ServiceCardData(
icon: AppAssets.insurance_update_icon,
serviceName: "pharmacy",
icon: AppAssets.pharmacy_icon, //359846
title: "Pharmacy",
subtitle: "Explore our app, View our services and offers",
largeCardIcon: AppAssets.livecare_icon,
backgroundColor: AppColors.whiteColor,
iconColor: AppColors.blackColor,
textColor: AppColors.blackColor,
isBold: false,
largeCardIcon: AppAssets.pharmacyService,
backgroundColor: AppColors.pharmacyBGColor,
iconColor: null,
isBold: true,
),
];
}

@ -7,7 +7,7 @@ class ServiceCardData {
final String icon;
final String title;
final String subtitle;
final Color iconColor;
final Color? iconColor;
final Color textColor;
final Color backgroundColor;
final bool isBold;
@ -22,6 +22,6 @@ class ServiceCardData {
this.backgroundColor = AppColors.whiteColor,
this.iconColor = AppColors.blackColor,
this.textColor = AppColors.blackColor,
this.isBold = false,
this.isBold = false
});
}

@ -107,6 +107,7 @@ class _LandingPageState extends State<LandingPage> {
prescriptionsViewModel.initPrescriptionsViewModel();
insuranceViewModel.initInsuranceProvider();
emergencyServicesViewModel.checkPatientERAdvanceBalance();
myAppointmentsViewModel.getPatientAppointmentQueueDetails();
appointmentRatingViewModel.getLastRatingAppointment(onSuccess: (response) {
if (appointmentRatingViewModel.appointmentRatedList.isNotEmpty) {
appointmentRatingViewModel.getAppointmentDetails(appointmentRatingViewModel.appointmentRatedList.last.appointmentNo!, appointmentRatingViewModel.appointmentRatedList.last.projectID!,
@ -305,15 +306,15 @@ class _LandingPageState extends State<LandingPage> {
Utils.buildSvgWithAssets(icon: AppAssets.waiting_icon, width: 24.h, height: 24.h),
],
),
SizedBox(height: 10.h),
"Hala ${appState.getAuthenticatedUser()!.firstName}!!!".needTranslation.toText16(isBold: true),
SizedBox(height: 8.h),
"Hala ${appState.getAuthenticatedUser()!.firstName}!!!".needTranslation.toText16(isBold: true),
SizedBox(height: 2.h),
"Thank you for your patience, here is your queue number."
.needTranslation
.toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight),
SizedBox(height: 8.h),
myAppointmentsVM.currentPatientQueueDetails.queueNo!.toText28(isBold: true),
SizedBox(height: 12.h),
SizedBox(height: 6.h),
myAppointmentsVM.patientQueueDetailsList.isNotEmpty ? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
@ -337,7 +338,7 @@ class _LandingPageState extends State<LandingPage> {
),
],
) : SizedBox(height: 12.h),
SizedBox(height: 8.h),
SizedBox(height: 5.h),
CustomButton(
text: Utils.getCardButtonText(myAppointmentsVM.currentQueueStatus, myAppointmentsVM.currentPatientQueueDetails.roomNo ?? ""),
onPressed: () {},
@ -479,6 +480,7 @@ class _LandingPageState extends State<LandingPage> {
CustomButton(
text: LocaleKeys.bookAppo.tr(context: context),
onPressed: () {
getIt.get<BookAppointmentsViewModel>().onTabChanged(0);
Navigator.of(context).push(CustomPageRoute(page: BookAppointmentPage()));
},
backgroundColor: Color(0xffFEE9EA),
@ -595,7 +597,7 @@ class _LandingPageState extends State<LandingPage> {
icon: LandingPageData.getLoggedInServiceCardsList[index].icon,
title: LandingPageData.getLoggedInServiceCardsList[index].title,
subtitle: LandingPageData.getLoggedInServiceCardsList[index].subtitle,
iconColor: LandingPageData.getLoggedInServiceCardsList[index].iconColor,
iconColor: LandingPageData.getLoggedInServiceCardsList[index].iconColor!,
textColor: LandingPageData.getLoggedInServiceCardsList[index].textColor,
backgroundColor: LandingPageData.getLoggedInServiceCardsList[index].backgroundColor,
isBold: LandingPageData.getLoggedInServiceCardsList[index].isBold,
@ -636,7 +638,7 @@ class _LandingPageState extends State<LandingPage> {
icon: LandingPageData.getNotLoggedInServiceCardsList[index].icon,
title: LandingPageData.getNotLoggedInServiceCardsList[index].title,
subtitle: LandingPageData.getNotLoggedInServiceCardsList[index].subtitle,
iconColor: LandingPageData.getNotLoggedInServiceCardsList[index].iconColor,
iconColor: LandingPageData.getNotLoggedInServiceCardsList[index].iconColor!,
textColor: LandingPageData.getNotLoggedInServiceCardsList[index].textColor,
backgroundColor: LandingPageData.getNotLoggedInServiceCardsList[index].backgroundColor,
isBold: LandingPageData.getNotLoggedInServiceCardsList[index].isBold,
@ -681,6 +683,7 @@ class _LandingPageState extends State<LandingPage> {
horizontalOffset: 100.0,
child: FadeInAnimation(
child: LargeServiceCard(
serviceCardData: LandingPageData.getServiceCardsList[index],
image: LandingPageData.getServiceCardsList[index].icon,
title: LandingPageData.getServiceCardsList[index].title,
subtitle: LandingPageData.getServiceCardsList[index].subtitle,
@ -690,7 +693,7 @@ class _LandingPageState extends State<LandingPage> {
),
);
},
separatorBuilder: (BuildContext cxt, int index) => SizedBox(width: 8.w),
separatorBuilder: (BuildContext cxt, int index) => SizedBox(width: 16.w),
),
),
appState.isAuthenticated ? HabibWalletCard() : SizedBox(),

@ -2,6 +2,7 @@ import 'package:flutter/material.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/extensions/route_extensions.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart';
import 'package:hmg_patient_app_new/presentation/contact_us/feedback_page.dart';
import 'package:hmg_patient_app_new/presentation/hmg_services/services_page.dart';
import 'package:hmg_patient_app_new/presentation/home/landing_page.dart';
@ -41,6 +42,7 @@ class _LandingNavigationState extends State<LandingNavigation> {
onTap: (index) {
setState(() => _currentIndex = index);
if (_currentIndex == 2) {
getIt.get<BookAppointmentsViewModel>().onTabChanged(0);
context.navigateWithName(AppRoutes.bookAppointmentPage);
return;
}

@ -1,16 +1,26 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/api_consts.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/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/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/book_appointment_page.dart';
import 'package:hmg_patient_app_new/presentation/home/data/service_card_data.dart';
import 'package:hmg_patient_app_new/presentation/home_health_care/hhc_procedures_page.dart';
import 'package:hmg_patient_app_new/services/navigation_service.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:url_launcher/url_launcher.dart';
import '../../../core/utils/utils.dart';
import '../../../theme/colors.dart';
class LargeServiceCard extends StatelessWidget {
final ServiceCardData serviceCardData;
final String image;
final String icon;
final String title;
@ -18,6 +28,7 @@ class LargeServiceCard extends StatelessWidget {
const LargeServiceCard({
super.key,
required this.serviceCardData,
this.image = "",
this.icon = "",
this.title = "",
@ -27,37 +38,112 @@ class LargeServiceCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
width: 150.w,
padding: EdgeInsets.symmetric(horizontal: 3.w),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: Colors.transparent, borderRadius: 16.r),
height: 350.h,
width: 230.w,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.transparent, borderRadius: 24.r),
child: Stack(
children: [
ClipRRect(
borderRadius: BorderRadius.circular(24.r),
child: Image.asset(
serviceCardData.largeCardIcon,
fit: BoxFit.cover,
),
),
Positioned(
bottom: 0.0, // Positions the child 0 logical pixels from the bottom
left: 0.0,
right: 0.0,
child: Container(
height: 180.h,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
customBorder: BorderRadius.only(
bottomLeft: Radius.circular(24.r),
bottomRight: Radius.circular(24.r),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(AppAssets.liveCareService, width: 220.w, fit: BoxFit.contain),
SizedBox(height: 10.h),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 48.h,
width: 48.w,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: serviceCardData.backgroundColor,
borderRadius: 12.r,
hasShadow: false,
),
child: Padding(
padding: EdgeInsets.all(12.h),
child: Utils.buildSvgWithAssets(
icon: serviceCardData.icon,
iconColor: serviceCardData.iconColor,
fit: BoxFit.contain,
),
),
),
SizedBox(width: 12.w),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Utils.buildSvgWithAssets(icon: icon, width: 24.w, height: 24.h),
Flexible(child: title.toText14(color: AppColors.blackColor, isBold: true, textOverflow: TextOverflow.clip, maxlines: 1)),
serviceCardData.title.toText14(isBold: true, color: AppColors.textColor),
SizedBox(width: 6.h),
serviceCardData.subtitle.toText14(weight: FontWeight.w500, color: AppColors.textColorLight),
],
),
subtitle.toText11(color: AppColors.blackColor),
SizedBox(height: 10.h),
),
],
).paddingSymmetrical(16.w, 20.h),
CustomButton(
text: LocaleKeys.bookNow.tr(context: context),
onPressed: () {},
backgroundColor: AppColors.borderOnlyColor,
borderColor: AppColors.borderOnlyColor,
textColor: AppColors.whiteColor,
text: serviceCardData.isBold ? "Visit Pharmacy Online".needTranslation : LocaleKeys.bookNow.tr(context: context),
onPressed: () {
handleOnTap();
},
backgroundColor: serviceCardData.isBold ? AppColors.successLightColor.withValues(alpha: 0.2) : AppColors.bgRedLightColor,
borderColor: serviceCardData.isBold ? AppColors.successLightColor.withValues(alpha: 0.01) : AppColors.bgRedLightColor,
textColor: serviceCardData.isBold ? AppColors.successColor : AppColors.primaryRedColor,
fontSize: 14.f,
fontWeight: FontWeight.bold,
borderRadius: 12.r,
padding: EdgeInsets.fromLTRB(10.w, 0, 10.w, 0),
fontWeight: FontWeight.w500,
borderRadius: 10.r,
height: 40.h,
).paddingSymmetrical(16.w, 0.h),
],
),
),
),
],
),
);
}
void handleOnTap() {
switch (serviceCardData.serviceName) {
case "livecare":
{
getIt.get<BookAppointmentsViewModel>().onTabChanged(1);
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).push(
CustomPageRoute(
page: BookAppointmentPage(),
),
);
}
case "home_health_care":
{
Navigator.of(getIt<NavigationService>().navigatorKey.currentContext!).push(
CustomPageRoute(
page: HhcProceduresPage(),
),
);
}
case "pharmacy":
{
Uri uri = Uri.parse(PHARMACY_REDIRECT_URL);
launchUrl(uri, mode: LaunchMode.externalApplication);
}
}
}
}

@ -74,7 +74,7 @@ class _InsuranceHomePageState extends State<InsuranceHomePage> {
padding: EdgeInsets.only(top: 24.h),
child: PatientInsuranceCard(
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: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.12),

@ -27,6 +27,7 @@ import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/allergies/allergies_list_page.dart';
import 'package:hmg_patient_app_new/presentation/appointments/my_appointments_page.dart';
import 'package:hmg_patient_app_new/presentation/appointments/my_doctors_page.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/ask_doctor_request_type_select.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/book_appointment_page.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/doctor_profile_page.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/appointment_calendar.dart';
@ -452,6 +453,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
CustomButton(
text: LocaleKeys.bookAppo.tr(context: context),
onPressed: () {
getIt.get<BookAppointmentsViewModel>().onTabChanged(0);
Navigator.of(context).push(
CustomPageRoute(
page: BookAppointmentPage(),
@ -492,8 +494,36 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
onRescheduleTap: () {
openDoctorScheduleCalendar(myAppointmentsVM.patientAppointmentsHistoryList[index]);
},
onAskDoctorTap: () {},
)),
onAskDoctorTap: () async {
LoaderBottomSheet.showLoader(loadingText: "Checking doctor availability...".needTranslation);
await myAppointmentsViewModel.isDoctorAvailable(
projectID: myAppointmentsVM.patientAppointmentsHistoryList[index].projectID,
doctorId: myAppointmentsVM.patientAppointmentsHistoryList[index].doctorID,
clinicId: myAppointmentsVM.patientAppointmentsHistoryList[index].clinicID,
onSuccess: (value) async {
if (value) {
await myAppointmentsViewModel.getAskDoctorRequestTypes(onSuccess: (val) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
title: LocaleKeys.askDoctor.tr(context: context),
child: AskDoctorRequestTypeSelect(
askDoctorRequestTypeList: myAppointmentsViewModel.askDoctorRequestTypeList,
myAppointmentsViewModel: myAppointmentsViewModel,
patientAppointmentHistoryResponseModel: myAppointmentsVM.patientAppointmentsHistoryList[index],
),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
});
} else {
print("Doctor is not available");
}
});
},
),
),
),
),
);

@ -28,10 +28,7 @@ class LabRadCard extends StatelessWidget {
AppState appState = getIt.get<AppState>();
return Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 18.r, hasShadow: false),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Utils.buildSvgWithAssets(
@ -44,44 +41,12 @@ class LabRadCard extends StatelessWidget {
Flexible(
child: labelText.toText12(isBold: true, maxLine: 2),
),
SizedBox(width: 12.w),
Transform.flip(
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon_small, width: 10.w, height: 10.h, fit: BoxFit.contain, iconColor: AppColors.textColor),
),
],
),
// SizedBox(height: 16.h),
// labOrderTests.isNotEmpty
// ? ListView.separated(
// scrollDirection: Axis.vertical,
// padding: EdgeInsets.zero,
// physics: NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// itemBuilder: (cxt, index) {
// return labOrderTests[index]
// .toText12(isBold: true, maxLine: 1)
// .toShimmer2(isShow: false, radius: 6.r, height: 24.h, width: 120.w)
// .toShimmer2(isShow: isLoading);
// },
// separatorBuilder: (cxt, index) => SizedBox(height: 8.h),
// itemCount: 3,
// )
// : "You don't have any records yet".needTranslation.toText13(
// color: AppColors.greyTextColor, isCenter: true),
// SizedBox(height: 16.h),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// SizedBox.shrink(),
// Transform.flip(
// flipX: appState.isArabic(),
// child: Utils.buildSvgWithAssets(
// icon: AppAssets.forward_arrow_icon_small, width: 15.w, height: 15.h, fit: BoxFit.contain, iconColor: AppColors.textColor)
// .toShimmer2(isShow: false, radius: 12.r),
// ),
// ],
// )
],
).paddingAll(12.w),
);
}

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

@ -33,6 +33,8 @@ class AppColors {
static const Color greyTextColor = Color(0xFF8F9AA3);
static const Color lightGrayBGColor = Color(0x142E3039);
static const Color pharmacyBGColor = Color(0xFF359846);
static const lightGreenColor = Color(0xFF0ccedde);
static const textGreenColor = Color(0xFF18C273);
static const Color ratingColorYellow = Color(0xFFFFAF15);

@ -14,7 +14,7 @@ class CustomTabBarModel {
}
class CustomTabBar extends StatefulWidget {
final int initialIndex = 0;
final int initialIndex;
final List<CustomTabBarModel> tabs;
final Color activeTextColor;
final Color activeBackgroundColor;
@ -25,6 +25,7 @@ class CustomTabBar extends StatefulWidget {
const CustomTabBar({
super.key,
required this.tabs,
this.initialIndex = 0,
this.activeTextColor = const Color(0xff2E3039),
this.inActiveTextColor = const Color(0xff898A8D),
this.activeBackgroundColor = const Color(0x142E3039),
@ -41,6 +42,7 @@ class CustomTabBarState extends State<CustomTabBar> {
@override
void initState() {
selectedIndex = widget.initialIndex;
super.initState();
}

Loading…
Cancel
Save