|
|
|
@ -1,4 +1,5 @@
|
|
|
|
import 'dart:async';
|
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
@ -79,8 +80,7 @@ class _FamilyCardsState extends State<FamilyCards> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Utils.buildSvgWithAssets(icon: AppAssets.alertSquare),
|
|
|
|
Utils.buildSvgWithAssets(icon: AppAssets.alertSquare),
|
|
|
|
SizedBox(width: 8.h),
|
|
|
|
SizedBox(width: 8.h),
|
|
|
|
LocaleKeys.whoCanViewMyMedicalFile.tr(context: context).toText14(color: AppColors.textColor, isUnderLine: true, weight: FontWeight.w500)
|
|
|
|
LocaleKeys.whoCanViewMyMedicalFile.tr(context: context).toText14(color: AppColors.textColor, isUnderLine: true, weight: FontWeight.w500).onPress(() {
|
|
|
|
.onPress(() {
|
|
|
|
|
|
|
|
dialogService.showFamilyBottomSheetWithoutHWithChild(
|
|
|
|
dialogService.showFamilyBottomSheetWithoutHWithChild(
|
|
|
|
label: LocaleKeys.manageFiles.tr(context: context),
|
|
|
|
label: LocaleKeys.manageFiles.tr(context: context),
|
|
|
|
message: "",
|
|
|
|
message: "",
|
|
|
|
@ -136,17 +136,10 @@ class _FamilyCardsState extends State<FamilyCards> {
|
|
|
|
? AppColors.textGreenColor
|
|
|
|
? AppColors.textGreenColor
|
|
|
|
: AppColors.alertColor),
|
|
|
|
: AppColors.alertColor),
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
Wrap(
|
|
|
|
Wrap(alignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.start, runAlignment: WrapAlignment.start, spacing: 0.h, children: [
|
|
|
|
alignment: WrapAlignment.start,
|
|
|
|
|
|
|
|
crossAxisAlignment: WrapCrossAlignment.start,
|
|
|
|
|
|
|
|
runAlignment: WrapAlignment.start,
|
|
|
|
|
|
|
|
spacing: 0.h,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
(profile.patientName ?? "").toText14(isBold: false, isCenter: false, maxlines: 1, weight: FontWeight.w600),
|
|
|
|
(profile.patientName ?? "").toText14(isBold: false, isCenter: false, maxlines: 1, weight: FontWeight.w600),
|
|
|
|
(getStatusTextByRequest(
|
|
|
|
(getStatusTextByRequest(FamilyFileEnum.values.firstWhere((e) => e.toInt == profile.status), profile.isRequestFromMySide ?? false))
|
|
|
|
FamilyFileEnum.values.firstWhere((e) => e.toInt == profile.status), profile.isRequestFromMySide ?? false))
|
|
|
|
.toText12(isBold: false, isCenter: false, maxLine: 1, fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
|
|
|
.toText12(
|
|
|
|
|
|
|
|
isBold: false, isCenter: false, maxLine: 1, fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
|
|
|
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
CustomChipWidget(
|
|
|
|
CustomChipWidget(
|
|
|
|
@ -318,7 +311,11 @@ class _FamilyCardsState extends State<FamilyCards> {
|
|
|
|
final profile = widget.profileViewList![index];
|
|
|
|
final profile = widget.profileViewList![index];
|
|
|
|
final isActive = (profile.responseId == appState.getAuthenticatedUser()?.patientId);
|
|
|
|
final isActive = (profile.responseId == appState.getAuthenticatedUser()?.patientId);
|
|
|
|
final isParentUser = appState.getAuthenticatedUser()?.isParentUser ?? false;
|
|
|
|
final isParentUser = appState.getAuthenticatedUser()?.isParentUser ?? false;
|
|
|
|
final canSwitch = isParentUser || (!isParentUser && profile.responseId == appState.getSuperUserID);
|
|
|
|
print(jsonEncode(appState.getUserSwitchPayloads));
|
|
|
|
|
|
|
|
final isSuperUser = appState.getUserSwitchPayloads;
|
|
|
|
|
|
|
|
// TODO: canSwitch functionality is currently disabled - set to true to allow all switches
|
|
|
|
|
|
|
|
// Original logic: final canSwitch = isParentUser || (!isParentUser && profile.responseId == appState.getSuperUserID);
|
|
|
|
|
|
|
|
final canSwitch = true; // Disabled - allows all users to switch
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.h),
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.h),
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r),
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r),
|
|
|
|
@ -469,10 +466,10 @@ class _FamilyCardsState extends State<FamilyCards> {
|
|
|
|
alignment: WrapAlignment.start,
|
|
|
|
alignment: WrapAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
(profile.patientName ?? "").toText14(isBold: false, isCenter: true, maxlines: 1, weight: FontWeight.w600),
|
|
|
|
(profile.patientName ?? "").toText14(isBold: false, isCenter: true, maxlines: 1, weight: FontWeight.w600),
|
|
|
|
SizedBox(width: 2.w,),
|
|
|
|
SizedBox(
|
|
|
|
(getStatusTextByRequest(
|
|
|
|
width: 2.w,
|
|
|
|
FamilyFileEnum.values.firstWhere((e) => e.toInt == profile.status), profile.isRequestFromMySide ?? false))
|
|
|
|
),
|
|
|
|
.toText14(
|
|
|
|
(getStatusTextByRequest(FamilyFileEnum.values.firstWhere((e) => e.toInt == profile.status), profile.isRequestFromMySide ?? false)).toText14(
|
|
|
|
isBold: false,
|
|
|
|
isBold: false,
|
|
|
|
isCenter: true,
|
|
|
|
isCenter: true,
|
|
|
|
maxlines: 1,
|
|
|
|
maxlines: 1,
|
|
|
|
|