logout & family file fix & PMA-1047

pull/169/head
aamir-csol 2 weeks ago
parent 2bbfe1f131
commit bb4719bd87

@ -197,6 +197,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
dialogService.showFamilyBottomSheetWithoutH( dialogService.showFamilyBottomSheetWithoutH(
label: LocaleKeys.familyTitle.tr(context: context), label: LocaleKeys.familyTitle.tr(context: context),
message: "", message: "",
isShowManageButton: true,
onSwitchPress: (FamilyFileResponseModelLists profile) { onSwitchPress: (FamilyFileResponseModelLists profile) {
medicalFileViewModel.switchFamilyFiles(responseID: profile.responseId, patientID: profile.patientId, phoneNumber: profile.mobileNumber); medicalFileViewModel.switchFamilyFiles(responseID: profile.responseId, patientID: profile.patientId, phoneNumber: profile.mobileNumber);
}, },
@ -246,14 +247,6 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
icon: AppAssets.file_icon, icon: AppAssets.file_icon,
labelText: "${LocaleKeys.fileno.tr(context: context)}: ${appState.getAuthenticatedUser()!.patientId}", labelText: "${LocaleKeys.fileno.tr(context: context)}: ${appState.getAuthenticatedUser()!.patientId}",
labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w), labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w),
onChipTap: () {
navigationService.pushPage(
page: FamilyMedicalScreen(
profiles: medicalFileViewModel.patientFamilyFiles,
onSelect: (FamilyFileResponseModelLists p1) {},
),
);
},
), ),
AppCustomChipWidget( AppCustomChipWidget(
icon: AppAssets.checkmark_icon, icon: AppAssets.checkmark_icon,
@ -293,8 +286,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
iconColor: insuranceVM.isInsuranceExpired ? AppColors.primaryRedColor : AppColors.successColor, iconColor: insuranceVM.isInsuranceExpired ? AppColors.primaryRedColor : AppColors.successColor,
textColor: insuranceVM.isInsuranceExpired ? AppColors.primaryRedColor : AppColors.successColor, textColor: insuranceVM.isInsuranceExpired ? AppColors.primaryRedColor : AppColors.successColor,
iconSize: 12.w, iconSize: 12.w,
backgroundColor: backgroundColor: insuranceVM.isInsuranceExpired ? AppColors.primaryRedColor.withOpacity(0.1) : AppColors.successColor.withOpacity(0.1),
insuranceVM.isInsuranceExpired ? AppColors.primaryRedColor.withOpacity(0.1) : AppColors.successColor.withOpacity(0.1),
labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w), labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w),
); );
}), }),
@ -447,8 +439,8 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
), ),
ExpandableListItem( ExpandableListItem(
title: LocaleKeys.medicalReports.tr(context: context).toText18( title: LocaleKeys.medicalReports.tr(context: context).toText18(
weight: FontWeight.w600, weight: FontWeight.w600,
), ),
expandedBackgroundColor: Colors.transparent, expandedBackgroundColor: Colors.transparent,
children: [ children: [
SizedBox(height: 10.h), SizedBox(height: 10.h),
@ -609,8 +601,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
? Container( ? Container(
padding: EdgeInsets.all(12.w), padding: EdgeInsets.all(12.w),
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
decoration: decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.r, hasShadow: false),
RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.r, hasShadow: false),
child: Column( child: Column(
children: [ children: [
Utils.buildSvgWithAssets(icon: AppAssets.home_calendar_icon, width: 32.h, height: 32.h), Utils.buildSvgWithAssets(icon: AppAssets.home_calendar_icon, width: 32.h, height: 32.h),
@ -678,8 +669,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
child: AskDoctorRequestTypeSelect( child: AskDoctorRequestTypeSelect(
askDoctorRequestTypeList: myAppointmentsViewModel.askDoctorRequestTypeList, askDoctorRequestTypeList: myAppointmentsViewModel.askDoctorRequestTypeList,
myAppointmentsViewModel: myAppointmentsViewModel, myAppointmentsViewModel: myAppointmentsViewModel,
patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel: myAppointmentsVM.patientAppointmentsHistoryList[index],
myAppointmentsVM.patientAppointmentsHistoryList[index],
), ),
callBackFunc: () {}, callBackFunc: () {},
isFullScreen: false, isFullScreen: false,
@ -757,8 +747,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
child: Column( child: Column(
children: [ children: [
ListView.separated( ListView.separated(
itemCount: itemCount: prescriptionVM.patientPrescriptionOrders.length <= 2 ? prescriptionVM.patientPrescriptionOrders.length : 2,
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(),
@ -789,13 +778,11 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
spacing: 3.w, spacing: 3.w,
runSpacing: 4.w, runSpacing: 4.w,
children: [ children: [
AppCustomChipWidget( AppCustomChipWidget(labelText: prescriptionVM.patientPrescriptionOrders[index].clinicDescription!),
labelText: prescriptionVM.patientPrescriptionOrders[index].clinicDescription!),
AppCustomChipWidget( AppCustomChipWidget(
icon: AppAssets.doctor_calendar_icon, icon: AppAssets.doctor_calendar_icon,
labelText: DateUtil.formatDateToDate( labelText: DateUtil.formatDateToDate(
DateUtil.convertStringToDate( DateUtil.convertStringToDate(prescriptionVM.patientPrescriptionOrders[index].appointmentDate),
prescriptionVM.patientPrescriptionOrders[index].appointmentDate),
false, false,
), ),
), ),
@ -808,19 +795,13 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Transform.flip( 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, width: 15.w, height: 15.h, fit: BoxFit.contain, iconColor: AppColors.textColor)),
width: 15.w,
height: 15.h,
fit: BoxFit.contain,
iconColor: AppColors.textColor)),
], ],
).onPress(() { ).onPress(() {
prescriptionVM.setPrescriptionsDetailsLoading(); prescriptionVM.setPrescriptionsDetailsLoading();
Navigator.of(context).push( Navigator.of(context).push(
CustomPageRoute( CustomPageRoute(
page: PrescriptionDetailPage( page: PrescriptionDetailPage(isFromAppointments: false, prescriptionsResponseModel: prescriptionVM.patientPrescriptionOrders[index]),
isFromAppointments: false,
prescriptionsResponseModel: prescriptionVM.patientPrescriptionOrders[index]),
), ),
); );
}), }),
@ -929,10 +910,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
fit: BoxFit.cover, fit: BoxFit.cover,
).circle(100).toShimmer2(isShow: true, radius: 50.r), ).circle(100).toShimmer2(isShow: true, radius: 50.r),
SizedBox(height: 8.h), SizedBox(height: 8.h),
("Dr. John Smith Smith Smith") ("Dr. John Smith Smith Smith").toString().toText12(fontWeight: FontWeight.w500, isCenter: true, maxLine: 2).toShimmer2(isShow: true),
.toString()
.toText12(fontWeight: FontWeight.w500, isCenter: true, maxLine: 2)
.toShimmer2(isShow: true),
], ],
) )
: myAppointmentsVM.patientMyDoctorsList.isEmpty : myAppointmentsVM.patientMyDoctorsList.isEmpty
@ -1119,14 +1097,9 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
text: "${LocaleKeys.updateInsurance.tr(context: context)} ${LocaleKeys.updateInsuranceSubtitle.tr(context: context)}", text: "${LocaleKeys.updateInsurance.tr(context: context)} ${LocaleKeys.updateInsuranceSubtitle.tr(context: context)}",
onPressed: () { onPressed: () {
insuranceViewModel.setIsInsuranceUpdateDetailsLoading(true); insuranceViewModel.setIsInsuranceUpdateDetailsLoading(true);
insuranceViewModel.getPatientInsuranceDetailsForUpdate(appState.getAuthenticatedUser()!.patientId.toString(), insuranceViewModel.getPatientInsuranceDetailsForUpdate(
appState.getAuthenticatedUser()!.patientIdentificationNo.toString()); appState.getAuthenticatedUser()!.patientId.toString(), appState.getAuthenticatedUser()!.patientIdentificationNo.toString());
showCommonBottomSheetWithoutHeight(context, showCommonBottomSheetWithoutHeight(context, child: PatientInsuranceCardUpdateCard(), callBackFunc: () {}, title: "", isCloseButtonVisible: false, isFullScreen: false);
child: PatientInsuranceCardUpdateCard(),
callBackFunc: () {},
title: "",
isCloseButtonVisible: false,
isFullScreen: false);
}, },
backgroundColor: AppColors.bgGreenColor.withOpacity(0.20), backgroundColor: AppColors.bgGreenColor.withOpacity(0.20),
borderColor: AppColors.bgGreenColor.withOpacity(0.0), borderColor: AppColors.bgGreenColor.withOpacity(0.0),
@ -1479,7 +1452,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
return [ return [
// Page 1: BMI + Height // Page 1: BMI + Height
Padding( Padding(
padding: EdgeInsets.only(left: 24.w), padding: EdgeInsets.only(left: 24.w),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
@ -1507,37 +1480,36 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
), ),
), ),
// Page 2: Weight + Blood Pressure // Page 2: Weight + Blood Pressure
Padding(padding: EdgeInsets.symmetric(horizontal: 12.w),child: Row( Padding(
children: [ padding: EdgeInsets.symmetric(horizontal: 12.w),
Expanded( child: Row(
child: _buildVitalSignCard( children: [
icon: AppAssets.weightVital, Expanded(
label: LocaleKeys.weight.tr(context: context), child: _buildVitalSignCard(
value: vitalSign.weightKg?.toString() ?? '--', icon: AppAssets.weightVital,
unit: 'kg', label: LocaleKeys.weight.tr(context: context),
status: vitalSign.weightKg != null ? "Normal" : null, value: vitalSign.weightKg?.toString() ?? '--',
onTap: onTap, unit: 'kg',
status: vitalSign.weightKg != null ? "Normal" : null,
onTap: onTap,
),
), ),
), SizedBox(width: 12.w),
SizedBox(width: 12.w), Expanded(
Expanded( child: _buildVitalSignCard(
child: _buildVitalSignCard( icon: AppAssets.bloodPressure,
icon: AppAssets.bloodPressure, label: LocaleKeys.bloodPressure.tr(context: context),
label: LocaleKeys.bloodPressure.tr(context: context), value: vitalSign.bloodPressureLower != null && vitalSign.bloodPressureHigher != null ? "${vitalSign.bloodPressureHigher}/${vitalSign.bloodPressureLower}" : '--',
value: vitalSign.bloodPressureLower != null && vitalSign.bloodPressureHigher != null unit: '',
? "${vitalSign.bloodPressureHigher}/${vitalSign.bloodPressureLower}" status: _getBloodPressureStatus(
: '--', systolic: vitalSign.bloodPressureHigher,
unit: '', diastolic: vitalSign.bloodPressureLower,
status: _getBloodPressureStatus( ),
systolic: vitalSign.bloodPressureHigher, onTap: onTap,
diastolic: vitalSign.bloodPressureLower,
), ),
onTap: onTap,
), ),
), ],
], )),
)),
]; ];
} }
@ -1636,14 +1608,12 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
backgroundColor: scheme.chipBg, backgroundColor: scheme.chipBg,
textColor: scheme.chipFg, textColor: scheme.chipFg,
), ),
] ] else
else
AppCustomChipWidget( AppCustomChipWidget(
labelText: "", labelText: "",
backgroundColor: AppColors.bgScaffoldColor, backgroundColor: AppColors.bgScaffoldColor,
textColor:null, textColor: null,
) )
], ],
), ),
), ),

