From 5e133387962a50d9083c14e8503c8a6962527f8c Mon Sep 17 00:00:00 2001 From: Zied Dahmani Date: Tue, 17 Sep 2024 13:37:28 +0100 Subject: [PATCH] refactor: remove Json keys and add creator and voter names to placeholder display --- lib/core/network/models/base_proposal_model.dart | 2 -- lib/design/avatar_image/hypha_avatar_image.dart | 1 - lib/ui/proposals/components/proposal_creator.dart | 1 + lib/ui/proposals/details/components/proposal_voters.dart | 1 + 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/core/network/models/base_proposal_model.dart b/lib/core/network/models/base_proposal_model.dart index e3d6c319..2dbb69f8 100644 --- a/lib/core/network/models/base_proposal_model.dart +++ b/lib/core/network/models/base_proposal_model.dart @@ -8,7 +8,6 @@ abstract class BaseProposalModel { @JsonKey(name: 'docId') final String id; - @JsonKey(name: 'dao') DaoData? dao; @JsonKey(name: 'details_timeShareX100_i') @@ -26,7 +25,6 @@ abstract class BaseProposalModel { @JsonKey(name: 'ballot_expiration_t') final DateTime? expiration; - @JsonKey(name: 'creator') ProfileData? creator; @JsonKey(name: 'vote') diff --git a/lib/design/avatar_image/hypha_avatar_image.dart b/lib/design/avatar_image/hypha_avatar_image.dart index 6e72657d..f9b3f521 100644 --- a/lib/design/avatar_image/hypha_avatar_image.dart +++ b/lib/design/avatar_image/hypha_avatar_image.dart @@ -53,7 +53,6 @@ class HyphaAvatarImage extends StatelessWidget { } else if (name != null) { image = _buildFallbackAvatar(context); } else { - // TODO(Zied): change the icon image = Icon(HyphaIcons.image, size: imageRadius, color: context.textTheme.titleSmall?.color); } diff --git a/lib/ui/proposals/components/proposal_creator.dart b/lib/ui/proposals/components/proposal_creator.dart index ac845b47..6ae86ec5 100644 --- a/lib/ui/proposals/components/proposal_creator.dart +++ b/lib/ui/proposals/components/proposal_creator.dart @@ -15,6 +15,7 @@ class ProposalCreator extends StatelessWidget { HyphaAvatarImage( imageRadius: 24, imageFromUrl: creator?.avatarUrl, + name: creator?.name, ), const SizedBox(width: 10), Expanded( diff --git a/lib/ui/proposals/details/components/proposal_voters.dart b/lib/ui/proposals/details/components/proposal_voters.dart index 19e297d7..0680a4cc 100644 --- a/lib/ui/proposals/details/components/proposal_voters.dart +++ b/lib/ui/proposals/details/components/proposal_voters.dart @@ -47,6 +47,7 @@ class ProposalVoters extends StatelessWidget { : HyphaAvatarImage( imageRadius: 24, imageFromUrl: votes[index].voterImageUrl, + name: votes[index].voter, ), ); },