Merge branch 'haroon_dev' of http://34.17.182.140/Haroon6138/HMG_Patient_App_New into haroon_dev

pull/101/head
Haroon Amjad 4 months ago
commit 37a0692be4

@ -175,7 +175,7 @@ class ApiClientImp implements ApiClient {
} }
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// body['PatientID'] = 4772429; // body['PatientID'] = 763103;
// body['PatientID'] = 1231755; // body['PatientID'] = 1231755;
// body['PatientTypeID'] = 1; // body['PatientTypeID'] = 1;
// //

@ -72,13 +72,13 @@ class ContactUsRepoImp implements ContactUsRepo {
onSuccess: (response, statusCode, {messageStatus, errorMessage}) { onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try { try {
final list = response['List_PatientICProjects']; final list = response['List_PatientICProjects'];
final hmgLocations = list.map((item) => GetPatientICProjectsModel.fromJson(item as Map<String, dynamic>)).toList().cast<GetPatientICProjectsModel>(); final liveChatProjectsList = list.map((item) => GetPatientICProjectsModel.fromJson(item as Map<String, dynamic>)).toList().cast<GetPatientICProjectsModel>();
apiResponse = GenericApiModel<List<GetPatientICProjectsModel>>( apiResponse = GenericApiModel<List<GetPatientICProjectsModel>>(
messageStatus: messageStatus, messageStatus: messageStatus,
statusCode: statusCode, statusCode: statusCode,
errorMessage: null, errorMessage: null,
data: hmgLocations, data: liveChatProjectsList,
); );
} catch (e) { } catch (e) {
failure = DataParsingFailure(e.toString()); failure = DataParsingFailure(e.toString());

@ -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/app_state.dart';
import 'package:hmg_patient_app_new/features/contact_us/contact_us_repo.dart'; import 'package:hmg_patient_app_new/features/contact_us/contact_us_repo.dart';
import 'package:hmg_patient_app_new/features/contact_us/models/resp_models/get_hmg_locations.dart'; import 'package:hmg_patient_app_new/features/contact_us/models/resp_models/get_hmg_locations.dart';
import 'package:hmg_patient_app_new/features/contact_us/models/resp_models/get_patient_ic_projects.dart';
import 'package:hmg_patient_app_new/services/error_handler_service.dart'; import 'package:hmg_patient_app_new/services/error_handler_service.dart';
class ContactUsViewModel extends ChangeNotifier { class ContactUsViewModel extends ChangeNotifier {
@ -11,17 +12,24 @@ class ContactUsViewModel extends ChangeNotifier {
bool isHMGLocationsListLoading = false; bool isHMGLocationsListLoading = false;
bool isHMGHospitalsListSelected = true; bool isHMGHospitalsListSelected = true;
bool isLiveChatProjectsListLoading = false;
List<GetHMGLocationsModel> hmgHospitalsLocationsList = []; List<GetHMGLocationsModel> hmgHospitalsLocationsList = [];
List<GetHMGLocationsModel> hmgPharmacyLocationsList = []; List<GetHMGLocationsModel> hmgPharmacyLocationsList = [];
List<GetPatientICProjectsModel> liveChatProjectsList = [];
int selectedLiveChatProjectIndex = -1;
ContactUsViewModel({required this.contactUsRepo, required this.errorHandlerService, required this.appState}); ContactUsViewModel({required this.contactUsRepo, required this.errorHandlerService, required this.appState});
initContactUsViewModel() { initContactUsViewModel() {
isHMGLocationsListLoading = true; isHMGLocationsListLoading = true;
isHMGHospitalsListSelected = true; isHMGHospitalsListSelected = true;
isLiveChatProjectsListLoading = true;
hmgHospitalsLocationsList.clear(); hmgHospitalsLocationsList.clear();
hmgPharmacyLocationsList.clear(); hmgPharmacyLocationsList.clear();
liveChatProjectsList.clear();
getHMGLocations(); getHMGLocations();
notifyListeners(); notifyListeners();
} }
@ -31,6 +39,11 @@ class ContactUsViewModel extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
setSelectedLiveChatProjectIndex(int index) {
selectedLiveChatProjectIndex = index;
notifyListeners();
}
Future<void> getHMGLocations({Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getHMGLocations({Function(dynamic)? onSuccess, Function(String)? onError}) async {
isHMGLocationsListLoading = true; isHMGLocationsListLoading = true;
hmgHospitalsLocationsList.clear(); hmgHospitalsLocationsList.clear();
@ -62,4 +75,30 @@ class ContactUsViewModel extends ChangeNotifier {
}, },
); );
} }
Future<void> getLiveChatProjectsList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
isLiveChatProjectsListLoading = true;
liveChatProjectsList.clear();
notifyListeners();
final result = await contactUsRepo.getLiveChatProjectsList();
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
liveChatProjectsList = apiResponse.data!;
liveChatProjectsList.sort((a, b) => b.distanceInKilometers.compareTo(a.distanceInKilometers));
isLiveChatProjectsListLoading = false;
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
} }

@ -263,6 +263,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
SizedBox(height: 16.h), SizedBox(height: 16.h),
], ],
) )
// : SizedBox.shrink()
: Column( : Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -294,186 +295,170 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
iconSize: 40.w, iconSize: 40.w,
isLargeText: true, isLargeText: true,
), ),
MedicalFileCard(
label: LocaleKeys.labResults.tr(context: context),
textColor: AppColors.blackColor,
backgroundColor: AppColors.whiteColor,
svgIcon: AppAssets.lab_result_icon,
iconSize: 40.w,
isLargeText: true,
),
MedicalFileCard(
label: "Radiology Results".needTranslation,
textColor: AppColors.blackColor,
backgroundColor: AppColors.whiteColor,
svgIcon: AppAssets.radiology_icon,
iconSize: 40.w,
isLargeText: true,
),
], ],
), ),
SizedBox(height: 16.h), SizedBox(height: 16.h),
LocaleKeys.prescriptions.tr().toText18(isBold: true), LocaleKeys.prescriptions.tr().toText18(isBold: true),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Consumer<PrescriptionsViewModel>(builder: (context, prescriptionVM, child) { // Consumer<PrescriptionsViewModel>(builder: (context, prescriptionVM, child) {
return prescriptionVM.isPrescriptionsDetailsLoading // return prescriptionVM.isPrescriptionsDetailsLoading
? const MoviesShimmerWidget() // ? const MoviesShimmerWidget()
: Container( // : Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( // decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: Colors.white, // color: Colors.white,
borderRadius: 20.r, // borderRadius: 20.r,
), // ),
padding: EdgeInsets.all(16.w), // padding: EdgeInsets.all(16.w),
child: Column( // child: Column(
children: [ // children: [
ListView.separated( // ListView.separated(
itemCount: prescriptionVM.prescriptionDetailsList.length, // itemCount: prescriptionVM.prescriptionDetailsList.length,
shrinkWrap: true, // shrinkWrap: true,
padding: EdgeInsets.only(right: 8.w), // padding: EdgeInsets.only(right: 8.w),
physics: NeverScrollableScrollPhysics(), // physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) { // itemBuilder: (context, index) {
return AnimationConfiguration.staggeredList( // return AnimationConfiguration.staggeredList(
position: index, // position: index,
duration: const Duration(milliseconds: 500), // duration: const Duration(milliseconds: 500),
child: SlideAnimation( // child: SlideAnimation(
verticalOffset: 100.0, // verticalOffset: 100.0,
child: FadeInAnimation( // child: FadeInAnimation(
child: Row( // child: Row(
children: [ // children: [
Utils.buildSvgWithAssets( // Utils.buildSvgWithAssets(
icon: AppAssets.prescription_item_icon, // icon: AppAssets.prescription_item_icon,
width: 40.h, // width: 40.h,
height: 40.h, // height: 40.h,
), // ),
SizedBox(width: 8.h), // SizedBox(width: 8.h),
Row( // Row(
mainAxisSize: MainAxisSize.max, // mainAxisSize: MainAxisSize.max,
children: [ // children: [
Column( // Column(
children: [ // children: [
prescriptionVM.prescriptionDetailsList[index].itemDescription! // prescriptionVM.prescriptionDetailsList[index].itemDescription!
.toText12(isBold: true, maxLine: 1), // .toText12(isBold: true, maxLine: 1),
"Prescribed By: ${widget.patientAppointmentHistoryResponseModel.doctorTitle} ${widget.patientAppointmentHistoryResponseModel.doctorNameObj}" // "Prescribed By: ${widget.patientAppointmentHistoryResponseModel.doctorTitle} ${widget.patientAppointmentHistoryResponseModel.doctorNameObj}"
.needTranslation // .needTranslation
.toText10( // .toText10(
weight: FontWeight.w500, // weight: FontWeight.w500,
color: AppColors.greyTextColor, // color: AppColors.greyTextColor,
letterSpacing: -0.4), // letterSpacing: -0.4),
], // ],
), // ),
SizedBox(width: 68.w), // SizedBox(width: 68.w),
Transform.flip( // Transform.flip(
flipX: appState.isArabic(), // flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets( // child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon, // icon: AppAssets.forward_arrow_icon,
iconColor: AppColors.blackColor, // iconColor: AppColors.blackColor,
width: 18.w, // width: 18.w,
height: 13.h, // height: 13.h,
fit: BoxFit.contain, // fit: BoxFit.contain,
), // ),
), // ),
], // ],
), // ),
], // ],
), // ),
), // ),
), // ),
); // );
}, // },
separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h), // separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h),
).onPress(() { // ).onPress(() {
prescriptionVM.setPrescriptionsDetailsLoading(); // prescriptionVM.setPrescriptionsDetailsLoading();
Navigator.of(context).push( // Navigator.of(context).push(
CustomPageRoute( // CustomPageRoute(
page: PrescriptionDetailPage(prescriptionsResponseModel: getPrescriptionRequestModel()), // page: PrescriptionDetailPage(prescriptionsResponseModel: getPrescriptionRequestModel()),
), // ),
); // );
}), // }),
SizedBox(height: 16.h), // SizedBox(height: 16.h),
const Divider(color: AppColors.dividerColor), // const Divider(color: AppColors.dividerColor),
SizedBox(height: 16.h), // SizedBox(height: 16.h),
Wrap( // Wrap(
runSpacing: 6.w, // runSpacing: 6.w,
children: [ // children: [
// Expanded( // // Expanded(
// child: CustomButton( // // child: CustomButton(
// text: widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported! ? LocaleKeys.resendOrder.tr(context: context) : LocaleKeys.prescriptionDeliveryError.tr(context: context), // // text: widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported! ? LocaleKeys.resendOrder.tr(context: context) : LocaleKeys.prescriptionDeliveryError.tr(context: context),
// onPressed: () {}, // // onPressed: () {},
// backgroundColor: AppColors.secondaryLightRedColor, // // backgroundColor: AppColors.secondaryLightRedColor,
// borderColor: AppColors.secondaryLightRedColor, // // borderColor: AppColors.secondaryLightRedColor,
// textColor: AppColors.primaryRedColor, // // textColor: AppColors.primaryRedColor,
// fontSize: 14, // // fontSize: 14,
// fontWeight: FontWeight.w500, // // fontWeight: FontWeight.w500,
// borderRadius: 12.h, // // borderRadius: 12.h,
// height: 40.h, // // height: 40.h,
// icon: AppAssets.appointment_calendar_icon, // // icon: AppAssets.appointment_calendar_icon,
// iconColor: AppColors.primaryRedColor, // // iconColor: AppColors.primaryRedColor,
// iconSize: 16.h, // // iconSize: 16.h,
// ), // // ),
// ), // // ),
// SizedBox(width: 16.h), // // SizedBox(width: 16.h),
Expanded( // Expanded(
child: CustomButton( // child: CustomButton(
text: "Refill & Delivery".needTranslation, // text: "Refill & Delivery".needTranslation,
onPressed: () { // onPressed: () {
Navigator.of(context) // Navigator.of(context)
.push( // .push(
CustomPageRoute( // CustomPageRoute(
page: PrescriptionsListPage(), // page: PrescriptionsListPage(),
), // ),
) // )
.then((val) { // .then((val) {
prescriptionsViewModel.setPrescriptionsDetailsLoading(); // prescriptionsViewModel.setPrescriptionsDetailsLoading();
prescriptionsViewModel.getPrescriptionDetails(getPrescriptionRequestModel()); // prescriptionsViewModel.getPrescriptionDetails(getPrescriptionRequestModel());
}); // });
}, // },
backgroundColor: AppColors.secondaryLightRedColor, // backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor, // borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor, // textColor: AppColors.primaryRedColor,
fontSize: 14.f, // fontSize: 14.f,
fontWeight: FontWeight.w500, // fontWeight: FontWeight.w500,
borderRadius: 12.r, // borderRadius: 12.r,
height: 40.h, // height: 40.h,
icon: AppAssets.requests, // icon: AppAssets.requests,
iconColor: AppColors.primaryRedColor, // iconColor: AppColors.primaryRedColor,
iconSize: 16.h, // iconSize: 16.h,
), // ),
), // ),
//
SizedBox(width: 16.w), // SizedBox(width: 16.w),
Expanded( // Expanded(
child: CustomButton( // child: CustomButton(
text: "All Prescriptions".needTranslation, // text: "All Prescriptions".needTranslation,
onPressed: () { // onPressed: () {
Navigator.of(context) // Navigator.of(context)
.push( // .push(
CustomPageRoute( // CustomPageRoute(
page: PrescriptionsListPage(), // page: PrescriptionsListPage(),
), // ),
) // )
.then((val) { // .then((val) {
prescriptionsViewModel.setPrescriptionsDetailsLoading(); // prescriptionsViewModel.setPrescriptionsDetailsLoading();
prescriptionsViewModel.getPrescriptionDetails(getPrescriptionRequestModel()); // prescriptionsViewModel.getPrescriptionDetails(getPrescriptionRequestModel());
}); // });
}, // },
backgroundColor: AppColors.secondaryLightRedColor, // backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor, // borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor, // textColor: AppColors.primaryRedColor,
fontSize: 14.f, // fontSize: 14.f,
fontWeight: FontWeight.w500, // fontWeight: FontWeight.w500,
borderRadius: 12.r, // borderRadius: 12.r,
height: 40.h, // height: 40.h,
icon: AppAssets.requests, // icon: AppAssets.requests,
iconColor: AppColors.primaryRedColor, // iconColor: AppColors.primaryRedColor,
iconSize: 16.h, // iconSize: 16.h,
), // ),
), // ),
], // ],
), // ),
], // ],
), // ),
); // );
}), // }),
], ],
), ),
], ],

