Featured replies clickable

This commit is contained in:
LittleSheep 2024-09-23 23:34:25 +08:00
parent 9d5c452eae
commit 22b2ae32e9

View File

@ -101,11 +101,14 @@ class _PostItemState extends State<PostItem> {
onChange: (size) { onChange: (size) {
setState(() => _contentHeight = size.height); setState(() => _contentHeight = size.height);
}, },
child: SingleChildScrollView(
physics: const NeverScrollableScrollPhysics(),
child: MarkdownTextContent( child: MarkdownTextContent(
parentId: 'p${item.id}', parentId: 'p${item.id}',
content: item.body['content'], content: item.body['content'],
isAutoWarp: item.type == 'story', isAutoWarp: item.type == 'story',
isSelectable: widget.isContentSelectable, isSelectable: widget.isContentSelectable,
),
).paddingOnly( ).paddingOnly(
left: 16, left: 16,
right: 12, right: 12,
@ -374,15 +377,22 @@ class _PostFeaturedReplyWidget extends StatelessWidget {
child: Column( child: Column(
children: snapshot.data! children: snapshot.data!
.map( .map(
(reply) => Row( (reply) => ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(8)),
child: OpenContainer(
closedBuilder: (_, openContainer) => Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AccountAvatar(content: reply.author.avatar, radius: 10), AccountAvatar(
content: reply.author.avatar,
radius: 10,
),
const Gap(6), const Gap(6),
Text( Text(
reply.author.nick, reply.author.nick,
style: const TextStyle(fontWeight: FontWeight.bold), style:
const TextStyle(fontWeight: FontWeight.bold),
), ),
const Gap(6), const Gap(6),
Text( Text(
@ -428,6 +438,20 @@ class _PostFeaturedReplyWidget extends StatelessWidget {
), ),
], ],
).paddingSymmetric(horizontal: 12, vertical: 8), ).paddingSymmetric(horizontal: 12, vertical: 8),
openBuilder: (_, __) => TitleShell(
title: 'postDetail'.tr,
child: PostDetailScreen(
id: reply.id.toString(),
post: reply,
),
),
closedElevation: 0,
openElevation: 0,
closedColor:
Theme.of(context).colorScheme.surfaceContainer,
openColor: Theme.of(context).colorScheme.surface,
),
),
) )
.toList(), .toList(),
), ),