pull/199/head
haroon amjad 1 day ago
parent d053f58b7d
commit 0ed6103b15

@ -165,11 +165,11 @@ extension SmoothContainerExtension on ShapeBorder {
shadows: hasShadow
? [
BoxShadow(
color: hasDenseShadow ? const Color(0xff000000).withOpacity(.30) : const Color(0xff000000).withOpacity(.1),
// color: AppColors.primaryRedColor.withOpacity(.5),
blurRadius: 10,
// color: hasDenseShadow ? const Color(0xff000000).withOpacity(.06) : const Color(0xff000000).withOpacity(.1),
color: const Color(0xffE1E1E1).withOpacity(1.0),
blurRadius: 0,
spreadRadius: 0,
offset: const Offset(0, 0),
offset: const Offset(1, 0),
)
]
: [],

@ -17,6 +17,7 @@ import 'package:hmg_patient_app_new/presentation/contact_us/live_chat_page.dart'
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
class ContactUs extends StatelessWidget {
ContactUs({super.key});
@ -33,6 +34,15 @@ class ContactUs extends StatelessWidget {
contactUsViewModel = Provider.of<ContactUsViewModel>(context);
return Column(
children: [
checkInOptionCard(
AppAssets.call_fill,
LocaleKeys.callNow.tr(),
// LocaleKeys.viewNearestHMGLocationsviewNearestHMGLocations.tr(),
"Call for immediate assistance",
).onPress(() {
launchUrl(Uri.parse("tel://" + "+966 92 006 6666"));
}),
SizedBox(height: 16.h),
checkInOptionCard(
AppAssets.location,
LocaleKeys.findUs.tr(),
@ -46,26 +56,23 @@ class ContactUs extends StatelessWidget {
page: FindUsPage(),
),
);
}, onFailure: () {
Navigator.pop(context);
Navigator.of(context).push(
CustomPageRoute(
page: FindUsPage(),
),
);
}, onLocationDeniedForever: () {
Navigator.pop(context);
Navigator.of(context).push(
CustomPageRoute(
page: FindUsPage(),
),
);
});
}),
SizedBox(height: 16.h),
checkInOptionCard(
AppAssets.feedbackFill,
LocaleKeys.feedback.tr(),
LocaleKeys.provideFeedbackOnServices.tr(),
).onPress(() {
contactUsViewModel.setSelectedFeedbackType(
FeedbackType(id: 5, nameEN: "Not classified", nameAR: 'غير محدد'),
);
contactUsViewModel.setIsSendFeedbackTabSelected(true);
Navigator.pop(context);
Navigator.of(context).push(
CustomPageRoute(
page: FeedbackPage(),
),
);
}),
SizedBox(height: 16.h),
checkInOptionCard(
AppAssets.ask_doctor_icon,
LocaleKeys.liveChat.tr(),

File diff suppressed because it is too large Load Diff

@ -1,10 +1,20 @@
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/insurance/insurance_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/insurance/insurance_home_page.dart';
import 'package:hmg_patient_app_new/presentation/profile_settings/profile_settings.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/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/routes/spring_page_route_builder.dart';
import 'package:smooth_corner/smooth_corner.dart';
class WelcomeWidget extends StatelessWidget {
final String name;
@ -20,33 +30,41 @@ class WelcomeWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(30),
child: Row(
mainAxisSize: MainAxisSize.min,
spacing: 8.h,
children: [
Image.asset(imageUrl, width: 40, height: 40),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 4.h,
return Column(
children: [
InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(30),
child: Row(
mainAxisSize: MainAxisSize.min,
spacing: 8.h,
children: [
LocaleKeys.welcome.tr(context: context).toText14(color: AppColors.greyTextColor, height: 1, weight: FontWeight.w500),
Row(
Icon(Icons.menu, color: AppColors.textColor).onPress(() {
Navigator.of(context).push(springPageRoute(ProfileSettings()));
}),
Image.asset(imageUrl, width: 40, height: 40),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 4.h,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Flexible(child: name.toText16(weight: FontWeight.w500, textOverflow: TextOverflow.ellipsis, maxlines: 1, height: 1, isEnglishOnly: true)),
Icon(Icons.keyboard_arrow_down, size: 20, color: AppColors.greyTextColor),
LocaleKeys.welcome.tr(context: context).toText14(color: AppColors.greyTextColor, height: 1, weight: FontWeight.w500),
Row(
spacing: 4.h,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Flexible(child: name.toText16(weight: FontWeight.w500, textOverflow: TextOverflow.ellipsis, maxlines: 1, height: 1, isEnglishOnly: true)),
// Icon(Icons.keyboard_arrow_down, size: 20, color: AppColors.greyTextColor),
Utils.buildSvgWithAssets(icon: AppAssets.arrowRight, height: 22.h, width: 22.w)
],
),
],
),
).expanded,
],
).expanded,
],
),
),
),
],
);
}
}