@ -1,11 +1,14 @@
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:get_it/get_it.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/app_export.dart'; import 'package:hmg_patient_app_new/core/app_export.dart';
import 'package:hmg_patient_app_new/core/cache_consts.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/dependencies.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/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/services/cache_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart'; import 'package:hmg_patient_app_new/services/navigation_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/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
@ -21,115 +24,108 @@ class QuickLogin extends StatefulWidget {
} }
class QuickLoginState extends State<QuickLogin> { class QuickLoginState extends State<QuickLogin> {
final CacheService cacheService = GetIt.instance<CacheService>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
NavigationService navigationService = getIt.get<NavigationService>(); NavigationService navigationService = getIt.get<NavigationService>();
return Container( return Column(
decoration: const BoxDecoration( mainAxisSize: MainAxisSize.min,
color: Colors.white, crossAxisAlignment: CrossAxisAlignment.center,
borderRadius: BorderRadius.only( children: [
topLeft: Radius.circular(24), widget.isDone
topRight: Radius.circular(24), ? Column(
), children: [
), Row(
padding: const EdgeInsets.all(24), mainAxisAlignment: MainAxisAlignment.end,
child: Column( children: [
mainAxisSize: MainAxisSize.min, InkWell(
crossAxisAlignment: CrossAxisAlignment.center, onTap: () {
children: [ navigationService.pop();
widget.isDone
? Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
InkWell(
onTap: () {
navigationService.pop();
},
child: Utils.buildSvgWithAssets(icon: AppAssets.cross_circle)),
],
),
Utils.showLottie(context: context, assetPath: AppAnimations.checkmark, width: 120, height: 120, repeat: true),
LocaleKeys.allSet.tr().toText16(textAlign: TextAlign.center, weight: FontWeight.w500)
// Text(
// ' TranslationBase.of(context).allSet',
// textAlign: TextAlign.center,
// style: context.dynamicTextStyle(
// fontSize: 16,
// fontWeight: FontWeight.w500,
// color: Colors.black,
// ),
// ),
],
)
: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(AppAssets.lockIcon, height: 100),
SizedBox(height: 10.h),
LocaleKeys.enableQuickLogin.tr().toText26(isBold: true),
// Text(
// ' TranslationBase.of(context).enableQuickLogin',
// style: context.dynamicTextStyle(
// fontSize: 26,
// fontWeight: FontWeight.bold,
// color: Colors.black,
// ),
// ),
SizedBox(height: 5.h),
LocaleKeys.enableQuickLogin.tr().toText16(color: AppColors.quickLoginColor),
// Description
// Text(
// 'TranslationBase.of(context).enableMsg',
// style: context.dynamicTextStyle(
// fontSize: 16,
// color: Color(0xFF666666),
// height: 1.5,
// ),
//),
const SizedBox(height: 24),
// Buttons
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Expanded(
child: CustomButton(
text: LocaleKeys.enableQuickLogin.tr(),
onPressed: () {
widget.onPressed();
},
backgroundColor: Color(0xffED1C2B),
borderColor: Color(0xffED1C2B),
textColor: Colors.white,
icon: AppAssets.apple_finder,
)),
],
),
SizedBox(
height: 16,
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Expanded(
child: CustomButton(
text: LocaleKeys.notNow.tr(),
onPressed: () {
Navigator.pop(context, "true");
}, },
backgroundColor: Color(0xffFEE9EA), child: Utils.buildSvgWithAssets(icon: AppAssets.cross_circle)),
borderColor: Color(0xffFEE9EA), ],
textColor: Colors.red, ),
// icon: "assets/images/svg/apple-finder.svg", Utils.showLottie(context: context, assetPath: AppAnimations.checkmark, width: 120, height: 120, repeat: true),
)), LocaleKeys.allSet.tr().toText16(textAlign: TextAlign.center, weight: FontWeight.w500)
], // Text(
), // ' TranslationBase.of(context).allSet',
], // textAlign: TextAlign.center,
) // style: context.dynamicTextStyle(
], // fontSize: 16,
), // fontWeight: FontWeight.w500,
// color: Colors.black,
// ),
// ),
],
)
: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(AppAssets.lockIcon, height: 100),
SizedBox(height: 10.h),
LocaleKeys.enableQuickLogin.tr().toText26(isBold: true),
// Text(
// ' TranslationBase.of(context).enableQuickLogin',
// style: context.dynamicTextStyle(
// fontSize: 26,
// fontWeight: FontWeight.bold,
// color: Colors.black,
// ),
// ),
SizedBox(height: 5.h),
LocaleKeys.enableQuickLogin.tr().toText16(color: AppColors.quickLoginColor),
// Description
// Text(
// 'TranslationBase.of(context).enableMsg',
// style: context.dynamicTextStyle(
// fontSize: 16,
// color: Color(0xFF666666),
// height: 1.5,
// ),
//),
const SizedBox(height: 24),
// Buttons
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Expanded(
child: CustomButton(
text: LocaleKeys.enableQuickLogin.tr(),
onPressed: () {
widget.onPressed();
},
backgroundColor: Color(0xffED1C2B),
borderColor: Color(0xffED1C2B),
textColor: Colors.white,
icon: AppAssets.apple_finder,
)),
],
),
SizedBox(
height: 16,
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Expanded(
child: CustomButton(
text: LocaleKeys.notNow.tr(),
onPressed: () {
cacheService.saveBool(key: CacheConst.quickLoginEnabled, value: false);
Navigator.pop(context, "true");
},
backgroundColor: Color(0xffFEE9EA),
borderColor: Color(0xffFEE9EA),
textColor: Colors.red,
// icon: "assets/images/svg/apple-finder.svg",
)),
],
),
],
)
],
); );
} }
} }

