-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #305 from hypha-dao/feat/implement-filter-screen-ui
feat: Implement filter screen UI
- Loading branch information
Showing
4 changed files
with
254 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
import 'package:hypha_wallet/design/buttons/hypha_app_button.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/filter/components/hypha_filter_card.dart'; | ||
|
||
class FilterView extends StatelessWidget { | ||
FilterView({super.key}); | ||
|
||
final List<String> statusFilters = ['Active Proposals', 'Past Proposals']; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
backgroundColor: | ||
context.isDarkMode ? HyphaColors.darkBlack : HyphaColors.offWhite, | ||
appBar: AppBar( | ||
title: const Text('Filter Proposals'), | ||
), | ||
body: Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 26.0, vertical: 20), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
'Filter by your DAOs', | ||
style: context.hyphaTextTheme.ralMediumBody | ||
.copyWith(color: HyphaColors.midGrey), | ||
), | ||
const SizedBox( | ||
height: 10, | ||
), | ||
...List.generate( | ||
3, | ||
(index) { | ||
return Container( | ||
margin: const EdgeInsets.symmetric(vertical: 10), | ||
child: HyphaFilterCard( | ||
title: 'Hypha DAO', | ||
imageUrl: | ||
'https://etudestech.com/wp-content/uploads/2023/05/midjourney-scaled.jpeg', | ||
subTitle: '6 Active Proposals', | ||
isSelected: index == 0, | ||
)); | ||
}, | ||
), | ||
const SizedBox( | ||
height: 10, | ||
), | ||
Text( | ||
'Filter By Status', | ||
style: context.hyphaTextTheme.ralMediumBody | ||
.copyWith(color: HyphaColors.midGrey), | ||
), | ||
const SizedBox( | ||
height: 10, | ||
), | ||
...List.generate( | ||
2, | ||
(index) { | ||
return Container( | ||
margin: const EdgeInsets.symmetric(vertical: 10), | ||
child: HyphaFilterCard( | ||
title: statusFilters[index], | ||
isSelected: index == 0, | ||
)); | ||
}, | ||
), | ||
const Spacer(), | ||
HyphaAppButton( | ||
title: 'SAVE FILTERS', | ||
onPressed: () {}, | ||
), | ||
const SizedBox( | ||
height: 20, | ||
) | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:hypha_wallet/design/avatar_image/hypha_avatar_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 HyphaFilterCard extends StatelessWidget { | ||
final String? imageUrl; | ||
final String title; | ||
final String? subTitle; | ||
final bool isSelected; | ||
|
||
const HyphaFilterCard( | ||
{required this.title, | ||
this.isSelected = false, | ||
this.subTitle, | ||
this.imageUrl, | ||
super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return HyphaCard( | ||
child: Padding( | ||
padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 20), | ||
child: Row( | ||
children: [ | ||
if (imageUrl != null) | ||
HyphaAvatarImage( | ||
imageRadius: 24, | ||
imageFromUrl: imageUrl, | ||
), | ||
const SizedBox( | ||
width: 10, | ||
), | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
title, | ||
style: context.hyphaTextTheme.smallTitles, | ||
), | ||
if (subTitle != null) | ||
Text( | ||
subTitle!, | ||
style: context.hyphaTextTheme.ralMediumBody | ||
.copyWith(color: HyphaColors.midGrey), | ||
), | ||
], | ||
), | ||
const Spacer(), | ||
if (isSelected) | ||
const CircleAvatar( | ||
radius: 12, | ||
backgroundColor: HyphaColors.primaryBlu, | ||
) | ||
], | ||
), | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:hypha_wallet/ui/proposals/filter/components/filter_view.dart'; | ||
|
||
class FilterPage extends StatelessWidget { | ||
const FilterPage({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return FilterView(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters