Skip to content

Commit

Permalink
feat: Update UI for reaction creator (#228)
Browse files Browse the repository at this point in the history
* Update UI for reaction's creator

* Fix error

---------

Co-authored-by: Zryte <[email protected]>
  • Loading branch information
Zryte and Zryte authored Jun 5, 2024
1 parent be39618 commit 4fefb3f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
25 changes: 11 additions & 14 deletions lib/core/widget/feed_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class FeedWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
final themeData = Theme.of(context);


return StreamBuilder<AmityPost>(
stream: amityPost.listen.stream,
Expand Down Expand Up @@ -148,20 +147,19 @@ class FeedWidget extends StatelessWidget {
style: themeData.textTheme.bodySmall,
),
if (value.target is CommunityTarget)

Text(
'Posted On : ${(value.target as CommunityTarget).targetCommunity?.displayName ?? 'No name'} Community',
style: themeData.textTheme.bodySmall,
),

(value.target as CommunityTarget).postedCommunityMember!=null?

Text(
'Poster Roles On : ${(value.target as CommunityTarget).postedCommunityMember?.roles ?? 'No Roles'} in Community',
style: themeData.textTheme.bodySmall,
): const SizedBox() ,


if (value.target is CommunityTarget)
(value.target as CommunityTarget)
.postedCommunityMember !=
null
? Text(
'Poster Roles On : ${(value.target as CommunityTarget).postedCommunityMember?.roles ?? 'No Roles'} in Community',
style: themeData.textTheme.bodySmall,
)
: const SizedBox(),
Text(
"LatestCommentUserName -> ${snapshot.data!.latestComments?[0].user?.displayName ?? "No Latest comment user"}",
style: themeData.textTheme.bodySmall,
Expand Down Expand Up @@ -229,8 +227,7 @@ class FeedWidget extends StatelessWidget {
),
GestureDetector(
onTap: () {
GoRouter.of(context).pushNamed(
AppRoute.getReachUser,
GoRouter.of(context).pushNamed(AppRoute.getReachUser,
queryParams: {
'referenceId': value.postId!,
'referenceType': "post"
Expand All @@ -257,7 +254,7 @@ class FeedWidget extends StatelessWidget {
GoRouter.of(context).pushNamed(
AppRoute.commentList,
queryParams: {
'referenceType' : 'post',
'referenceType': 'post',
'referenceId': value.postId!,
'communityId': communityId,
'isPublic': isPublic.toString()
Expand Down
23 changes: 18 additions & 5 deletions lib/core/widget/reaction_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@ class ReactionWidget extends StatelessWidget {
color: Colors.black12),
child: Row(
children: [
Container(
width: 36,
height: 36,
decoration: BoxDecoration(
shape: BoxShape.circle, color: Colors.grey.withOpacity(.3)),
clipBehavior: Clip.antiAliasWithSaveLayer,
child: reaction.creator?.avatarUrl != null
? Image.network(
reaction.creator!.avatarUrl!,
fit: BoxFit.fill,
)
: Image.asset('assets/user_placeholder.png'),
),
const SizedBox(
width: 12,
),
Expanded(child: Text(reaction.creator?.displayName ?? "")),
Container(
width: 42,
height: 42,
Expand All @@ -25,11 +42,7 @@ class ReactionWidget extends StatelessWidget {
reaction.reactionName!,
),
),
),
const SizedBox(
width: 12,
),
Text(reaction.userDisplayName ?? "")
)
],
),
);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_social_sample_app
description: Demonstrates how to use the flutter_application_1 plugin.
version: 1.1.44+59
version: 1.1.45+60


environment:
Expand Down

0 comments on commit 4fefb3f

Please sign in to comment.