@ -199,18 +199,23 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
],
),
SizedBox(width: 4.h),
Utils.buildSvgWithAssets(icon: AppAssets.arrow_down, height: 22.h, width: 22.w)
Utils.buildSvgWithAssets(icon: AppAssets.arrowRight, height: 22.h, width: 22.w)
],
).onPress(() {
DialogService dialogService = getIt.get<DialogService>();
dialogService.showFamilyBottomSheetWithoutH(
label: LocaleKeys.familyTitle.tr(context: context),
message: "",
isShowManageButton: true,
onSwitchPress: (FamilyFileResponseModelLists profile) {
medicalFileViewModel.switchFamilyFiles(responseID: profile.responseId, patientID: profile.patientId, phoneNumber: profile.mobileNumber);
},
profiles: medicalFileViewModel.patientFamilyFiles);
Navigator.of(context).push(
CustomPageRoute(
page: FamilyMedicalScreen(),
),
);
// DialogService dialogService = getIt.get<DialogService>();
// dialogService.showFamilyBottomSheetWithoutH(
// label: LocaleKeys.familyTitle.tr(context: context),
// message: "",
// isShowManageButton: true,
// onSwitchPress: (FamilyFileResponseModelLists profile) {
// medicalFileViewModel.switchFamilyFiles(responseID: profile.responseId, patientID: profile.patientId, phoneNumber: profile.mobileNumber);
// },
// profiles: medicalFileViewModel.patientFamilyFiles);
}),
isLeading: widget.showBackIcon,
// leadingCallback: () {

