💄 Optimize content

This commit is contained in:
LittleSheep 2024-09-17 21:48:20 +08:00
parent 77075c8dab
commit 6d40d6bba3
2 changed files with 12 additions and 0 deletions

View File

@ -14,12 +14,14 @@ class MarkdownTextContent extends StatelessWidget {
final String content;
final String parentId;
final bool isSelectable;
final bool isLargeText;
const MarkdownTextContent({
super.key,
required this.content,
required this.parentId,
this.isSelectable = false,
this.isLargeText = false,
});
Widget _buildContent(BuildContext context) {
@ -35,6 +37,14 @@ class MarkdownTextContent extends StatelessWidget {
styleSheet: MarkdownStyleSheet.fromTheme(
Theme.of(context),
).copyWith(
textScaleFactor: isLargeText ? 1.1 : 1,
blockquote: TextStyle(
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
blockquoteDecoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceContainerHigh,
borderRadius: const BorderRadius.all(Radius.circular(4)),
),
horizontalRuleDecoration: BoxDecoration(
border: Border(
top: BorderSide(

View File

@ -550,6 +550,8 @@ class _PostItemState extends State<PostItem> {
parentId: 'p${item.id}-embed',
content: item.body['content'],
isSelectable: widget.isContentSelectable,
isLargeText: item.type == 'article' &&
widget.isFullContent,
).paddingOnly(left: 12, right: 8),
),
),