diff --git a/assets/images/png/dummy_user.png b/assets/images/png/dummy_user.png new file mode 100644 index 0000000..b4bace4 Binary files /dev/null and b/assets/images/png/dummy_user.png differ diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index e11de15..206809d 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -811,6 +811,7 @@ class ApiConsts { static final String sendFamilyFileActivation = 'Services/Authentication.svc/REST/SendActivationCodeForFamilyFile'; static final String checkActivationCodeForFamily = 'Services/Authentication.svc/REST/CheckActivationCodeForFamilyFile'; static final String getAllPendingRecordsByResponseId = 'Services/Authentication.svc/REST/GetAllPendingRecordsByResponseId'; + static final String getAllSharedRecordsByStatus = 'Services/Authentication.svc/REST/GetAllSharedRecordsByStatus'; // static values for Api diff --git a/lib/core/app_assets.dart b/lib/core/app_assets.dart index 83fb842..be651b7 100644 --- a/lib/core/app_assets.dart +++ b/lib/core/app_assets.dart @@ -158,6 +158,7 @@ class AppAssets { static const String tamara_en = '$pngBasePath/tamara_en.png'; static const String visa = '$pngBasePath/visa.png'; static const String lockIcon = '$pngBasePath/lock-icon.png'; + static const String dummy_user = '$pngBasePath/dummy_user.png'; } class AppAnimations { diff --git a/lib/core/enums.dart b/lib/core/enums.dart index bb6c6fe..e94b3e2 100644 --- a/lib/core/enums.dart +++ b/lib/core/enums.dart @@ -30,6 +30,8 @@ enum LoginTypeEnum { sms, whatsapp, face, fingerprint } enum AppEnvironmentTypeEnum { dev, uat, preProd, qa, staging, prod } +enum FamilyFileEnum { active, inactive, blocked, deleted, pending } + extension CalenderExtension on CalenderEnum { int get toInt { switch (this) { @@ -138,6 +140,57 @@ extension OTPTypeEnumExtension on OTPTypeEnum { } } +extension FamilyFileEnumExtenshion on FamilyFileEnum { + int get toInt { + switch (this) { + case FamilyFileEnum.active: + return 3; + case FamilyFileEnum.blocked: + return 1; + case FamilyFileEnum.deleted: + return 0; + case FamilyFileEnum.pending: + return 2; + case FamilyFileEnum.inactive: + return 4; + } + } + + String get displayName { + AppState appState = getIt.get(); + bool isArabic = appState.getLanguageID() == 1 ? true : false; + switch (this) { + case FamilyFileEnum.active: + return isArabic ? 'نشط' : 'Active'; + case FamilyFileEnum.inactive: + return isArabic ? 'غير نشط' : 'Inactive'; + case FamilyFileEnum.blocked: + return isArabic ? 'محظور' : 'Blocked'; + case FamilyFileEnum.deleted: + return isArabic ? 'محذوف' : 'Deleted'; + case FamilyFileEnum.pending: + return isArabic ? 'قيد الانتظار' : 'Pending'; + } + } + + static FamilyFileEnum? fromValue(int value) { + switch (value) { + case 0: + return FamilyFileEnum.pending; + case 2: + return FamilyFileEnum.blocked; + case 1: + return FamilyFileEnum.deleted; + case 3: + return FamilyFileEnum.active; + case 4: + return FamilyFileEnum.inactive; + default: + return null; + } + } +} + enum ServiceTypeEnum { advancePayment, //3 ancillaryOrder, //3 diff --git a/lib/features/authentication/authentication_repo.dart b/lib/features/authentication/authentication_repo.dart index 8d1af92..9244e4a 100644 --- a/lib/features/authentication/authentication_repo.dart +++ b/lib/features/authentication/authentication_repo.dart @@ -30,8 +30,7 @@ abstract class AuthenticationRepo { int? responseID, bool isSwitchUser = false, int? patientID, - int? loginType - }); + int? loginType}); Future>> checkIfUserAgreed({required dynamic commonAuthanticatedRequest}); @@ -196,17 +195,16 @@ class AuthenticationRepoImp implements AuthenticationRepo { } @override - Future>> checkActivationCodeRepo({ - required dynamic newRequest, // could be CheckActivationCodeReq or CheckActivationCodeRegisterReq - required String? activationCode, - required bool isRegister, - bool isFormFamilyFile = false, - int? patientShareRequestID, - int? responseID, - bool isSwitchUser = false, - int? patientID, - int? loginType - }) async { + Future>> checkActivationCodeRepo( + {required dynamic newRequest, // could be CheckActivationCodeReq or CheckActivationCodeRegisterReq + required String? activationCode, + required bool isRegister, + bool isFormFamilyFile = false, + int? patientShareRequestID, + int? responseID, + bool isSwitchUser = false, + int? patientID, + int? loginType}) async { if (isRegister) { newRequest["activationCode"] = activationCode ?? "0000"; newRequest["isSilentLogin"] = activationCode != null ? false : true; @@ -227,7 +225,9 @@ class AuthenticationRepoImp implements AuthenticationRepo { familyRequest['Status'] = 3; familyRequest["PatientID"] = appState.getAuthenticatedUser()!.patientId ?? 0; familyRequest["LogInTokenID"] = appState.getFamilyFileTokenID; - + familyRequest["activationCode"] = activationCode ?? "0000"; + familyRequest["PatientMobileNumber"] = newRequest.patientMobileNumber; + familyRequest["PatientIdentificationID"] = newRequest.patientIdentificationID; } Map switchRequest = {}; if (isSwitchUser) { @@ -237,14 +237,12 @@ class AuthenticationRepoImp implements AuthenticationRepo { switchRequest['IsSilentLogin'] = true; switchRequest['LogInTokenID'] = null; switchRequest['SearchType'] = 2; - if(loginType != 0) { - switchRequest['SuperUser'] = patientID; - switchRequest['DeviceToken'] = null; - }else{ - switchRequest['LoginType'] = 2; - } - - + if (loginType != 0) { + switchRequest['SuperUser'] = patientID; + switchRequest['DeviceToken'] = null; + } else { + switchRequest['LoginType'] = 2; + } } final endpoint = isFormFamilyFile diff --git a/lib/features/medical_file/medical_file_repo.dart b/lib/features/medical_file/medical_file_repo.dart index b90e7fb..9c18696 100644 --- a/lib/features/medical_file/medical_file_repo.dart +++ b/lib/features/medical_file/medical_file_repo.dart @@ -24,7 +24,7 @@ abstract class MedicalFileRepo { Future>> getPatientMedicalReportPDF(PatientMedicalReportResponseModel patientMedicalReportResponseModel, AuthenticatedUser authenticatedUser); - Future>>> getPatientFamilyFiles(int status, int patientId); + Future>>> getPatientFamilyFiles(int? status, int patientId); Future>>> getAllPendingRecordsByResponseId({required Map request}); @@ -276,13 +276,13 @@ class MedicalFileRepoImp implements MedicalFileRepo { } @override - Future>>> getPatientFamilyFiles(int status, int patientID) async { + Future>>> getPatientFamilyFiles(int? status, int patientID) async { try { GenericApiModel>? apiResponse; Failure? failure; await apiClient.post( - FAMILY_FILES, - body: {"Status": status, "PatientID":patientID}, + ApiConsts.getAllSharedRecordsByStatus, + body: {if (status != null) "Status": status, "PatientID": patientID}, onFailure: (error, statusCode, {messageStatus, failureType}) { failure = failureType; }, @@ -327,7 +327,7 @@ class MedicalFileRepoImp implements MedicalFileRepo { }, onSuccess: (response, statusCode, {messageStatus, errorMessage}) { try { - final list = response['GetAllSharedRecordsByStatusList']; + final list = response['GetAllPendingRecordsList']; // if (list == null || list.isEmpty) { // throw Exception("lab list is empty"); // } @@ -366,7 +366,6 @@ class MedicalFileRepoImp implements MedicalFileRepo { }, onSuccess: (response, statusCode, {messageStatus, errorMessage}) { try { - apiResponse = GenericApiModel( messageStatus: messageStatus, statusCode: statusCode, diff --git a/lib/features/medical_file/medical_file_view_model.dart b/lib/features/medical_file/medical_file_view_model.dart index 746e592..153828c 100644 --- a/lib/features/medical_file/medical_file_view_model.dart +++ b/lib/features/medical_file/medical_file_view_model.dart @@ -39,14 +39,27 @@ class MedicalFileViewModel extends ChangeNotifier { List patientMedicalReportCancelledList = []; List patientFamilyFiles = []; + List pendingFamilyFiles = []; String patientSickLeavePDFBase64 = ""; String patientMedicalReportPDFBase64 = ""; int selectedMedicalReportsTabIndex = 0; + int _selectedFamilyFileTabIndex = 0; + + int get getSelectedFamilyFileTabIndex => _selectedFamilyFileTabIndex; + + set setSelectedFamilyFileTabIndex(int value) { + if (_selectedFamilyFileTabIndex != value) { + _selectedFamilyFileTabIndex = value; + notifyListeners(); + } + } + static final DialogService _dialogService = getIt.get(); - AppState _appState = getIt(); + final AppState _appState = getIt(); AuthenticationViewModel authVM = getIt.get(); + MedicalFileViewModel({required this.medicalFileRepo, required this.errorHandlerService}); initMedicalFileProvider() { @@ -67,6 +80,14 @@ class MedicalFileViewModel extends ChangeNotifier { notifyListeners(); } + void onFamilyFileTabChange(int index) { + setSelectedFamilyFileTabIndex = index; + if (index == 1) { + getAllPendingRecordsByResponseId(); + } + notifyListeners(); + } + setIsPatientVaccineListLoading(bool isLoading) { isPatientVaccineListLoading = isLoading; notifyListeners(); @@ -235,8 +256,8 @@ class MedicalFileViewModel extends ChangeNotifier { ); } - Future getFamilyFiles({Function(dynamic)? onSuccess, Function(String)? onError}) async { - final result = await medicalFileRepo.getPatientFamilyFiles(); + Future getFamilyFiles({int? status, Function(dynamic)? onSuccess, Function(String)? onError}) async { + final result = await medicalFileRepo.getPatientFamilyFiles(status, _appState.superUserID != null ? _appState.superUserID! : _appState.getAuthenticatedUser()!.patientId!); result.fold( (failure) async => await errorHandlerService.handleError( @@ -250,15 +271,80 @@ class MedicalFileViewModel extends ChangeNotifier { _dialogService.showErrorBottomSheet(message: apiResponse.errorMessage!, onOkPressed: () {}); } else if (apiResponse.messageStatus == 1) { patientFamilyFiles = apiResponse.data!; - patientFamilyFiles.insert( - 0, - FamilyFileResponseModelLists( + if (apiResponse.data != null) { + patientFamilyFiles.insert( + 0, + FamilyFileResponseModelLists( patientId: _appState.getAuthenticatedUser()!.patientId, patientName: '${_appState.getAuthenticatedUser()!.firstName!} ${_appState.getAuthenticatedUser()!.lastName!}', isActive: true, gender: _appState.getAuthenticatedUser()!.gender!, - responseId: _appState.getAuthenticatedUser()!.patientId), - ); + responseId: _appState.getAuthenticatedUser()!.patientId, + age: _appState.getAuthenticatedUser()!.age, + mobileNumber: _appState.getAuthenticatedUser()!.mobileNumber, + patientIdenficationNumber: _appState.getAuthenticatedUser()!.patientIdentificationNo, + emaiLAddress: _appState.getAuthenticatedUser()!.emailAddress, + genderDescription: _appState.getAuthenticatedUser()!.genderDescription, + ), + ); + + final List activeFamilyFiles = []; + final List tempPendingFamilyFiles = []; + for (var element in apiResponse.data!) { + if (element.status != null && element.status == FamilyFileEnum.active.toInt) { + activeFamilyFiles.add(FamilyFileResponseModelLists( + patientId: element.patientId, + patientName: element.patientName!, + isActive: element.status == FamilyFileEnum.active.toInt ? true : false, + gender: element.gender!, + responseId: element.patientId, + mobileNumber: element.mobileNumber, + age: element.age, + patientIdenficationNumber: element.patientIdenficationNumber, + relationship: element.relationship, + relationshipId: element.relationshipId, + relationshipN: element.relationshipN, + status: element.status, + statusDescription: element.statusDescription, + createdOn: element.createdOn, + editedOn: element.editedOn, + patientDataVerified: element.patientDataVerified, + regionId: element.regionId, + familyRegionId: element.familyRegionId, + genderDescription: element.genderDescription, + genderImage: element.genderImage, + emaiLAddress: element.emaiLAddress)); + } + + if (element.status != null && element.status == FamilyFileEnum.pending.toInt) { + tempPendingFamilyFiles.add(FamilyFileResponseModelLists( + patientId: element.patientId, + patientName: element.patientName!, + isActive: element.status == FamilyFileEnum.active.toInt ? true : false, + gender: element.gender!, + responseId: element.patientId, + mobileNumber: element.mobileNumber, + age: element.age, + patientIdenficationNumber: element.patientIdenficationNumber, + relationship: element.relationship, + relationshipId: element.relationshipId, + relationshipN: element.relationshipN, + status: element.status, + statusDescription: element.statusDescription, + createdOn: element.createdOn, + editedOn: element.editedOn, + patientDataVerified: element.patientDataVerified, + regionId: element.regionId, + familyRegionId: element.familyRegionId, + genderDescription: element.genderDescription, + genderImage: element.genderImage, + emaiLAddress: element.emaiLAddress)); + } + } + patientFamilyFiles.addAll(activeFamilyFiles.where((element) => !patientFamilyFiles.any((e) => e.patientId == element.patientId))); + pendingFamilyFiles.addAll(tempPendingFamilyFiles); + } + notifyListeners(); if (onSuccess != null) { onSuccess(apiResponse); @@ -278,61 +364,93 @@ class MedicalFileViewModel extends ChangeNotifier { if (apiResponse.messageStatus == 2) { _dialogService.showErrorBottomSheet(message: apiResponse.errorMessage!, onOkPressed: () {}); } else if (apiResponse.messageStatus == 1) { - print("======= Pending Records Response: ${jsonEncode(apiResponse.data)}"); + if (apiResponse.data != null) { + final List tempPendingFamilyFiles = []; + for (var element in apiResponse.data!) { + if (element.status != null && element.status == FamilyFileEnum.pending.toInt) { + tempPendingFamilyFiles.add(FamilyFileResponseModelLists( + patientId: element.patientId, + patientName: element.patientName!, + isActive: element.status == FamilyFileEnum.active.toInt ? true : false, + gender: element.gender, + responseId: element.patientId, + mobileNumber: element.mobileNumber, + age: element.age, + patientIdenficationNumber: element.patientIdenficationNumber, + relationship: element.relationship, + relationshipId: element.relationshipId, + relationshipN: element.relationshipN, + status: element.status, + statusDescription: element.statusDescription, + createdOn: element.createdOn, + editedOn: element.editedOn, + patientDataVerified: element.patientDataVerified, + regionId: element.regionId, + familyRegionId: element.familyRegionId, + genderDescription: element.genderDescription, + genderImage: element.genderImage, + emaiLAddress: element.emaiLAddress)); + } + } + pendingFamilyFiles.addAll(tempPendingFamilyFiles.where((element) => !pendingFamilyFiles.any((e) => e.patientId == element.patientId))); + } + notifyListeners(); } }, ); } - Future switchFamilyFiles({Function(dynamic)? onSuccess, Function(String)? onError}) async { - // final result = await medicalFileRepo.getPatientFamilyFiles(); - final result = await medicalFileRepo.getPatientFamilyFiles(3,_appState.superUserID !=null ? _appState.superUserID! : _appState.getAuthenticatedUser()!.patientId!); - - result.fold( - (failure) async => await errorHandlerService.handleError( - failure: failure, - onOkPressed: () { - onError!(failure.message); - }, - ), - (apiResponse) { - if (apiResponse.messageStatus == 2) { - _dialogService.showErrorBottomSheet(message: apiResponse.errorMessage!, onOkPressed: () {}); - } else if (apiResponse.messageStatus == 1) { - patientFamilyFiles = apiResponse.data!; - patientFamilyFiles.insert( - 0, - FamilyFileResponseModelLists( - patientId: _appState.getAuthenticatedUser()!.patientId, - patientName: '${_appState.getAuthenticatedUser()!.firstName!} ${_appState.getAuthenticatedUser()!.lastName!}', - isActive: true, - gender: _appState.getAuthenticatedUser()!.gender!, - age: _appState.getAuthenticatedUser()!.age, - mobileNumber: _appState.getAuthenticatedUser()!.mobileNumber, - responseId: _appState.getAuthenticatedUser()!.patientId), - ); - notifyListeners(); - if (onSuccess != null) { - onSuccess(apiResponse); - } - } - }, + // Future switchFamilyFiles({Function(dynamic)? onSuccess, Function(String)? onError}) async { + // // final result = await medicalFileRepo.getPatientFamilyFiles(); + // final result = await medicalFileRepo.getPatientFamilyFiles(3, _appState.superUserID != null ? _appState.superUserID! : _appState.getAuthenticatedUser()!.patientId!); + // + // result.fold( + // (failure) async => await errorHandlerService.handleError( + // failure: failure, + // onOkPressed: () { + // onError!(failure.message); + // }, + // ), + // (apiResponse) { + // if (apiResponse.messageStatus == 2) { + // _dialogService.showErrorBottomSheet(message: apiResponse.errorMessage!, onOkPressed: () {}); + // } else if (apiResponse.messageStatus == 1) { + // patientFamilyFiles = apiResponse.data!; + // patientFamilyFiles.insert( + // 0, + // FamilyFileResponseModelLists( + // patientId: _appState.getAuthenticatedUser()!.patientId, + // patientName: '${_appState.getAuthenticatedUser()!.firstName!} ${_appState.getAuthenticatedUser()!.lastName!}', + // isActive: true, + // gender: _appState.getAuthenticatedUser()!.gender!, + // age: _appState.getAuthenticatedUser()!.age, + // mobileNumber: _appState.getAuthenticatedUser()!.mobileNumber, + // responseId: _appState.getAuthenticatedUser()!.patientId), + // ); + // notifyListeners(); + // if (onSuccess != null) { + // onSuccess(apiResponse); + // } + // } + // }, + // ); + // } + + Future switchFamilyFiles({Function(dynamic)? onSuccess, int? responseID, int? patientID, String? phoneNumber, Function(String)? onError}) async { + authVM.phoneNumberController.text = phoneNumber!.startsWith("0") ? phoneNumber.replaceFirst("0", "") : phoneNumber; + + await authVM.checkActivationCode( + activationCode: '0000', + otpTypeEnum: OTPTypeEnum.sms, + onWrongActivationCode: (String? str) {}, + responseID: responseID, + isFormFamilyFile: false, + isSwitchUser: true, + patientID: patientID, ); } - Future switchFamilyFiles( {Function(dynamic)? onSuccess,int? responseID,int? patientID, String? phoneNumber, Function(String)? onError}) async { - authVM.phoneNumberController.text =phoneNumber!.startsWith("0") - ? phoneNumber.replaceFirst("0", "") - : phoneNumber; - - - - await authVM.checkActivationCode(activationCode: '0000', otpTypeEnum: OTPTypeEnum.sms, onWrongActivationCode: (String? str) {}, responseID: responseID, isFormFamilyFile:false, isSwitchUser: true, patientID: patientID, ); - - - } Future addFamilyFile({required OTPTypeEnum otpTypeEnum, required bool isExcludedUser}) async { - LoaderBottomSheet.showLoader(); AuthenticationViewModel authVM = getIt.get(); NavigationService navigationService = getIt.get(); diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart index ea0b86b..afea4e6 100644 --- a/lib/presentation/medical_file/medical_file_page.dart +++ b/lib/presentation/medical_file/medical_file_page.dart @@ -78,7 +78,9 @@ class _MedicalFilePageState extends State { insuranceViewModel.initInsuranceProvider(); medicalFileViewModel.setIsPatientSickLeaveListLoading(true); medicalFileViewModel.getPatientSickLeaveList(); - medicalFileViewModel.getFamilyFiles(); + medicalFileViewModel.getFamilyFiles(); //TODO: Remove status: 1 by Aamir Need to Discuss With Sultan + medicalFileViewModel.getAllPendingRecordsByResponseId(); //TODO: Added By Aamir + medicalFileViewModel.onTabChanged(0); } }); @@ -198,7 +200,6 @@ class _MedicalFilePageState extends State { CustomTabBarModel(AppAssets.more, "More".needTranslation), ], onTabChange: (index) { - print(index); medicalFileVM.onTabChanged(index); }, ).paddingSymmetrical(24.h, 0.0), diff --git a/lib/presentation/my_family/my_Family.dart b/lib/presentation/my_family/my_Family.dart index cb49933..1944704 100644 --- a/lib/presentation/my_family/my_Family.dart +++ b/lib/presentation/my_family/my_Family.dart @@ -22,6 +22,7 @@ import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/custom_tab_bar.dart'; import 'package:hmg_patient_app_new/widgets/dropdown/country_dropdown_widget.dart'; import 'package:hmg_patient_app_new/widgets/input_widget.dart'; +import 'package:provider/provider.dart'; class FamilyMedicalScreen extends StatefulWidget { final List profiles; @@ -44,7 +45,7 @@ class _FamilyMedicalScreenState extends State { @override void initState() { super.initState(); - medicalVM = getIt.get(); + medicalVM = context.read(); } @override @@ -67,13 +68,12 @@ class _FamilyMedicalScreenState extends State { SizedBox(height: 25.h), CustomTabBar( tabs: tabs, - onTabChange: (int index) {}, + onTabChange: (index) { + medicalVM!.onFamilyFileTabChange(index); + }, ), SizedBox(height: 25.h), - FamilyCards(profiles: widget.profiles, onSelect: (FamilyFileResponseModelLists profile){ - medicalVM?.switchFamilyFiles(responseID: profile.responseId, patientID: profile.patientId, phoneNumber: profile.mobileNumber); - - }, isShowDetails: true), + Consumer(builder: (context, medicalVM, child) => getFamilyTabs(index: medicalVM.getSelectedFamilyFileTabIndex)), SizedBox(height: 20.h), ], ), @@ -96,6 +96,28 @@ class _FamilyMedicalScreenState extends State { ); } + Widget getFamilyTabs({required int index}) { + switch (index) { + case 0: + return FamilyCards( + profiles: medicalVM!.patientFamilyFiles, + onSelect: (FamilyFileResponseModelLists profile) { + medicalVM!.switchFamilyFiles(responseID: profile.responseId, patientID: profile.patientId, phoneNumber: profile.mobileNumber); + }, + isShowDetails: true, + ); + case 1: + return FamilyCards( + profiles: medicalVM!.pendingFamilyFiles, + onSelect: (FamilyFileResponseModelLists profile) { + // medicalVM!.switchFamilyFiles(responseID: profile.responseId, patientID: profile.patientId, phoneNumber: profile.mobileNumber); + }, + isShowDetails: true, + ); default: + return SizedBox.shrink(); + } + } + void showModelSheet() { AuthenticationViewModel authVm = getIt.get(); return showCommonBottomSheetWithoutHeight(context, diff --git a/lib/presentation/my_family/widget/family_cards.dart b/lib/presentation/my_family/widget/family_cards.dart index 480f91f..40a2d8c 100644 --- a/lib/presentation/my_family/widget/family_cards.dart +++ b/lib/presentation/my_family/widget/family_cards.dart @@ -43,20 +43,22 @@ class _FamilyCardsState extends State { ), itemBuilder: (context, index) { final profile = widget.profiles[index]; - final isActive = (profile.responseId == appState - .getAuthenticatedUser() - ?.patientId); + final isActive = (profile.responseId == appState.getAuthenticatedUser()?.patientId); return Container( padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.h), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24), child: Opacity( - opacity: isActive ? 0.4 : 1.0, // Fade all content if active + opacity: isActive || profile.status == FamilyFileEnum.pending.toInt ? 0.4 : 1.0, // Fade all content if active child: Column( mainAxisSize: MainAxisSize.min, children: [ SizedBox(height: 5.h), Utils.buildImgWithAssets( - icon: profile.gender == 1 ? ((profile.age ?? 0) < 7 ? AppAssets.babyBoyImg : AppAssets.male_img) : (profile.age! < 7 ? AppAssets.babyGirlImg : AppAssets.femaleImg), + icon: profile.gender == null + ? AppAssets.dummy_user + : profile.gender == 1 + ? ((profile.age ?? 0) < 7 ? AppAssets.babyBoyImg : AppAssets.male_img) + : (profile.age! < 7 ? AppAssets.babyGirlImg : AppAssets.femaleImg), width: 80.h, height: 78.h), SizedBox(height: 8.h), @@ -73,13 +75,13 @@ class _FamilyCardsState extends State { 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, - ) + 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(), Spacer(), @@ -102,7 +104,7 @@ class _FamilyCardsState extends State { borderColor: AppColors.secondaryLightRedColor, textColor: AppColors.primaryRedColor, fontSize: 13.h, - icon: widget.isBottomSheet ? null : AppAssets.heart, + icon: widget.isBottomSheet ? null : AppAssets.heart, iconColor: AppColors.primaryRedColor, padding: EdgeInsets.symmetric(vertical: 0, horizontal: 0), ).paddingOnly(top: 0, bottom: 0),