From f3f27a676f82fa404f6af451c2b85f3dcfc28fa1 Mon Sep 17 00:00:00 2001 From: Naveen Date: Fri, 6 Oct 2023 17:05:45 +0530 Subject: [PATCH] added button color --- .../lib/data/repositories/remote/mdms.dart | 3 +++ .../pages/beneficiary/household_overview.dart | 14 ++++++++----- .../complaints/inbox/complaints_inbox.dart | 7 +------ .../lib/utils/utils.dart | 2 -- .../lib/widgets/action_card/action_card.dart | 13 ++++++++++++ .../beneficiary/view_beneficiary_card.dart | 2 +- .../lib/widgets/member_card/member_card.dart | 20 +++++++++++++++---- 7 files changed, 43 insertions(+), 18 deletions(-) diff --git a/apps/health_campaign_field_worker_app/lib/data/repositories/remote/mdms.dart b/apps/health_campaign_field_worker_app/lib/data/repositories/remote/mdms.dart index 5c42ce3c9..aaaee6e66 100644 --- a/apps/health_campaign_field_worker_app/lib/data/repositories/remote/mdms.dart +++ b/apps/health_campaign_field_worker_app/lib/data/repositories/remote/mdms.dart @@ -342,6 +342,9 @@ class MdmsRepository { }).toList(); newprojectType.cycles = element.cycles?.map((e) { final newcycle = Cycles() + ..id = e.id + ..startDate = e.startDate + ..endDate = e.endDate ..mandatoryWaitSinceLastCycleInDays = e.mandatoryWaitSinceLastCycleInDays ..deliveries = e.deliveries?.map((ele) { diff --git a/apps/health_campaign_field_worker_app/lib/pages/beneficiary/household_overview.dart b/apps/health_campaign_field_worker_app/lib/pages/beneficiary/household_overview.dart index 6723dedce..81c898f0e 100644 --- a/apps/health_campaign_field_worker_app/lib/pages/beneficiary/household_overview.dart +++ b/apps/health_campaign_field_worker_app/lib/pages/beneficiary/household_overview.dart @@ -319,7 +319,7 @@ class _HouseholdOverviewPageState ?.where((element) => element .taskClientReferenceId == - taskdata.first + taskdata.last .clientReferenceId) .toList() : null; @@ -484,8 +484,11 @@ class _HouseholdOverviewPageState ), ); }, - isNotEligible: - !checkEligibilityForAgeAndAdverseEvent( + isNotEligible: projectState + .projectType + ?.cycles != + null + ? !checkEligibilityForAgeAndAdverseEvent( DigitDOBAge( years: ageInYears, months: ageInMonths, @@ -494,14 +497,15 @@ class _HouseholdOverviewPageState .projectType, (taskdata ?? []) .isNotEmpty - ? taskdata?.first + ? taskdata?.last : null, adverseEventData, ) && !checkStatus( taskdata, currentCycle, - ), + ) + : false, // TODO Need to handle the null check name: e.name?.givenName ?? ' - ', years: (e.dateOfBirth == null diff --git a/apps/health_campaign_field_worker_app/lib/pages/complaints/inbox/complaints_inbox.dart b/apps/health_campaign_field_worker_app/lib/pages/complaints/inbox/complaints_inbox.dart index a8d9071b4..abaa70e08 100644 --- a/apps/health_campaign_field_worker_app/lib/pages/complaints/inbox/complaints_inbox.dart +++ b/apps/health_campaign_field_worker_app/lib/pages/complaints/inbox/complaints_inbox.dart @@ -356,12 +356,7 @@ class _ComplaintsInboxItem extends StatelessWidget { complaint: item, )); }, - style: OutlinedButton.styleFrom( - side: BorderSide( - width: 1.0, - color: theme.colorScheme.secondary, - ), - ), + style: OutlinedButton.styleFrom(), child: Text( localizations.translate(i18.searchBeneficiary.iconLabel), style: TextStyle( diff --git a/apps/health_campaign_field_worker_app/lib/utils/utils.dart b/apps/health_campaign_field_worker_app/lib/utils/utils.dart index e6a19b500..452e02009 100644 --- a/apps/health_campaign_field_worker_app/lib/utils/utils.dart +++ b/apps/health_campaign_field_worker_app/lib/utils/utils.dart @@ -335,8 +335,6 @@ bool checkStatus( final isLastCycleRunning = lastTaskCreatedTime >= currentCycle.startDate! && lastTaskCreatedTime <= currentCycle.endDate!; - print('isLastCycleRunning: $isLastCycleRunning'); - print(lastTask.status == Status.partiallyDelivered.name); return isLastCycleRunning ? lastTask.status == Status.partiallyDelivered.name diff --git a/apps/health_campaign_field_worker_app/lib/widgets/action_card/action_card.dart b/apps/health_campaign_field_worker_app/lib/widgets/action_card/action_card.dart index a00260a0a..763274359 100644 --- a/apps/health_campaign_field_worker_app/lib/widgets/action_card/action_card.dart +++ b/apps/health_campaign_field_worker_app/lib/widgets/action_card/action_card.dart @@ -8,11 +8,24 @@ class ActionCard extends StatelessWidget { @override Widget build(BuildContext context) { + final theme = Theme.of(context); + return Column( mainAxisSize: MainAxisSize.min, children: items .map( (e) => DigitOutlineIconButton( + buttonStyle: OutlinedButton.styleFrom( + backgroundColor: Colors.white, + side: BorderSide( + width: 1.0, + color: theme.colorScheme.secondary, + ), + minimumSize: Size( + MediaQuery.of(context).size.width / 1.25, + 50, + ), + ), icon: e.icon, label: e.label, onPressed: e.action, diff --git a/apps/health_campaign_field_worker_app/lib/widgets/beneficiary/view_beneficiary_card.dart b/apps/health_campaign_field_worker_app/lib/widgets/beneficiary/view_beneficiary_card.dart index 877b94a03..51b0b82fb 100644 --- a/apps/health_campaign_field_worker_app/lib/widgets/beneficiary/view_beneficiary_card.dart +++ b/apps/health_campaign_field_worker_app/lib/widgets/beneficiary/view_beneficiary_card.dart @@ -109,7 +109,7 @@ class _ViewBeneficiaryCardState extends LocalizedState { ? householdMember.adverseEvents ?.where((element) => element.taskClientReferenceId == - taskdata.first.clientReferenceId) + taskdata.last.clientReferenceId) .toList() : null; final ageInYears = DigitDateUtils.calculateAge( diff --git a/apps/health_campaign_field_worker_app/lib/widgets/member_card/member_card.dart b/apps/health_campaign_field_worker_app/lib/widgets/member_card/member_card.dart index 7053e92b0..8a08c8d5e 100644 --- a/apps/health_campaign_field_worker_app/lib/widgets/member_card/member_card.dart +++ b/apps/health_campaign_field_worker_app/lib/widgets/member_card/member_card.dart @@ -15,8 +15,8 @@ import '../action_card/action_card.dart'; class MemberCard extends StatelessWidget { final String name; final String gender; - final int? years; - final int? months; + final int years; + final int months; final bool isHead; final IndividualModel individual; final bool isDelivered; @@ -35,7 +35,7 @@ class MemberCard extends StatelessWidget { required this.individual, required this.name, required this.gender, - this.years, + required this.years, this.isHead = false, this.months = 0, required this.localizations, @@ -140,7 +140,7 @@ class MemberCard extends StatelessWidget { ), Expanded( child: Text( - " | ${years ?? '-'} ${localizations.translate(i18.memberCard.deliverDetailsYearText)} ${months ?? '-'} ${localizations.translate(i18.memberCard.deliverDetailsMonthsText)}", + " | $years ${localizations.translate(i18.memberCard.deliverDetailsYearText)} $months ${localizations.translate(i18.memberCard.deliverDetailsMonthsText)}", style: theme.textTheme.bodyMedium, ), ), @@ -237,6 +237,10 @@ class MemberCard extends StatelessWidget { ), buttonStyle: OutlinedButton.styleFrom( backgroundColor: Colors.white, + side: BorderSide( + width: 1.0, + color: theme.colorScheme.secondary, + ), minimumSize: Size( MediaQuery.of(context).size.width / 1.15, 50, @@ -253,6 +257,10 @@ class MemberCard extends StatelessWidget { ), buttonStyle: OutlinedButton.styleFrom( backgroundColor: Colors.white, + side: BorderSide( + width: 1.0, + color: theme.colorScheme.secondary, + ), minimumSize: Size( MediaQuery.of(context).size.width / 1.25, 50, @@ -326,6 +334,10 @@ class MemberCard extends StatelessWidget { ), buttonStyle: OutlinedButton.styleFrom( backgroundColor: Colors.white, + side: BorderSide( + width: 1.0, + color: theme.colorScheme.secondary, + ), minimumSize: Size( MediaQuery.of(context).size.width / 1.25, 50,