@ -65,25 +65,28 @@ class DoctorCard extends StatelessWidget {
.toString() .toString()
.toText16(isBold: true, maxlines: 1), .toText16(isBold: true, maxlines: 1),
).toShimmer2(isShow: isLoading), ).toShimmer2(isShow: isLoading),
],
),
SizedBox(height: 2.h),
Row(
children: [
(isLoading
? "Consultant Cardiologist"
: doctorsListResponseModel.speciality!.isNotEmpty
? doctorsListResponseModel.speciality!.first
: "")
.toString()
.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor, maxLine: 1)
.toShimmer2(isShow: isLoading),
SizedBox(width: 6.w),
Image.network( Image.network(
isLoading isLoading ? "https://hmgwebservices.com/Images/flag/SYR.png" : doctorsListResponseModel.nationalityFlagURL ?? "https://hmgwebservices.com/Images/flag/SYR.png",
? "https://hmgwebservices.com/Images/flag/SYR.png"
: doctorsListResponseModel.nationalityFlagURL ?? "https://hmgwebservices.com/Images/flag/SYR.png",
width: 20.h, width: 20.h,
height: 15.h, height: 15.h,
fit: BoxFit.fill, fit: BoxFit.fill,
).toShimmer2(isShow: isLoading), ).toShimmer2(isShow: isLoading),
], ],
), ),
SizedBox(height: 2.h),
(isLoading
? "Consultant Cardiologist"
: doctorsListResponseModel.speciality!.isNotEmpty
? doctorsListResponseModel.speciality!.first
: "")
.toString()
.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor, maxLine: 1)
.toShimmer2(isShow: isLoading),
], ],
), ),
), ),