@ -151,7 +151,7 @@ class _FamilyCardsState extends State<FamilyCards> {
crossAxisCount: 2, crossAxisCount: 2,
crossAxisSpacing: 10.w, crossAxisSpacing: 10.w,
mainAxisSpacing: 10.h, mainAxisSpacing: 10.h,
childAspectRatio: widget.isShowDetails ? 0.56.h : 0.65.h, childAspectRatio: widget.isShowDetails ? 0.56.h : 0.64.h,
), ),
padding: EdgeInsets.only(bottom: 20.h), padding: EdgeInsets.only(bottom: 20.h),
itemBuilder: (context, index) { itemBuilder: (context, index) {

@ -7,6 +7,7 @@ import 'package:hmg_patient_app_new/extensions/route_extensions.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/features/medical_file/models/family_file_response_model.dart'; import 'package:hmg_patient_app_new/features/medical_file/models/family_file_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/my_family/my_family.dart';
import 'package:hmg_patient_app_new/presentation/my_family/widget/family_cards.dart'; import 'package:hmg_patient_app_new/presentation/my_family/widget/family_cards.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';
@ -24,23 +25,22 @@ abstract class DialogService {
Future<void> showCommonBottomSheetWithoutH({String? label, required String message, required Function() onOkPressed, Function()? onCancelPressed}); Future<void> showCommonBottomSheetWithoutH({String? label, required String message, required Function() onOkPressed, Function()? onCancelPressed});
Future<void> showSuccessBottomSheetWithoutH({String? label, required String message, required Function() onOkPressed, Function()? onCancelPressed}); Future<void> showSuccessBottomSheetWithoutH({String? label, required String message, required Function() onOkPressed, Function()? onCancelPressed});
Future<void> showFamilyBottomSheetWithoutH( Future<void> showFamilyBottomSheetWithoutH(
{String? label, {String? label,
required String message, required String message,
required Function(FamilyFileResponseModelLists response) onSwitchPress, required Function(FamilyFileResponseModelLists response) onSwitchPress,
required List<FamilyFileResponseModelLists> profiles}); required List<FamilyFileResponseModelLists> profiles,
bool isShowManageButton = false});
Future<void> showFamilyBottomSheetWithoutHWithChild( Future<void> showFamilyBottomSheetWithoutHWithChild({String? label, required String message, Widget? child, required Function() onOkPressed, Function()? onCancelPressed});
{String? label, required String message, Widget? child, required Function() onOkPressed, Function()? onCancelPressed});
Future<void> showPhoneNumberPickerSheet({String? label, String? message, required Function() onSMSPress, required Function() onWhatsappPress}); Future<void> showPhoneNumberPickerSheet({String? label, String? message, required Function() onSMSPress, required Function() onWhatsappPress});
Future<void> showAddFamilyFileSheet({String? label, String? message, required Function() onVerificationPress}); Future<void> showAddFamilyFileSheet({String? label, String? message, required Function() onVerificationPress});
Future<void> showReminderBottomSheetWithoutHWithChild({String? label, required String message, Widget? child, required Function() onOkPressed, Function()? onCancelPressed}); Future<void> showReminderBottomSheetWithoutHWithChild({String? label, required String message, Widget? child, required Function() onOkPressed, Function()? onCancelPressed});
// TODO : Need to be Fixed showPhoneNumberPickerSheet ( From Login ADn Signup Bottom Sheet Move Here // TODO : Need to be Fixed showPhoneNumberPickerSheet ( From Login ADn Signup Bottom Sheet Move Here
} }
@ -114,8 +114,7 @@ class DialogServiceImp implements DialogService {
} }
@override @override
Future<void> showCommonBottomSheetWithoutH( Future<void> showCommonBottomSheetWithoutH({String? label, required String message, required Function() onOkPressed, Function()? onCancelPressed}) async {
{String? label, required String message, required Function() onOkPressed, Function()? onCancelPressed}) async {
final context = navigationService.navigatorKey.currentContext; final context = navigationService.navigatorKey.currentContext;
if (context == null) return; if (context == null) return;
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
@ -126,10 +125,8 @@ class DialogServiceImp implements DialogService {
); );
} }
@override @override
Future<void> showSuccessBottomSheetWithoutH( Future<void> showSuccessBottomSheetWithoutH({String? label, required String message, required Function() onOkPressed, Function()? onCancelPressed}) async {
{String? label, required String message, required Function() onOkPressed, Function()? onCancelPressed}) async {
final context = navigationService.navigatorKey.currentContext; final context = navigationService.navigatorKey.currentContext;
if (context == null) return; if (context == null) return;
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
@ -145,7 +142,8 @@ class DialogServiceImp implements DialogService {
{String? label, {String? label,
required String message, required String message,
required Function(FamilyFileResponseModelLists response) onSwitchPress, required Function(FamilyFileResponseModelLists response) onSwitchPress,
required List<FamilyFileResponseModelLists> profiles}) async { required List<FamilyFileResponseModelLists> profiles,
bool isShowManageButton = false}) async {
final context = navigationService.navigatorKey.currentContext; final context = navigationService.navigatorKey.currentContext;
if (context == null) return; if (context == null) return;
showCommonBottomSheetWithoutHeight(context, showCommonBottomSheetWithoutHeight(context,
@ -154,7 +152,7 @@ class DialogServiceImp implements DialogService {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
(message).toText16(isBold: false, color: AppColors.textColor), if (message != null) (message).toText16(isBold: false, color: AppColors.textColor),
SizedBox(height: 24.h), SizedBox(height: 24.h),
FamilyCards( FamilyCards(
profiles: profiles, profiles: profiles,
@ -164,14 +162,29 @@ class DialogServiceImp implements DialogService {
onRemove: (FamilyFileResponseModelLists profile) {}, onRemove: (FamilyFileResponseModelLists profile) {},
isShowDetails: false, isShowDetails: false,
), ),
SizedBox(height: isShowManageButton ? 15.h : 24.h),
if (isShowManageButton)
CustomButton(
text: "ManageFamilyFiles",
backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedBorderColor,
height: 48.h,
onPressed: () {
navigationService.pushPage(
page: FamilyMedicalScreen(
profiles: profiles,
onSelect: (FamilyFileResponseModelLists p1) {},
),
);
})
], ],
), ),
callBackFunc: () {}); callBackFunc: () {});
} }
@override @override
Future<void> showFamilyBottomSheetWithoutHWithChild( Future<void> showFamilyBottomSheetWithoutHWithChild({String? label, required String message, Widget? child, required Function() onOkPressed, Function()? onCancelPressed}) async {
{String? label, required String message, Widget? child, required Function() onOkPressed, Function()? onCancelPressed}) async {
final context = navigationService.navigatorKey.currentContext; final context = navigationService.navigatorKey.currentContext;
if (context == null) return; if (context == null) return;
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
@ -183,7 +196,7 @@ class DialogServiceImp implements DialogService {
} }
@override @override
Future<void> showReminderBottomSheetWithoutHWithChild({String? label, required String message, Widget? child, required Function() onOkPressed, Function()? onCancelPressed}) async { Future<void> showReminderBottomSheetWithoutHWithChild({String? label, required String message, Widget? child, required Function() onOkPressed, Function()? onCancelPressed}) async {
final context = navigationService.navigatorKey.currentContext; final context = navigationService.navigatorKey.currentContext;
if (context == null) return; if (context == null) return;
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
@ -195,14 +208,11 @@ class DialogServiceImp implements DialogService {
} }
@override @override
Future<void> showPhoneNumberPickerSheet( Future<void> showPhoneNumberPickerSheet({String? label, String? message, required Function() onSMSPress, required Function() onWhatsappPress}) async {
{String? label, String? message, required Function() onSMSPress, required Function() onWhatsappPress}) async {
final context = navigationService.navigatorKey.currentContext; final context = navigationService.navigatorKey.currentContext;
if (context == null) return; if (context == null) return;
showCommonBottomSheetWithoutHeight(context, showCommonBottomSheetWithoutHeight(context,
title: label ?? "", title: label ?? "", child: showPhoneNumberPickerWidget(context: context, message: message, onSMSPress: onSMSPress, onWhatsappPress: onWhatsappPress), callBackFunc: () {});
child: showPhoneNumberPickerWidget(context: context, message: message, onSMSPress: onSMSPress, onWhatsappPress: onWhatsappPress),
callBackFunc: () {});
} }
@override @override
@ -218,8 +228,7 @@ class DialogServiceImp implements DialogService {
} }
} }
Widget exceptionBottomSheetWidget( Widget exceptionBottomSheetWidget({required BuildContext context, required String message, required Function() onOkPressed, Function()? onCancelPressed}) {
{required BuildContext context, required String message, required Function() onOkPressed, Function()? onCancelPressed}) {
return Column( return Column(
children: [ children: [
(message).toText16(isBold: false, color: AppColors.textColor), (message).toText16(isBold: false, color: AppColors.textColor),
@ -274,10 +283,7 @@ Widget exceptionBottomSheetWidget(
); );
} }
Widget showPhoneNumberPickerWidget({required BuildContext context, String? message, required Function() onSMSPress, required Function() onWhatsappPress}) {
Widget showPhoneNumberPickerWidget(
{required BuildContext context, String? message, required Function() onSMSPress, required Function() onWhatsappPress}) {
return StatefulBuilder(builder: (BuildContext context, StateSetter setModalState) { return StatefulBuilder(builder: (BuildContext context, StateSetter setModalState) {
return Column( return Column(
children: [ children: [

Loading…
Cancel
Save