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