@ -1,3 +1,5 @@
import 'dart:async';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
@ -9,16 +11,22 @@ 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/habib_wallet/habib_wallet_view_model.dart';
import 'package:hmg_patient_app_new/features/insurance/insurance_view_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/presentation/insurance/widgets/insurance_update_details_card.dart';
import 'package:hmg_patient_app_new/services/dialog_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/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/chip/custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:provider/provider.dart';
class FamilyCards extends StatefulWidget {
final List<FamilyFileResponseModelLists> profiles;
late List<FamilyFileResponseModelLists>? profileViewList;
final Function(FamilyFileResponseModelLists) onSelect;
final Function(FamilyFileResponseModelLists) onRemove;
final bool isShowDetails;
@ -28,11 +36,12 @@ class FamilyCards extends StatefulWidget {
final bool isShowRemoveButton;
final bool isForWalletRecharge;
const FamilyCards(
FamilyCards(
{super.key,
required this.profiles,
required this.onSelect,
required this.onRemove,
this.profileViewList,
this.isShowDetails = false,
this.isBottomSheet = false,
this.isRequestDesign = false,
@ -46,9 +55,22 @@ class FamilyCards extends StatefulWidget {
class _FamilyCardsState extends State<FamilyCards> {
AppState appState = getIt<AppState>();
late InsuranceViewModel insuranceViewModel;
@override
void initState() {
scheduleMicrotask(() {
insuranceViewModel.initInsuranceProvider();
});
super.initState();
}
@override
Widget build(BuildContext context) {
widget.profileViewList = [];
widget.profileViewList!.addAll(widget.profiles);
widget.profileViewList!.removeWhere((element) => element.responseId == appState.getAuthenticatedUser()?.patientId);
insuranceViewModel = Provider.of<InsuranceViewModel>(context, listen: false);
DialogService dialogService = getIt.get<DialogService>();
if (widget.isRequestDesign) {
return Column(
@ -71,15 +93,15 @@ class _FamilyCardsState extends State<FamilyCards> {
],
),
SizedBox(height: 24.h),
widget.profiles.where((profile) => profile.isRequestFromMySide ?? false).isEmpty
widget.profileViewList!.where((profile) => profile.isRequestFromMySide ?? false).isEmpty
? Utils.getNoDataWidget(context)
: ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.zero,
itemCount: widget.profiles.where((profile) => profile.isRequestFromMySide ?? false).length,
itemCount: widget.profileViewList!.where((profile) => profile.isRequestFromMySide ?? false).length,
itemBuilder: (context, index) {
final mySideProfiles = widget.profiles.where((profile) => profile.isRequestFromMySide ?? false).toList();
final mySideProfiles = widget.profileViewList!.where((profile) => profile.isRequestFromMySide ?? false).toList();
FamilyFileResponseModelLists profile = mySideProfiles[index];
return Container(
margin: EdgeInsets.only(bottom: 12.h),
@ -146,113 +168,252 @@ class _FamilyCardsState extends State<FamilyCards> {
],
);
} else {
return GridView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: widget.profiles.length,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 10.w,
mainAxisSpacing: 10.h,
childAspectRatio: widget.isShowDetails ? 0.56.h : 0.74.h,
),
padding: EdgeInsets.only(bottom: 20.h),
itemBuilder: (context, index) {
final profile = widget.profiles[index];
final isActive = (profile.responseId == appState.getAuthenticatedUser()?.patientId);
final isParentUser = appState.getAuthenticatedUser()?.isParentUser ?? false;
final canSwitch = isParentUser || (!isParentUser && profile.responseId == appState.getSuperUserID);
return Container(
padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r),
child: Opacity(
opacity: isActive || profile.status == FamilyFileEnum.pending.toInt || !canSwitch ? 0.4 : 1.0, // Fade all content if active
child: Stack(
return Column(
children: [
Container(
width: double.infinity,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.r),
child: Padding(
padding: EdgeInsets.all(16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
mainAxisSize: MainAxisSize.min,
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Utils.buildImgWithAssets(
icon: profile.gender == null
? AppAssets.dummyUser
: profile.gender == 1
? ((profile.age ?? 0) < 7 ? AppAssets.babyBoyImg : AppAssets.maleImg)
: (profile.age! < 7 ? AppAssets.babyGirlImg : AppAssets.femaleImg),
width: 72.h,
height: 70.h,
Image.asset(appState.getAuthenticatedUser()?.gender == 1 ? AppAssets.maleImg : AppAssets.femaleImg, width: 56.w, height: 56.h),
SizedBox(width: 8.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: MediaQuery.of(context).size.width * 0.6,
child: "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}"
.toText18(isBold: true, weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 2),
),
SizedBox(height: 4.h),
Wrap(
direction: Axis.horizontal,
spacing: 4.w,
runSpacing: 6.w,
children: [
AppCustomChipWidget(
icon: AppAssets.file_icon,
richText: "${LocaleKeys.fileno.tr(context: context)}: ${appState.getAuthenticatedUser()!.patientId}".toText10(isEnglishOnly: true),
labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w),
),
AppCustomChipWidget(
icon: AppAssets.checkmark_icon,
labelText: LocaleKeys.verified.tr(context: context),
iconColor: AppColors.successColor,
labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w),
),
],
),
],
)
],
),
SizedBox(height: 16.h),
Divider(color: AppColors.dividerColor, height: 1.h),
SizedBox(height: 16.h),
Wrap(
direction: Axis.horizontal,
spacing: 4.h,
runSpacing: 4.h,
children: [
AppCustomChipWidget(
labelText: LocaleKeys.ageYearsOld.tr(namedArgs: {'age': '${appState.getAuthenticatedUser()!.age}', 'yearsOld': LocaleKeys.yearsOld.tr(context: context)}, context: context),
labelPadding: EdgeInsetsDirectional.only(start: 8.w, end: 8.w),
),
SizedBox(height: 8.h),
(profile.patientName ?? "Unknown").toText14(isBold: false, isCenter: true, maxlines: 1, weight: FontWeight.w600),
SizedBox(height: 8.h),
CustomChipWidget(
chipType: ChipTypeEnum.alert,
backgroundColor: AppColors.lightGrayBGColor,
chipText: "Relation: ${profile.relationship ?? " N/A"}",
iconAsset: AppAssets.heart,
isShowBorder: false,
borderRadius: 8.h,
textColor: AppColors.textColor),
widget.isShowDetails ? SizedBox(height: 4.h) : SizedBox(),
widget.isShowDetails
? CustomChipWidget(
AppCustomChipWidget(
icon: AppAssets.blood_icon,
labelText: appState.getUserBloodGroup.isEmpty ? "N/A" : appState.getUserBloodGroup,
iconColor: AppColors.primaryRedColor,
labelPadding: EdgeInsetsDirectional.only(start: -6.w, end: 6.w),
padding: EdgeInsets.zero,
),
Consumer<InsuranceViewModel>(builder: (context, insuranceVM, child) {
return AppCustomChipWidget(
icon: insuranceVM.isInsuranceExpired
? AppAssets.cancel_circle_icon
: insuranceVM.isInsuranceActive
? AppAssets.insurance_active_icon
: AppAssets.alertSquare,
labelText: insuranceVM.isInsuranceExpired
? LocaleKeys.insuranceExpired.tr(context: context)
: insuranceVM.isInsuranceActive
? LocaleKeys.insuranceActive.tr(context: context)
: LocaleKeys.insuranceInActive.tr(context: context),
iconColor: insuranceVM.isInsuranceExpired
? AppColors.primaryRedColor
: insuranceVM.isInsuranceActive
? AppColors.successColor
: AppColors.warningColorYellow,
textColor: insuranceVM.isInsuranceExpired
? AppColors.primaryRedColor
: insuranceVM.isInsuranceActive
? AppColors.successColor
: AppColors.warningColorYellow,
iconSize: 12.w,
deleteIcon: insuranceVM.isInsuranceActive ? null : AppAssets.forward_chevron_icon,
deleteIconColor: insuranceVM.isInsuranceExpired
? AppColors.primaryRedColor
: insuranceVM.isInsuranceActive
? AppColors.successColor
: AppColors.warningColorYellow,
deleteIconHasColor: true,
onChipTap: () {
if (!insuranceVM.isInsuranceActive) {
insuranceVM.setIsInsuranceUpdateDetailsLoading(true);
insuranceVM.getPatientInsuranceDetailsForUpdate(
appState.getAuthenticatedUser()!.patientId.toString(), appState.getAuthenticatedUser()!.patientIdentificationNo.toString());
showCommonBottomSheetWithoutHeight(context, child: PatientInsuranceCardUpdateCard(), callBackFunc: () {}, title: "", isCloseButtonVisible: false, isFullScreen: false);
// showCommonBottomSheetWithoutHeight(
// title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!),
// navigationService.navigatorKey.currentContext!,
// child: Utils.getWarningWidget(
// loadingText: LocaleKeys.insuranceInActiveContactSupport.tr(context: context),
// confirmText: LocaleKeys.contactUs.tr(context: context),
// isShowActionButtons: true,
// onCancelTap: () {
// navigationService.pop();
// },
// onConfirmTap: () async {
// launchUrl(Uri.parse("tel://" + "+966 92 006 6666"));
// }),
// callBackFunc: () {},
// isFullScreen: false,
// isCloseButtonVisible: true,
// );
}
},
backgroundColor: insuranceVM.isInsuranceExpired
? AppColors.primaryRedColor.withOpacity(0.1)
: insuranceVM.isInsuranceActive
? AppColors.successColor.withOpacity(0.1)
: AppColors.warningColorYellow.withOpacity(0.1),
labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: insuranceVM.isInsuranceActive ? 6.w : 0.w),
).toShimmer2(isShow: insuranceVM.isInsuranceLoading);
}),
],
),
],
),
),
).paddingSymmetrical(0.w, 0.0),
SizedBox(height: 16.h),
GridView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: widget.profileViewList!.length,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 10.w,
mainAxisSpacing: 10.h,
childAspectRatio: widget.isShowDetails ? 0.56.h : 0.74.h,
),
padding: EdgeInsets.only(bottom: 20.h),
itemBuilder: (context, index) {
final profile = widget.profileViewList![index];
final isActive = (profile.responseId == appState.getAuthenticatedUser()?.patientId);
final isParentUser = appState.getAuthenticatedUser()?.isParentUser ?? false;
final canSwitch = isParentUser || (!isParentUser && profile.responseId == appState.getSuperUserID);
return Container(
padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r),
child: Opacity(
opacity: isActive || profile.status == FamilyFileEnum.pending.toInt || !canSwitch ? 0.4 : 1.0, // Fade all content if active
child: Stack(
children: [
Column(
mainAxisSize: MainAxisSize.min,
children: [
Utils.buildImgWithAssets(
icon: profile.gender == null
? AppAssets.dummyUser
: profile.gender == 1
? ((profile.age ?? 0) < 7 ? AppAssets.babyBoyImg : AppAssets.maleImg)
: (profile.age! < 7 ? AppAssets.babyGirlImg : AppAssets.femaleImg),
width: 72.h,
height: 70.h,
),
SizedBox(height: 8.h),
(profile.patientName ?? "Unknown").toText14(isBold: false, isCenter: true, maxlines: 1, weight: FontWeight.w600),
SizedBox(height: 8.h),
CustomChipWidget(
chipType: ChipTypeEnum.alert,
backgroundColor: AppColors.lightGrayBGColor,
chipText: "Age:${profile.age ?? "N/A"} Years",
chipText: "Relation: ${profile.relationship ?? " N/A"}",
iconAsset: AppAssets.heart,
isShowBorder: false,
borderRadius: 8.h,
textColor: AppColors.textColor,
)
: SizedBox(),
widget.isShowDetails
? SizedBox(height: 8.h)
: SizedBox(
height: 4.h,
),
Spacer(),
widget.isForWalletRecharge ? CustomButton(
height: 40.h,
onPressed: () {
widget.onSelect(profile);
// if (canSwitch) widget.onSelect(profile);
},
text: LocaleKeys.select.tr(context: context),
backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor,
fontSize: 13.h,
icon: AppAssets.activeCheck,
iconColor: isActive || !canSwitch ? (isActive ? null : AppColors.greyTextColor) : AppColors.primaryRedColor,
padding: EdgeInsets.symmetric(vertical: 0, horizontal: 0),
).paddingOnly(top: 0, bottom: 0) : CustomButton(
height: 40.h,
onPressed: () {
if (canSwitch) widget.onSelect(profile);
},
text: isActive ? LocaleKeys.active.tr(context: context) : LocaleKeys.switchLogin.tr(context: context),
backgroundColor: isActive || !canSwitch ? Colors.grey.shade200 : AppColors.secondaryLightRedColor,
borderColor: isActive || !canSwitch ? Colors.grey.shade200 : AppColors.secondaryLightRedColor,
textColor: isActive || !canSwitch ? AppColors.greyTextColor : AppColors.primaryRedColor,
fontSize: 13.h,
icon: isActive ? AppAssets.activeCheck : AppAssets.switch_user,
iconColor: isActive || !canSwitch ? (isActive ? null : AppColors.greyTextColor) : AppColors.primaryRedColor,
padding: EdgeInsets.symmetric(vertical: 0, horizontal: 0),
).paddingOnly(top: 0, bottom: 0),
textColor: AppColors.textColor),
widget.isShowDetails ? SizedBox(height: 4.h) : SizedBox(),
widget.isShowDetails
? CustomChipWidget(
chipType: ChipTypeEnum.alert,
backgroundColor: AppColors.lightGrayBGColor,
chipText: "Age: ${profile.age ?? "N/A"} Years",
isShowBorder: false,
borderRadius: 8.h,
textColor: AppColors.textColor,
)
: SizedBox(),
widget.isShowDetails
? SizedBox(height: 8.h)
: SizedBox(
height: 4.h,
),
Spacer(),
widget.isForWalletRecharge
? CustomButton(
height: 40.h,
onPressed: () {
widget.onSelect(profile);
// if (canSwitch) widget.onSelect(profile);
},
text: LocaleKeys.select.tr(context: context),
backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor,
fontSize: 13.h,
icon: AppAssets.activeCheck,
iconColor: isActive || !canSwitch ? (isActive ? null : AppColors.greyTextColor) : AppColors.primaryRedColor,
padding: EdgeInsets.symmetric(vertical: 0, horizontal: 0),
).paddingOnly(top: 0, bottom: 0)
: CustomButton(
height: 40.h,
onPressed: () {
if (canSwitch) widget.onSelect(profile);
},
text: isActive ? LocaleKeys.active.tr(context: context) : LocaleKeys.switchLogin.tr(context: context),
backgroundColor: isActive || !canSwitch ? Colors.grey.shade200 : AppColors.secondaryLightRedColor,
borderColor: isActive || !canSwitch ? Colors.grey.shade200 : AppColors.secondaryLightRedColor,
textColor: isActive || !canSwitch ? AppColors.greyTextColor : AppColors.primaryRedColor,
fontSize: 13.h,
icon: isActive ? AppAssets.activeCheck : AppAssets.switch_user,
iconColor: isActive || !canSwitch ? (isActive ? null : AppColors.greyTextColor) : AppColors.primaryRedColor,
padding: EdgeInsets.symmetric(vertical: 0, horizontal: 0),
).paddingOnly(top: 0, bottom: 0),
],
),
if (widget.isShowRemoveButton) ...[
Positioned(
top: 0,
right: 0,
child: Utils.buildSvgWithAssets(icon: AppAssets.deleteIcon).onPress(() {
if (!isActive) widget.onRemove(profile);
}),
),
],
],
),
if (widget.isShowRemoveButton) ...[
Positioned(
top: 0,
right: 0,
child: Utils.buildSvgWithAssets(icon: AppAssets.deleteIcon).onPress(() {
if (!isActive) widget.onRemove(profile);
}),
),
],
],
),
),
);
},
),
);
},
),
],
);
}
}
@ -260,15 +421,15 @@ class _FamilyCardsState extends State<FamilyCards> {
Widget manageFamily() {
NavigationService navigationService = getIt<NavigationService>();
return widget.profiles.where((profile) => !(profile.isRequestFromMySide ?? false)).isEmpty
return widget.profileViewList!.where((profile) => !(profile.isRequestFromMySide ?? false)).isEmpty
? Utils.getNoDataWidget(context)
: ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsetsGeometry.zero,
itemCount: widget.profiles.where((profile) => !(profile.isRequestFromMySide ?? false)).length,
itemCount: widget.profileViewList!.where((profile) => !(profile.isRequestFromMySide ?? false)).length,
itemBuilder: (context, index) {
final otherProfiles = widget.profiles.where((profile) => !(profile.isRequestFromMySide ?? false)).toList();
final otherProfiles = widget.profileViewList!.where((profile) => !(profile.isRequestFromMySide ?? false)).toList();
FamilyFileResponseModelLists profile = otherProfiles[index];
return Container(
margin: EdgeInsets.only(bottom: 12.h),

@ -15,12 +15,15 @@ import 'package:hmg_patient_app_new/extensions/int_extensions.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/features/contact_us/contact_us_view_model.dart';
import 'package:hmg_patient_app_new/features/contact_us/models/feedback_type.dart';
import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_view_model.dart';
import 'package:hmg_patient_app_new/features/insurance/insurance_view_model.dart';
import 'package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart';
import 'package:hmg_patient_app_new/features/medical_file/models/family_file_response_model.dart';
import 'package:hmg_patient_app_new/features/profile_settings/profile_settings_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/contact_us/feedback_page.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/insurance/widgets/insurance_update_details_card.dart';
@ -88,10 +91,12 @@ class ProfileSettingsState extends State<ProfileSettings> {
int length = 3;
final SwiperController _controller = SwiperController();
late InsuranceViewModel insuranceViewModel;
late ContactUsViewModel contactUsViewModel;
@override
Widget build(BuildContext context) {
insuranceViewModel = Provider.of<InsuranceViewModel>(context, listen: false);
contactUsViewModel = Provider.of<ContactUsViewModel>(context, listen: false);
return CollapsingListView(
title: LocaleKeys.profileAndSettings.tr(context: context),
logout: () {
@ -106,102 +111,102 @@ class ProfileSettingsState extends State<ProfileSettings> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: dynamicItemHeight(context) + 20 + 30, // itemHeight + shadow padding (10 top + 10 bottom) + pagination dots space
child: Swiper(
itemCount: medicalVm.patientFamilyFiles.length,
layout: SwiperLayout.STACK,
loop: true,
itemHeight: dynamicItemHeight(context) + 20,
// extra space for shadow
itemWidth: SizeUtils.width - 30.w,
indicatorLayout: PageIndicatorLayout.COLOR,
axisDirection: getIt.get<AppState>().isArabic() ? AxisDirection.left : AxisDirection.right,
controller: _controller,
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: (180.h + 20 + 8.h + 24.h)),
builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor),
),
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: FamilyCardWidget(
profile: medicalVm.patientFamilyFiles[index],
onAddFamilyMemberPress: () {
DialogService dialogService = getIt.get<DialogService>();
dialogService.showAddFamilyFileSheet(
label: LocaleKeys.addFamilyMember.tr(context: context),
message: LocaleKeys.pleaseFillBelowFieldToAddNewFamilyMember.tr(context: context),
onVerificationPress: () {
medicalVm.addFamilyFile(otpTypeEnum: OTPTypeEnum.sms);
});
},
onFamilySwitchPress: (FamilyFileResponseModelLists profile) {
medicalVm.switchFamilyFiles(responseID: profile.responseId, patientID: profile.patientId, phoneNumber: profile.mobileNumber);
},
).paddingOnly(right: 16.w, left: 8.w),
);
},
),
),
SizedBox(height: 16.h),
GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: isTablet ? 3 : 2),
physics: const NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(left: 24.w, right: 24.w, bottom: 24.h),
shrinkWrap: true,
children: [
Container(
padding: EdgeInsets.all(16.w),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 20.r,
hasShadow: true,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
// spacing: 4.h,
children: [
Row(
spacing: 8.w,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Utils.buildSvgWithAssets(icon: AppAssets.wallet, width: 40.w, height: 40.h, applyThemeColor: false),
LocaleKeys.habibWallet.tr(context: context).toText16(weight: FontWeight.w600, maxlines: 2).expanded,
Utils.buildSvgWithAssets(icon: getIt.get<AppState>().isArabic() ? AppAssets.arrow_back : AppAssets.arrow_forward),
],
),
Spacer(),
Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) {
return Utils.getPaymentAmountWithSymbol2(habibWalletVM.habibWalletAmount, isExpanded: false)
.toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.r, width: 80.w, height: 24.h);
}),
Spacer(),
CustomButton(
height: 40.h,
icon: AppAssets.recharge_icon,
iconSize: 22.w,
iconColor: AppColors.infoColor,
textColor: AppColors.infoColor,
text: LocaleKeys.recharge.tr(context: context),
borderWidth: 0.w,
fontWeight: FontWeight.w500,
borderColor: Colors.transparent,
backgroundColor: Color(0xff45A2F8).withValues(alpha: 0.08),
padding: EdgeInsets.all(8.w),
fontSize: 14.f,
onPressed: () {
Navigator.of(context).push(CustomPageRoute(page: RechargeWalletPage()));
},
),
],
).onPress(() {
Navigator.of(context).push(CustomPageRoute(page: HabibWalletPage()));
}),
),
],
),
// SizedBox(
// height: dynamicItemHeight(context) + 20 + 30, // itemHeight + shadow padding (10 top + 10 bottom) + pagination dots space
// child: Swiper(
// itemCount: medicalVm.patientFamilyFiles.length,
// layout: SwiperLayout.STACK,
// loop: true,
// itemHeight: dynamicItemHeight(context) + 20,
// // extra space for shadow
// itemWidth: SizeUtils.width - 30.w,
// indicatorLayout: PageIndicatorLayout.COLOR,
// axisDirection: getIt.get<AppState>().isArabic() ? AxisDirection.left : AxisDirection.right,
// controller: _controller,
// pagination: SwiperPagination(
// alignment: Alignment.bottomCenter,
// margin: EdgeInsets.only(top: (180.h + 20 + 8.h + 24.h)),
// builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor),
// ),
// itemBuilder: (BuildContext context, int index) {
// return Padding(
// padding: const EdgeInsets.symmetric(vertical: 10),
// child: FamilyCardWidget(
// profile: medicalVm.patientFamilyFiles[index],
// onAddFamilyMemberPress: () {
// DialogService dialogService = getIt.get<DialogService>();
// dialogService.showAddFamilyFileSheet(
// label: LocaleKeys.addFamilyMember.tr(context: context),
// message: LocaleKeys.pleaseFillBelowFieldToAddNewFamilyMember.tr(context: context),
// onVerificationPress: () {
// medicalVm.addFamilyFile(otpTypeEnum: OTPTypeEnum.sms);
// });
// },
// onFamilySwitchPress: (FamilyFileResponseModelLists profile) {
// medicalVm.switchFamilyFiles(responseID: profile.responseId, patientID: profile.patientId, phoneNumber: profile.mobileNumber);
// },
// ).paddingOnly(right: 16.w, left: 8.w),
// );
// },
// ),
// ),
// SizedBox(height: 16.h),
// GridView(
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: isTablet ? 3 : 2),
// physics: const NeverScrollableScrollPhysics(),
// padding: EdgeInsets.only(left: 24.w, right: 24.w, bottom: 24.h),
// shrinkWrap: true,
// children: [
// Container(
// padding: EdgeInsets.all(16.w),
// decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
// color: AppColors.whiteColor,
// borderRadius: 20.r,
// hasShadow: true,
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// // spacing: 4.h,
// children: [
// Row(
// spacing: 8.w,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Utils.buildSvgWithAssets(icon: AppAssets.wallet, width: 40.w, height: 40.h, applyThemeColor: false),
// LocaleKeys.habibWallet.tr(context: context).toText16(weight: FontWeight.w600, maxlines: 2).expanded,
// Utils.buildSvgWithAssets(icon: getIt.get<AppState>().isArabic() ? AppAssets.arrow_back : AppAssets.arrow_forward),
// ],
// ),
// Spacer(),
// Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) {
// return Utils.getPaymentAmountWithSymbol2(habibWalletVM.habibWalletAmount, isExpanded: false)
// .toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.r, width: 80.w, height: 24.h);
// }),
// Spacer(),
// CustomButton(
// height: 40.h,
// icon: AppAssets.recharge_icon,
// iconSize: 22.w,
// iconColor: AppColors.infoColor,
// textColor: AppColors.infoColor,
// text: LocaleKeys.recharge.tr(context: context),
// borderWidth: 0.w,
// fontWeight: FontWeight.w500,
// borderColor: Colors.transparent,
// backgroundColor: Color(0xff45A2F8).withValues(alpha: 0.08),
// padding: EdgeInsets.all(8.w),
// fontSize: 14.f,
// onPressed: () {
// Navigator.of(context).push(CustomPageRoute(page: RechargeWalletPage()));
// },
// ),
// ],
// ).onPress(() {
// Navigator.of(context).push(CustomPageRoute(page: HabibWalletPage()));
// }),
// ),
// ],
// ),
LocaleKeys.quickActions.tr(context: context).toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1).paddingOnly(left: 24.w, right: 24.w),
Container(
margin: EdgeInsets.only(left: 24.w, right: 24.w, top: 16.h, bottom: 24.h),
@ -253,31 +258,31 @@ class ProfileSettingsState extends State<ProfileSettings> {
// ],
// ),
// ),
LocaleKeys.personalInformation.tr(context: context).toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1).paddingOnly(left: 24.w, right: 24.w),
Container(
margin: EdgeInsets.only(left: 24.w, right: 24.w, top: 16.h, bottom: 24.h),
padding: EdgeInsets.only(top: 4.h, bottom: 4.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r, hasShadow: true),
child: Column(
children: [
actionItem(AppAssets.email_transparent, LocaleKeys.updateEmailAddress.tr(context: context), () {
showCommonBottomSheetWithoutHeight(
context,
title: LocaleKeys.updateEmailAddress.tr(context: context),
child: UpdateEmailDialog(),
callBackFunc: () {},
isFullScreen: false,
);
}),
// 1.divider,
// actionItem(AppAssets.smart_phone_fill, "Phone Number".needTranslation, () {}),
// 1.divider,
// actionItem(AppAssets.my_address, "My Addresses".needTranslation, () {}),
// 1.divider,
// actionItem(AppAssets.emergency, "Emergency Contact".needTranslation, () {}),
],
),
),
// LocaleKeys.personalInformation.tr(context: context).toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1).paddingOnly(left: 24.w, right: 24.w),
// Container(
// margin: EdgeInsets.only(left: 24.w, right: 24.w, top: 16.h, bottom: 24.h),
// padding: EdgeInsets.only(top: 4.h, bottom: 4.h),
// decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r, hasShadow: true),
// child: Column(
// children: [
// actionItem(AppAssets.email_transparent, LocaleKeys.updateEmailAddress.tr(context: context), () {
// showCommonBottomSheetWithoutHeight(
// context,
// title: LocaleKeys.updateEmailAddress.tr(context: context),
// child: UpdateEmailDialog(),
// callBackFunc: () {},
// isFullScreen: false,
// );
// }),
// // 1.divider,
// // actionItem(AppAssets.smart_phone_fill, "Phone Number".needTranslation, () {}),
// // 1.divider,
// // actionItem(AppAssets.my_address, "My Addresses".needTranslation, () {}),
// // 1.divider,
// // actionItem(AppAssets.emergency, "Emergency Contact".needTranslation, () {}),
// ],
// ),
// ),
LocaleKeys.helpAndSupport.tr(context: context).toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1).paddingOnly(left: 24.w, right: 24.w),
Container(
margin: EdgeInsets.only(left: 24.w, right: 24.w, top: 16.h),
@ -289,6 +294,19 @@ class ProfileSettingsState extends State<ProfileSettings> {
launchUrl(Uri.parse("tel://" + "+966 92 006 6666"));
}, trailingLabel: "92 006 6666"),
1.divider,
actionItem(AppAssets.feedbackFill, LocaleKeys.feedback.tr(context: context), () {
contactUsViewModel.setSelectedFeedbackType(
FeedbackType(id: 5, nameEN: "Not classified", nameAR: 'غير محدد'),
);
contactUsViewModel.setIsSendFeedbackTabSelected(true);
Navigator.pop(context);
Navigator.of(context).push(
CustomPageRoute(
page: FeedbackPage(),
),
);
}, trailingLabel: ""),
1.divider,
// actionItem(AppAssets.permission, LocaleKeys.permissions.tr(context: context), () {}, trailingLabel: "Location, Camera"),
// 1.divider,
actionItem(AppAssets.rate, LocaleKeys.rateApp.tr(context: context), () {

@ -166,7 +166,7 @@ class DialogServiceImp implements DialogService {
mainAxisAlignment: MainAxisAlignment.start,
children: [
if (message != null) (message).toText16(isBold: false, color: AppColors.textColor),
SizedBox(height: 24.h),
// SizedBox(height: 24.h),
FamilyCards(
profiles: profiles,
onSelect: (FamilyFileResponseModelLists profile) {
@ -190,6 +190,7 @@ class DialogServiceImp implements DialogService {
})
],
),
useSafeArea: true,
callBackFunc: () {});
}

@ -8,7 +8,7 @@ class AppColors {
static const transparent = Colors.transparent;
// Scaffold / Background
static Color get scaffoldBgColor => isDarkMode ? dark.scaffoldBgColor : const Color(0xFFF8F8F8);
static Color get scaffoldBgColor => isDarkMode ? dark.scaffoldBgColor : const Color(0xFFF0F0F0);
static Color get bottomSheetBgColor => isDarkMode ? dark.bottomSheetBgColor : const Color(0xFFF8F8FA);
static Color get lightGreyEFColor => isDarkMode ? dark.lightGreyEFColor : const Color(0xffeaeaff);
static Color get greyF7Color => isDarkMode ? dark.greyF7Color : const Color(0xffF7F7F7);

Loading…
Cancel
Save