Skip to content

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
nbetsaif committed Sep 30, 2024
1 parent 4f5c227 commit 1649f61
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 44 deletions.
8 changes: 6 additions & 2 deletions lib/ui/proposals/components/proposals_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ import 'package:hypha_wallet/ui/proposals/list/components/hypha_proposals_action

class ProposalsList extends StatelessWidget {
final List<ProposalModel> 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);
},
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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),
Expand Down
50 changes: 9 additions & 41 deletions lib/ui/proposals/list/components/proposals_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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});

Expand Down Expand Up @@ -89,7 +91,10 @@ class ProposalsView extends StatelessWidget {
),
child: HyphaBodyWidget(
pageState: state.pageState,
success: (context) => Padding(
success: (context) {
final List<int>? daoIds = GetIt.I.get<FilterProposalsBloc>().daoIds;
final List<ProposalModel> proposals = daoIds != null ? state.proposals.filterByDao(daoIds) : state.proposals;
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 22),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand All @@ -98,7 +103,7 @@ class ProposalsView extends StatelessWidget {
height: 22,
),
Text(
'${state.proposals.length} ${context.read<ProposalsBloc>().filterStatus.string} Proposal${state.proposals.length == 1 ? '' : 's'}',
'${proposals.length} ${context.read<ProposalsBloc>().filterStatus.string} Proposal${proposals.length == 1 ? '' : 's'}',
style: context.hyphaTextTheme.ralMediumBody
.copyWith(color: HyphaColors.midGrey),
),
Expand All @@ -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,
),
Expand Down Expand Up @@ -164,30 +155,7 @@ class ProposalsView extends StatelessWidget {
),
],
),
),
success: (context) {
final List<int>? daoIds = GetIt.I.get<FilterProposalsBloc>().daoIds;
final List<ProposalModel> 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<ProposalsBloc>().filterStatus.string} Proposal${proposals.length == 1 ? '' : 's'}',
style: context.hyphaTextTheme.ralMediumBody
.copyWith(color: HyphaColors.midGrey),
),
const SizedBox(
height: 20,
),
Expanded(child: ProposalsList(proposals)),
],
),
);
);
},
),
)),
Expand Down

0 comments on commit 1649f61

Please sign in to comment.