|
|
|
@ -67,68 +67,70 @@ class _FamilyCardsState extends State<FamilyCards> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(height: 24.h),
|
|
|
|
SizedBox(height: 24.h),
|
|
|
|
ListView.builder(
|
|
|
|
widget.profiles.where((profile) => profile.isRequestFromMySide ?? false).isEmpty
|
|
|
|
shrinkWrap: true,
|
|
|
|
? Utils.getNoDataWidget(context)
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
: ListView.builder(
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemCount: widget.profiles.where((profile) => profile.isRequestFromMySide ?? false).length,
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
final mySideProfiles = widget.profiles.where((profile) => profile.isRequestFromMySide ?? false).toList();
|
|
|
|
itemCount: widget.profiles.where((profile) => profile.isRequestFromMySide ?? false).length,
|
|
|
|
FamilyFileResponseModelLists profile = mySideProfiles[index];
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return Container(
|
|
|
|
final mySideProfiles = widget.profiles.where((profile) => profile.isRequestFromMySide ?? false).toList();
|
|
|
|
margin: EdgeInsets.only(bottom: 12.h),
|
|
|
|
FamilyFileResponseModelLists profile = mySideProfiles[index];
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.h),
|
|
|
|
return Container(
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24),
|
|
|
|
margin: EdgeInsets.only(bottom: 12.h),
|
|
|
|
child: Opacity(
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.h),
|
|
|
|
opacity: 1.0,
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24),
|
|
|
|
child: Column(
|
|
|
|
child: Opacity(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
opacity: 1.0,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
CustomChipWidget(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
height: 30.h,
|
|
|
|
children: [
|
|
|
|
chipType: ChipTypeEnum.alert,
|
|
|
|
CustomChipWidget(
|
|
|
|
backgroundColor: profile.status == FamilyFileEnum.pending.toInt
|
|
|
|
height: 30.h,
|
|
|
|
? AppColors.alertLightColor.withValues(alpha: 0.20)
|
|
|
|
chipType: ChipTypeEnum.alert,
|
|
|
|
: profile.status == FamilyFileEnum.rejected.toInt
|
|
|
|
backgroundColor: profile.status == FamilyFileEnum.pending.toInt
|
|
|
|
? AppColors.primaryRedColor.withValues(alpha: 0.20)
|
|
|
|
? AppColors.alertLightColor.withValues(alpha: 0.20)
|
|
|
|
: profile.status == FamilyFileEnum.active.toInt
|
|
|
|
: profile.status == FamilyFileEnum.rejected.toInt
|
|
|
|
? AppColors.lightGreenColor
|
|
|
|
? AppColors.primaryRedColor.withValues(alpha: 0.20)
|
|
|
|
: AppColors.lightGrayBGColor,
|
|
|
|
: profile.status == FamilyFileEnum.active.toInt
|
|
|
|
chipText: profile.statusDescription ?? "N/A",
|
|
|
|
? AppColors.lightGreenColor
|
|
|
|
iconAsset: null,
|
|
|
|
: AppColors.lightGrayBGColor,
|
|
|
|
isShowBorder: false,
|
|
|
|
chipText: profile.statusDescription ?? "N/A",
|
|
|
|
borderRadius: 8.h,
|
|
|
|
iconAsset: null,
|
|
|
|
textColor: profile.status == FamilyFileEnum.pending.toInt
|
|
|
|
isShowBorder: false,
|
|
|
|
? AppColors.alertLightColor
|
|
|
|
borderRadius: 8.h,
|
|
|
|
: profile.status == FamilyFileEnum.rejected.toInt
|
|
|
|
textColor: profile.status == FamilyFileEnum.pending.toInt
|
|
|
|
? AppColors.primaryRedColor
|
|
|
|
? AppColors.alertLightColor
|
|
|
|
: profile.status == FamilyFileEnum.active.toInt
|
|
|
|
: profile.status == FamilyFileEnum.rejected.toInt
|
|
|
|
? AppColors.textGreenColor
|
|
|
|
? AppColors.primaryRedColor
|
|
|
|
: AppColors.alertColor),
|
|
|
|
: profile.status == FamilyFileEnum.active.toInt
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
? AppColors.textGreenColor
|
|
|
|
Wrap(alignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.start, runAlignment: WrapAlignment.start, spacing: 0.h, children: [
|
|
|
|
: AppColors.alertColor),
|
|
|
|
(profile.patientName ?? "").toText14(isBold: false, isCenter: false, maxlines: 1, weight: FontWeight.w600),
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
(getStatusTextByRequest(FamilyFileEnum.values.firstWhere((e) => e.toInt == profile.status), profile.isRequestFromMySide ?? false))
|
|
|
|
Wrap(alignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.start, runAlignment: WrapAlignment.start, spacing: 0.h, children: [
|
|
|
|
.toText12(isBold: false, isCenter: false, maxLine: 1, fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
|
|
|
(profile.patientName ?? "").toText14(isBold: false, isCenter: false, maxlines: 1, weight: FontWeight.w600),
|
|
|
|
]),
|
|
|
|
(getStatusTextByRequest(FamilyFileEnum.values.firstWhere((e) => e.toInt == profile.status), profile.isRequestFromMySide ?? false))
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
.toText12(isBold: false, isCenter: false, maxLine: 1, fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
|
|
|
CustomChipWidget(
|
|
|
|
]),
|
|
|
|
height: 30.h,
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
chipType: ChipTypeEnum.alert,
|
|
|
|
CustomChipWidget(
|
|
|
|
backgroundColor: AppColors.lightGrayBGColor,
|
|
|
|
height: 30.h,
|
|
|
|
chipText: "Medical File: ${profile.responseId ?? "N/A"}",
|
|
|
|
chipType: ChipTypeEnum.alert,
|
|
|
|
iconAsset: null,
|
|
|
|
backgroundColor: AppColors.lightGrayBGColor,
|
|
|
|
isShowBorder: false,
|
|
|
|
chipText: "Medical File: ${profile.responseId ?? "N/A"}",
|
|
|
|
borderRadius: 8.h,
|
|
|
|
iconAsset: null,
|
|
|
|
textColor: AppColors.textColor),
|
|
|
|
isShowBorder: false,
|
|
|
|
],
|
|
|
|
borderRadius: 8.h,
|
|
|
|
),
|
|
|
|
textColor: AppColors.textColor),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(height: 20.h),
|
|
|
|
SizedBox(height: 20.h),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -231,115 +233,118 @@ class _FamilyCardsState extends State<FamilyCards> {
|
|
|
|
|
|
|
|
|
|
|
|
Widget manageFamily() {
|
|
|
|
Widget manageFamily() {
|
|
|
|
NavigationService navigationService = getIt<NavigationService>();
|
|
|
|
NavigationService navigationService = getIt<NavigationService>();
|
|
|
|
return ListView.builder(
|
|
|
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
return widget.profiles.where((profile) => !(profile.isRequestFromMySide ?? false)).isEmpty
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
? Utils.getNoDataWidget(context)
|
|
|
|
padding: EdgeInsetsGeometry.zero,
|
|
|
|
: ListView.builder(
|
|
|
|
itemCount: widget.profiles.where((profile) => !(profile.isRequestFromMySide ?? false)).length,
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
final otherProfiles = widget.profiles.where((profile) => !(profile.isRequestFromMySide ?? false)).toList();
|
|
|
|
padding: EdgeInsetsGeometry.zero,
|
|
|
|
FamilyFileResponseModelLists profile = otherProfiles[index];
|
|
|
|
itemCount: widget.profiles.where((profile) => !(profile.isRequestFromMySide ?? false)).length,
|
|
|
|
return Container(
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
margin: EdgeInsets.only(bottom: 12.h),
|
|
|
|
final otherProfiles = widget.profiles.where((profile) => !(profile.isRequestFromMySide ?? false)).toList();
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.h),
|
|
|
|
FamilyFileResponseModelLists profile = otherProfiles[index];
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24),
|
|
|
|
return Container(
|
|
|
|
child: Opacity(
|
|
|
|
margin: EdgeInsets.only(bottom: 12.h),
|
|
|
|
opacity: 1.0,
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.h),
|
|
|
|
child: Column(
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24),
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
child: Opacity(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
opacity: 1.0,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
CustomChipWidget(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
height: 30.h,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
chipType: ChipTypeEnum.alert,
|
|
|
|
children: [
|
|
|
|
backgroundColor: profile.status == FamilyFileEnum.pending.toInt
|
|
|
|
CustomChipWidget(
|
|
|
|
? AppColors.alertLightColor.withValues(alpha: 0.20)
|
|
|
|
height: 30.h,
|
|
|
|
: profile.status == FamilyFileEnum.rejected.toInt
|
|
|
|
chipType: ChipTypeEnum.alert,
|
|
|
|
? AppColors.primaryRedColor.withValues(alpha: 0.20)
|
|
|
|
backgroundColor: profile.status == FamilyFileEnum.pending.toInt
|
|
|
|
: profile.status == FamilyFileEnum.active.toInt
|
|
|
|
? AppColors.alertLightColor.withValues(alpha: 0.20)
|
|
|
|
? AppColors.lightGreenColor
|
|
|
|
: profile.status == FamilyFileEnum.rejected.toInt
|
|
|
|
: AppColors.lightGrayBGColor,
|
|
|
|
? AppColors.primaryRedColor.withValues(alpha: 0.20)
|
|
|
|
chipText: profile.statusDescription ?? "N/A",
|
|
|
|
: profile.status == FamilyFileEnum.active.toInt
|
|
|
|
iconAsset: null,
|
|
|
|
? AppColors.lightGreenColor
|
|
|
|
isShowBorder: false,
|
|
|
|
: AppColors.lightGrayBGColor,
|
|
|
|
borderRadius: 8.h,
|
|
|
|
chipText: profile.statusDescription ?? "N/A",
|
|
|
|
textColor: profile.status == FamilyFileEnum.pending.toInt
|
|
|
|
iconAsset: null,
|
|
|
|
? AppColors.alertLightColor
|
|
|
|
isShowBorder: false,
|
|
|
|
: profile.status == FamilyFileEnum.rejected.toInt
|
|
|
|
borderRadius: 8.h,
|
|
|
|
? AppColors.primaryRedColor
|
|
|
|
textColor: profile.status == FamilyFileEnum.pending.toInt
|
|
|
|
: profile.status == FamilyFileEnum.active.toInt
|
|
|
|
? AppColors.alertLightColor
|
|
|
|
? AppColors.textGreenColor
|
|
|
|
: profile.status == FamilyFileEnum.rejected.toInt
|
|
|
|
: AppColors.alertColor,
|
|
|
|
? AppColors.primaryRedColor
|
|
|
|
),
|
|
|
|
: profile.status == FamilyFileEnum.active.toInt
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
? AppColors.textGreenColor
|
|
|
|
Wrap(
|
|
|
|
: AppColors.alertColor,
|
|
|
|
alignment: WrapAlignment.start,
|
|
|
|
),
|
|
|
|
children: [
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
(profile.patientName ?? "").toText14(isBold: false, isCenter: true, maxlines: 1, weight: FontWeight.w600),
|
|
|
|
Wrap(
|
|
|
|
(getStatusTextByRequest(FamilyFileEnum.values.firstWhere((e) => e.toInt == profile.status), profile.isRequestFromMySide ?? false)).toText14(
|
|
|
|
alignment: WrapAlignment.start,
|
|
|
|
isBold: false,
|
|
|
|
children: [
|
|
|
|
isCenter: true,
|
|
|
|
(profile.patientName ?? "").toText14(isBold: false, isCenter: true, maxlines: 1, weight: FontWeight.w600),
|
|
|
|
maxlines: 1,
|
|
|
|
(getStatusTextByRequest(FamilyFileEnum.values.firstWhere((e) => e.toInt == profile.status), profile.isRequestFromMySide ?? false)).toText14(
|
|
|
|
weight: FontWeight.w500,
|
|
|
|
isBold: false,
|
|
|
|
color: AppColors.greyTextColor,
|
|
|
|
isCenter: true,
|
|
|
|
),
|
|
|
|
maxlines: 1,
|
|
|
|
],
|
|
|
|
weight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
color: AppColors.greyTextColor,
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
),
|
|
|
|
CustomChipWidget(
|
|
|
|
],
|
|
|
|
height: 30.h,
|
|
|
|
),
|
|
|
|
chipType: ChipTypeEnum.alert,
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
backgroundColor: AppColors.lightGrayBGColor,
|
|
|
|
CustomChipWidget(
|
|
|
|
chipText: "Medical File: ${profile.patientId ?? "N/A".needTranslation}",
|
|
|
|
height: 30.h,
|
|
|
|
iconAsset: null,
|
|
|
|
chipType: ChipTypeEnum.alert,
|
|
|
|
isShowBorder: false,
|
|
|
|
backgroundColor: AppColors.lightGrayBGColor,
|
|
|
|
borderRadius: 8.h,
|
|
|
|
chipText: "Medical File: ${profile.patientId ?? "N/A".needTranslation}",
|
|
|
|
textColor: AppColors.textColor,
|
|
|
|
iconAsset: null,
|
|
|
|
),
|
|
|
|
isShowBorder: false,
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
borderRadius: 8.h,
|
|
|
|
Row(
|
|
|
|
textColor: AppColors.textColor,
|
|
|
|
children: [
|
|
|
|
),
|
|
|
|
profile.status == FamilyFileEnum.active.toInt
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
? SizedBox()
|
|
|
|
Row(
|
|
|
|
: Expanded(
|
|
|
|
children: [
|
|
|
|
|
|
|
|
profile.status == FamilyFileEnum.active.toInt
|
|
|
|
|
|
|
|
? SizedBox()
|
|
|
|
|
|
|
|
: Expanded(
|
|
|
|
|
|
|
|
child: CustomButton(
|
|
|
|
|
|
|
|
height: 40.h,
|
|
|
|
|
|
|
|
text: LocaleKeys.confirm.tr(),
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
navigationService.pop();
|
|
|
|
|
|
|
|
widget.onSelect(profile);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
backgroundColor: AppColors.lightGreenButtonColor,
|
|
|
|
|
|
|
|
borderColor: AppColors.lightGreenButtonColor,
|
|
|
|
|
|
|
|
textColor: AppColors.textGreenColor,
|
|
|
|
|
|
|
|
icon: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
profile.status == FamilyFileEnum.active.toInt ? SizedBox() : SizedBox(width: 8.h),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
child: CustomButton(
|
|
|
|
child: CustomButton(
|
|
|
|
height: 40.h,
|
|
|
|
height: 40.h,
|
|
|
|
text: LocaleKeys.confirm.tr(),
|
|
|
|
text: profile.status == FamilyFileEnum.active.toInt ? LocaleKeys.removeMember.tr() : LocaleKeys.cancel.tr(),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
navigationService.pop();
|
|
|
|
navigationService.pop();
|
|
|
|
widget.onSelect(profile);
|
|
|
|
widget.onRemove(profile);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
backgroundColor: AppColors.lightGreenButtonColor,
|
|
|
|
backgroundColor: AppColors.secondaryLightRedColor,
|
|
|
|
borderColor: AppColors.lightGreenButtonColor,
|
|
|
|
borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
textColor: AppColors.textGreenColor,
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
icon: null,
|
|
|
|
icon: null,
|
|
|
|
|
|
|
|
iconColor: AppColors.primaryRedColor,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
profile.status == FamilyFileEnum.active.toInt ? SizedBox() : SizedBox(width: 8.h),
|
|
|
|
],
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: CustomButton(
|
|
|
|
|
|
|
|
height: 40.h,
|
|
|
|
|
|
|
|
text: profile.status == FamilyFileEnum.active.toInt ? LocaleKeys.removeMember.tr() : LocaleKeys.cancel.tr(),
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
navigationService.pop();
|
|
|
|
|
|
|
|
widget.onRemove(profile);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
backgroundColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
|
|
|
borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
|
|
|
|
icon: null,
|
|
|
|
|
|
|
|
iconColor: AppColors.primaryRedColor,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
),
|
|
|
|
},
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String getStatusTextByRequest(FamilyFileEnum status, bool isRequestFromMySide) {
|
|
|
|
String getStatusTextByRequest(FamilyFileEnum status, bool isRequestFromMySide) {
|
|
|
|
|