Skip to content

Commit

Permalink
Moved featured community post pin icon to prefix title next to the lo…
Browse files Browse the repository at this point in the history
…ck icon for locked posts. Also fixed issue of featured posts not making the title green in comfortable mode and show title first set to false.
  • Loading branch information
ajsosa committed Aug 23, 2023
1 parent e0ac1ce commit 2c21e3e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 52 deletions.
64 changes: 29 additions & 35 deletions lib/community/widgets/post_card_view_comfortable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,20 @@ class PostCardViewComfortable extends StatelessWidget {
color: Colors.red,
size: 17.0 * textScaleFactor,
)),
const WidgetSpan(
child: SizedBox(
width: 5, // your of space
)),
if (!postViewMedia.postView.post.featuredCommunity)
const WidgetSpan(
child: SizedBox(
width: 3,
)),
],
if (postViewMedia.postView.post.featuredCommunity)
WidgetSpan(
child: Icon(
Icons.push_pin_rounded,
size: 17.0 * textScaleFactor,
color: indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green,
),
),
TextSpan(
text: postViewMedia.postView.post.name,
style: theme.textTheme.bodyMedium?.copyWith(
Expand All @@ -127,19 +136,6 @@ class PostCardViewComfortable extends StatelessWidget {
: (indicateRead && postViewMedia.postView.read ? theme.textTheme.bodyMedium?.color?.withOpacity(0.55) : null),
),
),
if (postViewMedia.postView.post.featuredCommunity)
WidgetSpan(
child: Padding(
padding: const EdgeInsets.only(
left: 8.0,
),
child: Icon(
Icons.push_pin_rounded,
size: 17.0 * textScaleFactor,
color: indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green,
),
),
),
if (!useSaveButton && postViewMedia.postView.saved)
WidgetSpan(
child: Padding(
Expand Down Expand Up @@ -182,31 +178,29 @@ class PostCardViewComfortable extends StatelessWidget {
color: Colors.red,
size: 17.0 * textScaleFactor,
)),
const WidgetSpan(
child: SizedBox(
width: 5, // your of space
)),
if (!postViewMedia.postView.post.featuredCommunity)
const WidgetSpan(
child: SizedBox(
width: 3,
)),
],
if (postViewMedia.postView.post.featuredCommunity)
WidgetSpan(
child: Icon(
Icons.push_pin_rounded,
size: 17.0 * textScaleFactor,
color: indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green,
),
),
TextSpan(
text: postViewMedia.postView.post.name,
style: theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: indicateRead && postViewMedia.postView.read ? theme.textTheme.bodyMedium?.color?.withOpacity(0.65) : null,
color: postViewMedia.postView.post.featuredCommunity
? (indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green)
: (indicateRead && postViewMedia.postView.read ? theme.textTheme.bodyMedium?.color?.withOpacity(0.55) : null),
),
),
if (postViewMedia.postView.post.featuredCommunity)
WidgetSpan(
child: Padding(
padding: const EdgeInsets.only(
left: 8.0,
),
child: Icon(
Icons.push_pin_rounded,
size: 17.0 * textScaleFactor,
color: indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green,
),
),
),
if (!useSaveButton && postViewMedia.postView.saved)
WidgetSpan(
child: Padding(
Expand Down
30 changes: 13 additions & 17 deletions lib/community/widgets/post_card_view_compact.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,20 @@ class PostCardViewCompact extends StatelessWidget {
color: Colors.red,
size: 17.0 * textScaleFactor,
)),
const WidgetSpan(
child: SizedBox(
width: 5, // your of space
)),
if (!postViewMedia.postView.post.featuredCommunity)
const WidgetSpan(
child: SizedBox(
width: 3,
)),
],
if (postViewMedia.postView.post.featuredCommunity)
WidgetSpan(
child: Icon(
Icons.push_pin_rounded,
size: 17.0 * textScaleFactor,
color: indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green,
),
),
TextSpan(
text: postViewMedia.postView.post.name,
style: theme.textTheme.bodyMedium?.copyWith(
Expand All @@ -126,19 +135,6 @@ class PostCardViewCompact extends StatelessWidget {
: (indicateRead && postViewMedia.postView.read ? theme.textTheme.bodyMedium?.color?.withOpacity(0.55) : null),
),
),
if (postViewMedia.postView.post.featuredCommunity)
WidgetSpan(
child: Padding(
padding: const EdgeInsets.only(
left: 8.0,
),
child: Icon(
Icons.push_pin_rounded,
size: 17.0 * textScaleFactor,
color: indicateRead && postViewMedia.postView.read ? Colors.green.withOpacity(0.55) : Colors.green,
),
),
),
if (postViewMedia.postView.saved)
WidgetSpan(
child: Padding(
Expand Down

0 comments on commit 2c21e3e

Please sign in to comment.