Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement Proposal history section ui #327

Merged
merged 5 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions lib/ui/proposals/list/components/hypha_proposal_history_card.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import 'package:flutter/material.dart';
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';

class HyphaProposalHistoryCard extends StatelessWidget {
final DaoData dao;
final String subTitle;

const HyphaProposalHistoryCard(
{required this.dao, required this.subTitle, super.key});

@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {},
child: HyphaCard(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 20),
child: Row(
children: [
DaoImage(dao),
const SizedBox(
width: 10,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
dao.settingsDaoTitle,
style: context.hyphaTextTheme.smallTitles,
),
Text(
subTitle,
style: context.hyphaTextTheme.ralMediumBody
.copyWith(color: HyphaColors.midGrey),
),
],
),
const Spacer(),
const Icon(Icons.arrow_forward_ios)
],
),
)),
);
}
}
77 changes: 61 additions & 16 deletions lib/ui/proposals/list/components/proposals_view.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:get/get.dart' as GetX;
import 'package:hypha_wallet/core/network/models/dao_data_model.dart';
import 'package:hypha_wallet/design/avatar_image/hypha_avatar_image.dart';
import 'package:hypha_wallet/design/background/hypha_page_background.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/blocs/authentication/authentication_bloc.dart';
import 'package:hypha_wallet/ui/profile/profile_page.dart';
import 'package:hypha_wallet/ui/proposals/filter/filter_proposals_page.dart';
import 'package:hypha_wallet/ui/proposals/filter/interactor/filter_proposals_bloc.dart';
import 'package:hypha_wallet/ui/proposals/filter/interactor/filter_status.dart';
import 'package:hypha_wallet/ui/proposals/list/components/hypha_proposal_history_card.dart';
import 'package:hypha_wallet/ui/proposals/list/components/hypha_proposals_action_card.dart';
import 'package:hypha_wallet/ui/proposals/list/interactor/proposals_bloc.dart';
import 'package:hypha_wallet/ui/shared/hypha_body_widget.dart';
Expand Down Expand Up @@ -101,30 +102,74 @@ class ProposalsView extends StatelessWidget {
height: 20,
),
Expanded(
child: ListView.separated(
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)),
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
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),
const SizedBox(
height: 30,
),
Text(
'See Proposals History',
style: context.hyphaTextTheme.ralMediumBody
.copyWith(color: HyphaColors.midGrey),
),
...List.generate(
2,
(index) {
return Container(
margin: const EdgeInsets.symmetric(
vertical: 10),
child: const HyphaProposalHistoryCard(
dao: DaoData(
docId: 67176,
detailsDaoName: 't4rcvben2fe4',
settingsDaoTitle:
'Think-it Collective',
logoIPFSHash:
'QmVB8q28U1bjfi51reQMaU7XwP4FThWj39DrU5G8MriMS9',
logoType: 'png',
settingsDaoUrl:
'think-it-collective'),
subTitle: '1,234 Past Proposals',
));
},
),
const SizedBox(
height: 90,
)
],
),
),
),
],
),
),
),
)),
floatingActionButton: IconButton(
onPressed: () {
GetX.Get.to(
() => const FilterProposalsPage(),
transition: GetX.Transition.leftToRight
);
GetX.Get.to(() => const FilterProposalsPage(),
transition: GetX.Transition.leftToRight);
},
icon: const CircleAvatar(
radius: 30,
radius: 25,
backgroundImage: AssetImage(
'assets/images/graphics/wallet_background.png'),
child: Icon(Icons.filter_alt_outlined,
Expand Down
Loading