From 38551820c4aec6db6d8251914119277ba48b5041 Mon Sep 17 00:00:00 2001 From: Micah Morrison Date: Wed, 3 Jan 2024 19:11:53 -0500 Subject: [PATCH] Highlight featured local posts (#991) --- .../widgets/post_card_view_comfortable.dart | 18 ++++++++++++------ .../widgets/post_card_view_compact.dart | 6 +++--- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/community/widgets/post_card_view_comfortable.dart b/lib/community/widgets/post_card_view_comfortable.dart index 1f4794bfe..d1cf61359 100644 --- a/lib/community/widgets/post_card_view_comfortable.dart +++ b/lib/community/widgets/post_card_view_comfortable.dart @@ -125,7 +125,7 @@ class PostCardViewComfortable extends StatelessWidget { semanticLabel: 'Saved', ), ), - if (postViewMedia.postView.post.featuredCommunity) + if (postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.post.featuredLocal) WidgetSpan( child: Icon( Icons.push_pin_rounded, @@ -133,7 +133,10 @@ class PostCardViewComfortable extends StatelessWidget { color: indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green, ), ), - if (postViewMedia.postView.post.featuredCommunity || (!useSaveButton && postViewMedia.postView.saved) || postViewMedia.postView.post.locked) + if (postViewMedia.postView.post.featuredCommunity || + postViewMedia.postView.post.featuredLocal || + (!useSaveButton && postViewMedia.postView.saved) || + postViewMedia.postView.post.locked) const WidgetSpan( child: SizedBox( width: 3.5, @@ -144,7 +147,7 @@ class PostCardViewComfortable extends StatelessWidget { style: theme.textTheme.bodyMedium?.copyWith( fontWeight: FontWeight.w600, fontSize: MediaQuery.textScalerOf(context).scale(theme.textTheme.bodyMedium!.fontSize! * state.titleFontSizeScale.textScaleFactor), - color: postViewMedia.postView.post.featuredCommunity + color: postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.post.featuredLocal ? (indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green) : (indicateRead && postViewMedia.postView.read ? theme.textTheme.bodyMedium?.color?.withOpacity(0.55) : null), ), @@ -187,7 +190,7 @@ class PostCardViewComfortable extends StatelessWidget { semanticLabel: 'Saved', ), ), - if (postViewMedia.postView.post.featuredCommunity) + if (postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.post.featuredLocal) WidgetSpan( child: Icon( Icons.push_pin_rounded, @@ -195,7 +198,10 @@ class PostCardViewComfortable extends StatelessWidget { color: indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green, ), ), - if (postViewMedia.postView.post.featuredCommunity || (!useSaveButton && postViewMedia.postView.saved) || postViewMedia.postView.post.locked) + if (postViewMedia.postView.post.featuredCommunity || + postViewMedia.postView.post.featuredLocal || + (!useSaveButton && postViewMedia.postView.saved) || + postViewMedia.postView.post.locked) const WidgetSpan( child: SizedBox( width: 3.5, @@ -206,7 +212,7 @@ class PostCardViewComfortable extends StatelessWidget { style: theme.textTheme.bodyMedium?.copyWith( fontWeight: FontWeight.w600, fontSize: MediaQuery.textScalerOf(context).scale(theme.textTheme.bodyMedium!.fontSize! * state.titleFontSizeScale.textScaleFactor), - color: postViewMedia.postView.post.featuredCommunity + color: postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.post.featuredLocal ? (indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green) : (indicateRead && postViewMedia.postView.read ? theme.textTheme.bodyMedium?.color?.withOpacity(0.55) : null), ), diff --git a/lib/community/widgets/post_card_view_compact.dart b/lib/community/widgets/post_card_view_compact.dart index 2f78171d2..fb4072392 100644 --- a/lib/community/widgets/post_card_view_compact.dart +++ b/lib/community/widgets/post_card_view_compact.dart @@ -123,7 +123,7 @@ class PostCardViewCompact extends StatelessWidget { semanticLabel: 'Saved', ), ), - if (postViewMedia.postView.post.featuredCommunity) + if (postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.post.featuredLocal) WidgetSpan( child: Icon( Icons.push_pin_rounded, @@ -131,7 +131,7 @@ class PostCardViewCompact extends StatelessWidget { color: indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green, ), ), - if (postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.saved || postViewMedia.postView.post.locked) + if (postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.post.featuredLocal || postViewMedia.postView.saved || postViewMedia.postView.post.locked) const WidgetSpan( child: SizedBox( width: 3.5, @@ -142,7 +142,7 @@ class PostCardViewCompact extends StatelessWidget { style: theme.textTheme.bodyMedium?.copyWith( fontWeight: FontWeight.w600, fontSize: MediaQuery.textScalerOf(context).scale(theme.textTheme.bodyMedium!.fontSize! * state.titleFontSizeScale.textScaleFactor), - color: postViewMedia.postView.post.featuredCommunity + color: postViewMedia.postView.post.featuredCommunity || postViewMedia.postView.post.featuredLocal ? (indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green) : (indicateRead && postViewMedia.postView.read ? theme.textTheme.bodyMedium?.color?.withOpacity(0.55) : null), ),