From 1649f612b64b32f335464f9dec28e7d2f446546c Mon Sep 17 00:00:00 2001 From: Saif Nbet Date: Mon, 30 Sep 2024 09:56:37 +0100 Subject: [PATCH] Resolve merge conflicts --- .../proposals/components/proposals_list.dart | 8 ++- .../hypha_proposal_history_card.dart | 7 ++- .../list/components/proposals_view.dart | 50 ++++--------------- 3 files changed, 21 insertions(+), 44 deletions(-) diff --git a/lib/ui/proposals/components/proposals_list.dart b/lib/ui/proposals/components/proposals_list.dart index d85ed627..115c8649 100644 --- a/lib/ui/proposals/components/proposals_list.dart +++ b/lib/ui/proposals/components/proposals_list.dart @@ -4,14 +4,18 @@ import 'package:hypha_wallet/ui/proposals/list/components/hypha_proposals_action class ProposalsList extends StatelessWidget { final List proposals; + final bool isScrollable; - const ProposalsList(this.proposals, {super.key}); + const ProposalsList(this.proposals, {this.isScrollable = true, super.key}); @override Widget build(BuildContext context) { return ListView.separated( + physics: isScrollable?const BouncingScrollPhysics():const NeverScrollableScrollPhysics(), + shrinkWrap: true, padding: const EdgeInsets.only(bottom: 22), - itemBuilder: (BuildContext context, int index) => HyphaProposalsActionCard(proposals[index]), + itemBuilder: (BuildContext context, int index) => + HyphaProposalsActionCard(proposals[index]), separatorBuilder: (BuildContext context, int index) { return const SizedBox(height: 16); }, diff --git a/lib/ui/proposals/list/components/hypha_proposal_history_card.dart b/lib/ui/proposals/list/components/hypha_proposal_history_card.dart index 57d55616..c17cbf21 100644 --- a/lib/ui/proposals/list/components/hypha_proposal_history_card.dart +++ b/lib/ui/proposals/list/components/hypha_proposal_history_card.dart @@ -1,9 +1,11 @@ import 'package:flutter/material.dart'; +import 'package:get/get.dart' as GetX; import 'package:hypha_wallet/core/network/models/dao_data_model.dart'; import 'package:hypha_wallet/design/dao_image.dart'; import 'package:hypha_wallet/design/hypha_card.dart'; import 'package:hypha_wallet/design/hypha_colors.dart'; import 'package:hypha_wallet/design/themes/extensions/theme_extension_provider.dart'; +import 'package:hypha_wallet/ui/proposals/history/proposals_history_page.dart'; class HyphaProposalHistoryCard extends StatelessWidget { final DaoData dao; @@ -15,7 +17,10 @@ class HyphaProposalHistoryCard extends StatelessWidget { @override Widget build(BuildContext context) { return GestureDetector( - onTap: () {}, + onTap: () { + GetX.Get.to(() => ProposalsHistoryPage(dao), + transition: GetX.Transition.leftToRight); + }, child: HyphaCard( child: Padding( padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 20), diff --git a/lib/ui/proposals/list/components/proposals_view.dart b/lib/ui/proposals/list/components/proposals_view.dart index f1d7eebe..64ce85d9 100644 --- a/lib/ui/proposals/list/components/proposals_view.dart +++ b/lib/ui/proposals/list/components/proposals_view.dart @@ -19,6 +19,8 @@ import 'package:hypha_wallet/ui/proposals/list/components/hypha_proposals_action import 'package:hypha_wallet/ui/proposals/list/interactor/proposals_bloc.dart'; import 'package:hypha_wallet/ui/shared/hypha_body_widget.dart'; +import '../../filter/interactor/filter_proposals_bloc.dart'; + class ProposalsView extends StatelessWidget { const ProposalsView({super.key}); @@ -89,7 +91,10 @@ class ProposalsView extends StatelessWidget { ), child: HyphaBodyWidget( pageState: state.pageState, - success: (context) => Padding( + success: (context) { + final List? daoIds = GetIt.I.get().daoIds; + final List proposals = daoIds != null ? state.proposals.filterByDao(daoIds) : state.proposals; + return Padding( padding: const EdgeInsets.symmetric(horizontal: 22), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -98,7 +103,7 @@ class ProposalsView extends StatelessWidget { height: 22, ), Text( - '${state.proposals.length} ${context.read().filterStatus.string} Proposal${state.proposals.length == 1 ? '' : 's'}', + '${proposals.length} ${context.read().filterStatus.string} Proposal${proposals.length == 1 ? '' : 's'}', style: context.hyphaTextTheme.ralMediumBody .copyWith(color: HyphaColors.midGrey), ), @@ -111,21 +116,7 @@ class ProposalsView extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - ListView.separated( - physics: - const NeverScrollableScrollPhysics(), - shrinkWrap: true, - padding: - const EdgeInsets.only(bottom: 22), - itemBuilder: - (BuildContext context, int index) => - HyphaProposalsActionCard( - state.proposals[index]), - separatorBuilder: - (BuildContext context, int index) { - return const SizedBox(height: 16); - }, - itemCount: state.proposals.length), + ProposalsList(proposals,isScrollable: false,), const SizedBox( height: 30, ), @@ -164,30 +155,7 @@ class ProposalsView extends StatelessWidget { ), ], ), - ), - success: (context) { - final List? daoIds = GetIt.I.get().daoIds; - final List proposals = daoIds != null ? state.proposals.filterByDao(daoIds) : state.proposals; - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 22), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const SizedBox( - height: 22, - ), - Text( - '${proposals.length} ${context.read().filterStatus.string} Proposal${proposals.length == 1 ? '' : 's'}', - style: context.hyphaTextTheme.ralMediumBody - .copyWith(color: HyphaColors.midGrey), - ), - const SizedBox( - height: 20, - ), - Expanded(child: ProposalsList(proposals)), - ], - ), - ); + ); }, ), )),