💄 Adjust post detail screen

This commit is contained in:
2026-01-02 19:57:16 +08:00
parent e2efdc4064
commit 1d99ac6441
4 changed files with 21 additions and 4 deletions

View File

@@ -308,6 +308,7 @@ class PostItem extends HookConsumerWidget {
final bool isTextSelectable;
final bool isTranslatable;
final bool isCompact;
final double? textScale;
final VoidCallback? onRefresh;
final Function(SnPost)? onUpdate;
final VoidCallback? onOpen;
@@ -322,6 +323,7 @@ class PostItem extends HookConsumerWidget {
this.isTextSelectable = true,
this.isTranslatable = true,
this.isCompact = false,
this.textScale,
this.onRefresh,
this.onUpdate,
this.onOpen,
@@ -422,6 +424,11 @@ class PostItem extends HookConsumerWidget {
],
),
MarkdownTextContent(
textStyle: TextStyle(
fontSize:
Theme.of(context).textTheme.bodyMedium!.fontSize! *
(textScale ?? 1),
),
content: translatedText.value!,
isSelectable: isTextSelectable,
attachments: item.attachments,
@@ -557,6 +564,7 @@ class PostItem extends HookConsumerWidget {
),
PostBody(
item: item,
textScale: textScale,
isFullPost: isFullPost,
isTextSelectable: isTextSelectable,
translationSection: translationSection,

View File

@@ -870,6 +870,7 @@ class PostBody extends ConsumerWidget {
final EdgeInsets renderingPadding;
final bool isRelativeTime;
final bool hideOverlay;
final double? textScale;
const PostBody({
super.key,
@@ -881,6 +882,7 @@ class PostBody extends ConsumerWidget {
this.renderingPadding = EdgeInsets.zero,
this.isRelativeTime = true,
this.hideOverlay = false,
this.textScale,
});
@override
@@ -1108,6 +1110,14 @@ class PostBody extends ConsumerWidget {
],
).padding(bottom: 4),
MarkdownTextContent(
linesMargin: item.type == 1 && isFullPost
? const EdgeInsets.symmetric(vertical: 8)
: const EdgeInsets.symmetric(vertical: 4),
textStyle: TextStyle(
fontSize:
Theme.of(context).textTheme.bodyMedium!.fontSize! *
(textScale ?? 1),
),
content: item.isTruncated
? '${_convertContentToMarkdown(item)}...'
: _convertContentToMarkdown(item),