|
|
|
|
@ -98,46 +98,53 @@ class ProfileSettingsState extends State<ProfileSettings> {
|
|
|
|
|
},
|
|
|
|
|
isClose: true,
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
padding: EdgeInsets.only(top: 24.h, bottom: 24.h),
|
|
|
|
|
padding: EdgeInsets.only(top: 0.h, bottom: 24.h),
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
child: Consumer2<ProfileSettingsViewModel, MedicalFileViewModel>(
|
|
|
|
|
builder: (context, profileVm, medicalVm, child) {
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Swiper(
|
|
|
|
|
itemCount: medicalVm.patientFamilyFiles.length,
|
|
|
|
|
layout: SwiperLayout.STACK,
|
|
|
|
|
loop: true,
|
|
|
|
|
itemHeight: dynamicItemHeight(context),
|
|
|
|
|
itemWidth: SizeUtils.width - 30.w,
|
|
|
|
|
indicatorLayout: PageIndicatorLayout.COLOR,
|
|
|
|
|
axisDirection: AxisDirection.right,
|
|
|
|
|
controller: _controller,
|
|
|
|
|
pagination: SwiperPagination(
|
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
|
margin: EdgeInsets.only(top: (210.h + 8.h + 24.h)),
|
|
|
|
|
builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor),
|
|
|
|
|
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: 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),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
return 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: 5.h),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
GridView(
|
|
|
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: isTablet ? 3 : 2),
|
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
|
@ -362,9 +369,7 @@ class FamilyCardWidget extends StatelessWidget {
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 24.r,
|
|
|
|
|
hasShadow: true,
|
|
|
|
|
),
|
|
|
|
|
borderRadius: 24.r, hasShadow: true, hasDenseShadow: true),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
@ -409,10 +414,11 @@ class FamilyCardWidget extends StatelessWidget {
|
|
|
|
|
iconColor: AppColors.primaryRedColor)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
Consumer<InsuranceViewModel>(builder: (context, insuranceVM, child) {
|
|
|
|
|
return AppCustomChipWidget(
|
|
|
|
|
icon: insuranceVM.isInsuranceExpired
|
|
|
|
|
? AppAssets.cancel_circle_icon
|
|
|
|
|
: insuranceVM.isInsuranceActive
|
|
|
|
|
return isActive
|
|
|
|
|
? AppCustomChipWidget(
|
|
|
|
|
icon: insuranceVM.isInsuranceExpired
|
|
|
|
|
? AppAssets.cancel_circle_icon
|
|
|
|
|
: insuranceVM.isInsuranceActive
|
|
|
|
|
? AppAssets.insurance_active_icon
|
|
|
|
|
: AppAssets.alertSquare,
|
|
|
|
|
labelText: insuranceVM.isInsuranceExpired
|
|
|
|
|
@ -468,7 +474,8 @@ class FamilyCardWidget extends StatelessWidget {
|
|
|
|
|
? 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);
|
|
|
|
|
).toShimmer2(isShow: insuranceVM.isInsuranceLoading)
|
|
|
|
|
: SizedBox.shrink();
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|