@ -59,6 +59,7 @@ class ContactUs extends StatelessWidget {
"Live chat option with HMG".needTranslation, "Live chat option with HMG".needTranslation,
).onPress(() { ).onPress(() {
locationUtils.getCurrentLocation(onSuccess: (value) { locationUtils.getCurrentLocation(onSuccess: (value) {
contactUsViewModel.getLiveChatProjectsList();
Navigator.pop(context); Navigator.pop(context);
Navigator.of(context).push( Navigator.of(context).push(
CustomPageRoute( CustomPageRoute(

@ -1,27 +1,178 @@
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:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/contact_us/contact_us_view_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/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/chip/app_custom_chip_widget.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
class LiveChatPage extends StatelessWidget { class LiveChatPage extends StatelessWidget {
const LiveChatPage({super.key}); LiveChatPage({super.key});
String chatURL = "";
late AppState appState;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
appState = getIt.get<AppState>();
return Scaffold( return Scaffold(
backgroundColor: AppColors.bgScaffoldColor, backgroundColor: AppColors.bgScaffoldColor,
body: Column( body: Consumer<ContactUsViewModel>(builder: (context, contactUsVM, child) {
children: [ return Column(
Expanded( children: [
child: CollapsingListView( Expanded(
title: LocaleKeys.liveChat.tr(), child: CollapsingListView(
child: SingleChildScrollView(), title: LocaleKeys.liveChat.tr(),
child: Consumer<ContactUsViewModel>(builder: (context, contactUsVM, child) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 16.h),
ListView.separated(
padding: EdgeInsets.only(top: 16.h),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: contactUsVM.isLiveChatProjectsListLoading ? 5 : contactUsVM.liveChatProjectsList.length,
itemBuilder: (context, index) {
return contactUsVM.isLiveChatProjectsListLoading
? Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 20.h,
hasShadow: true,
),
child: Padding(
padding: EdgeInsets.all(14.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.network(
"https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png",
width: 63.h,
height: 63.h,
fit: BoxFit.cover,
).circle(100).toShimmer2(isShow: true),
SizedBox(width: 16.h),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Dr John Smith".toText16(isBold: true).toShimmer2(isShow: true),
SizedBox(height: 8.h),
Wrap(
direction: Axis.horizontal,
spacing: 3.h,
runSpacing: 4.h,
children: [
AppCustomChipWidget(labelText: "").toShimmer2(isShow: true, width: 16.h),
AppCustomChipWidget(labelText: "").toShimmer2(isShow: true, width: 16.h),
],
),
],
),
),
],
),
],
),
),
),
).paddingSymmetrical(24.h, 0.h)
: AnimationConfiguration.staggeredList(
position: index,
duration: const Duration(milliseconds: 500),
child: SlideAnimation(
verticalOffset: 100.0,
child: FadeInAnimation(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: DecoratedBox(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: contactUsVM.selectedLiveChatProjectIndex == index ? AppColors.primaryRedColor : AppColors.whiteColor,
borderRadius: 16.r,
hasShadow: false,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
("${appState.isArabic() ? contactUsVM.liveChatProjectsList[index].projectNameN! : contactUsVM.liveChatProjectsList[index].projectName!}\n${contactUsVM.liveChatProjectsList[index].distanceInKilometers!} KM")
.needTranslation
.toText14(isBold: true, color: contactUsVM.selectedLiveChatProjectIndex == index ? AppColors.whiteColor : AppColors.textColor),
Transform.flip(
flipX: getIt.get<AppState>().isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon_small,
iconColor: contactUsVM.selectedLiveChatProjectIndex == index ? AppColors.whiteColor : AppColors.textColor,
width: 18.h,
height: 13.h,
fit: BoxFit.contain,
),
),
],
).paddingSymmetrical(16.h, 16.h),
).onPress(() {
contactUsVM.setSelectedLiveChatProjectIndex(index);
chatURL =
"https://chat.hmg.com/Index.aspx?Name=${appState.getAuthenticatedUser()!.firstName}&PatientID=${appState.getAuthenticatedUser()!.patientId}&MobileNo=${appState.getAuthenticatedUser()!.mobileNumber}&Language=${appState.isArabic() ? 'ar' : 'en'}&WorkGroup=${contactUsVM.liveChatProjectsList[index].value}";
debugPrint("Chat URL: $chatURL");
}),
).paddingSymmetrical(24.h, 0.h),
),
),
);
},
separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h),
),
SizedBox(height: 24.h),
],
);
}),
),
),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: true,
),
child: CustomButton(
text: LocaleKeys.liveChat.tr(context: context),
onPressed: () async {
Uri uri = Uri.parse(chatURL);
launchUrl(uri, mode: LaunchMode.platformDefault, webOnlyWindowName: "");
},
backgroundColor: contactUsVM.selectedLiveChatProjectIndex == -1 ? AppColors.greyColor : AppColors.primaryRedColor,
borderColor: contactUsVM.selectedLiveChatProjectIndex == -1 ? AppColors.greyColor : AppColors.primaryRedColor,
textColor: AppColors.whiteColor,
fontSize: 16,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 50.h,
).paddingSymmetrical(24.h, 24.h),
), ),
), ],
Container() );
], }),
),
); );
} }
} }

