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

refactor: Update filter screen ui #340

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Changes from all 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
28 changes: 17 additions & 11 deletions lib/ui/proposals/filter/components/hypha_filter_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ class HyphaFilterCard extends StatelessWidget {
final dynamic valueNotifier;
final int index;

const HyphaFilterCard(this.valueNotifier, this.index, {this.dao, this.title, this.subTitle, super.key});
const HyphaFilterCard(this.valueNotifier, this.index,
{this.dao, this.title, this.subTitle, super.key});

@override
Widget build(BuildContext context) {
// TODO(Saif): fix the card height (filter by status)
return GestureDetector(
onTap: () {
valueNotifier.value = valueNotifier.value == index ? null : index;
},
child: HyphaCard(
child: Padding(
child: Container(
height: dao != null ? null : 54,
padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 20),
child: Row(
children: [
if (dao != null)
DaoImage(dao),
if (dao != null) DaoImage(dao),
const SizedBox(
width: 10,
),
Expand All @@ -41,19 +41,25 @@ class HyphaFilterCard extends StatelessWidget {
if (subTitle != null)
Text(
subTitle!,
style: context.hyphaTextTheme.ralMediumBody.copyWith(color: HyphaColors.midGrey),
style: context.hyphaTextTheme.ralMediumBody
.copyWith(color: HyphaColors.midGrey),
),
],
),
const Spacer(),
ValueListenableBuilder<dynamic>(
valueListenable: valueNotifier,
builder: (context, selectedIndex, child) {
return Visibility(
visible: selectedIndex == index,
child: const CircleAvatar(
radius: 12,
backgroundColor: HyphaColors.primaryBlu,
return CircleAvatar(
radius: 12,
backgroundColor: selectedIndex == index
? HyphaColors.primaryBlu
: HyphaColors.midGrey.withOpacity(.3),
child: CircleAvatar(
radius: selectedIndex == index ? 4 : 10.5,
backgroundColor: selectedIndex == index
? HyphaColors.white
: HyphaColors.lightBlack,
),
);
},
Expand Down
Loading