@ -245,7 +245,7 @@ class _LandingPageState extends State<LandingPage> {
indicatorLayout: PageIndicatorLayout.COLOR, indicatorLayout: PageIndicatorLayout.COLOR,
axisDirection: AxisDirection.right, axisDirection: AxisDirection.right,
controller: _controller, controller: _controller,
itemHeight: 210 + 25, itemHeight: 200.h,
pagination: const SwiperPagination( pagination: const SwiperPagination(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: 210 + 8 + 24), margin: EdgeInsets.only(top: 210 + 8 + 24),
@ -439,7 +439,7 @@ class _LandingPageState extends State<LandingPage> {
}), }),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Container( Container(
height: 120.h, height: 121.h,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r),
child: Column( child: Column(
children: [ children: [
@ -530,7 +530,7 @@ class _LandingPageState extends State<LandingPage> {
], ],
).paddingSymmetrical(24.h, 0.h), ).paddingSymmetrical(24.h, 0.h),
SizedBox( SizedBox(
height: 280.h, height: 340.h,
child: ListView.separated( child: ListView.separated(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemCount: LandingPageData.getServiceCardsList.length, itemCount: LandingPageData.getServiceCardsList.length,
@ -567,9 +567,8 @@ class _LandingPageState extends State<LandingPage> {
void showQuickLogin(BuildContext context) { void showQuickLogin(BuildContext context) {
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
context, context,
title: "", // title: "",
isCloseButtonVisible: false, isCloseButtonVisible: false,
child: StatefulBuilder( child: StatefulBuilder(
builder: (context, setState) { builder: (context, setState) {
return QuickLogin( return QuickLogin(

@ -46,7 +46,7 @@ class LabOrderResultItem extends StatelessWidget {
padding: EdgeInsets.only(bottom: 8.h), padding: EdgeInsets.only(bottom: 8.h),
child: '${tests!.description}'.toText14(weight: FontWeight.w500), child: '${tests!.description}'.toText14(weight: FontWeight.w500),
), ),
'${tests!.packageShortDescription}'.toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight), (tests!.packageShortDescription ?? "").toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight),
SizedBox(height: 12.h), SizedBox(height: 12.h),
Row( Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -58,22 +58,25 @@ class LabOrderResultItem extends StatelessWidget {
fontSize: 24.f, fontSize: 24.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: context.read<LabViewModel>().getColor( color: tests!.checkIfGraphShouldBeDisplayed()
tests?.calculatedResultFlag ?? "", ? context.read<LabViewModel>().getColor(
), tests?.calculatedResultFlag ?? "",
)
: Colors.grey.shade700,
letterSpacing: -2, letterSpacing: -2,
), ),
), ),
), ),
SizedBox(width: 4.h,), SizedBox(width: 4.h,),
Visibility( Visibility(
visible: tests?.checkIfGraphShouldBeDisplayed() == true, // visible: tests?.checkIfGraphShouldBeDisplayed() == true,
visible: true,
child: Expanded( child: Expanded(
flex: 2, flex: 2,
child: Visibility( child: Visibility(
visible: tests?.referanceRange != null, visible: tests?.referanceRange != null,
child: Text( child: Text(
"(Reference range ${tests?.referanceRange})".needTranslation, "(Reference range: ${tests?.referanceRange})".needTranslation,
style: TextStyle( style: TextStyle(
fontSize: 12.f, fontSize: 12.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,

@ -344,7 +344,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Consumer<MyAppointmentsViewModel>(builder: (context, myAppointmentsVM, child) { Consumer<MyAppointmentsViewModel>(builder: (context, myAppointmentsVM, child) {
// Provide an explicit height so the horizontal ListView has a bounded height // Provide an explicit height so the horizontal ListView has a bounded height
return SizedBox( return SizedBox(
height: 190.h, height: 192.h,
child: myAppointmentsVM.isMyAppointmentsLoading child: myAppointmentsVM.isMyAppointmentsLoading
? MedicalFileAppointmentCard( ? MedicalFileAppointmentCard(
patientAppointmentHistoryResponseModel: PatientAppointmentHistoryResponseModel(), patientAppointmentHistoryResponseModel: PatientAppointmentHistoryResponseModel(),
@ -472,7 +472,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
child: Column( child: Column(
children: [ children: [
ListView.separated( ListView.separated(
itemCount: prescriptionVM.patientPrescriptionOrders.length, itemCount: prescriptionVM.patientPrescriptionOrders.length <= 2 ? prescriptionVM.patientPrescriptionOrders.length : 2,
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.only(left: 0, right: 8.w), padding: EdgeInsets.only(left: 0, right: 8.w),
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
@ -564,7 +564,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
fontSize: 12.f, fontSize: 12.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderRadius: 12.r, borderRadius: 12.r,
height: 56.h, height: 40.h,
icon: AppAssets.requests, icon: AppAssets.requests,
iconColor: AppColors.primaryRedColor, iconColor: AppColors.primaryRedColor,
iconSize: 16.w, iconSize: 16.w,
@ -581,7 +581,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
fontSize: 12.f, fontSize: 12.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderRadius: 12.h, borderRadius: 12.h,
height: 56.h, height: 40.h,
icon: AppAssets.all_medications_icon, icon: AppAssets.all_medications_icon,
iconColor: AppColors.primaryRedColor, iconColor: AppColors.primaryRedColor,
iconSize: 16.h, iconSize: 16.h,

@ -255,22 +255,22 @@ class _PrescriptionsListPageState extends State<PrescriptionsListPage> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(
height: 40.h, height: 48.h,
width: 40.h, width: 40.w,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.textColor, color: AppColors.textColor,
borderRadius: 10.h, borderRadius: 12,
), ),
child: Padding( child: Padding(
padding: EdgeInsets.all(8.h), padding: EdgeInsets.all(12.h),
child: Transform.flip( child: Transform.flip(
flipX: appState.isArabic(), flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets( child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon_small, icon: AppAssets.forward_arrow_icon_small,
iconColor: AppColors.whiteColor, iconColor: AppColors.whiteColor,
width: 10.h, // width: 8.w,
height: 10.h, // height: 2,
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
), ),
), ),

@ -1,23 +0,0 @@
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
class ServicesPage extends StatelessWidget {
const ServicesPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.bgScaffoldColor,
appBar: AppBar(
title: const Text('Appointments'),
backgroundColor: AppColors.bgScaffoldColor,
),
body: const Center(
child: Text(
'Appointments Page',
style: TextStyle(fontSize: 24),
),
),
);
}
}

@ -178,7 +178,7 @@ void showCommonBottomSheetWithoutHeight(
}),], }),],
], ],
), ),
SizedBox(height: 16.h), isCloseButtonVisible ? SizedBox(height: 16.h) : SizedBox.shrink(),
child, child,
], ],
), ),

Loading…
Cancel
Save