opt: reply2reply showing

This commit is contained in:
bggRGjQaUbCoE
2024-08-27 09:40:53 +08:00
parent e01026ad93
commit 7ec2fbb67d
2 changed files with 29 additions and 12 deletions

View File

@@ -55,7 +55,7 @@ class PBadge extends StatelessWidget {
BorderRadius br = BorderRadius.circular(4); BorderRadius br = BorderRadius.circular(4);
if (size == 'small') { if (size == 'small') {
paddingStyle = const EdgeInsets.symmetric(vertical: 0, horizontal: 3); paddingStyle = const EdgeInsets.symmetric(vertical: 1, horizontal: 3);
fontSize = 11; fontSize = 11;
br = BorderRadius.circular(3); br = BorderRadius.circular(3);
} }
@@ -69,7 +69,18 @@ class PBadge extends StatelessWidget {
), ),
child: Text( child: Text(
text ?? "", text ?? "",
style: TextStyle(fontSize: fs ?? fontSize, color: color), style: TextStyle(
height: 1,
fontSize: fs ?? fontSize,
color: color,
fontWeight: FontWeight.bold,
),
strutStyle: StrutStyle(
leading: 0,
height: 1,
fontSize: fs ?? fontSize,
fontWeight: FontWeight.bold,
),
semanticsLabel: semanticsLabel, semanticsLabel: semanticsLabel,
), ),
); );
@@ -82,10 +93,7 @@ class PBadge extends StatelessWidget {
child: content, child: content,
); );
} else { } else {
return Padding( return content;
padding: const EdgeInsets.only(right: 5),
child: content,
);
} }
} }
} }

View File

@@ -252,9 +252,9 @@ class ReplyItem extends StatelessWidget {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
TextSpan( TextSpan(
children: [ children: [
if (replyItem!.isTop!) if (replyItem!.isTop!) ...[
const WidgetSpan( const WidgetSpan(
alignment: PlaceholderAlignment.top, alignment: PlaceholderAlignment.middle,
child: PBadge( child: PBadge(
text: 'TOP', text: 'TOP',
size: 'small', size: 'small',
@@ -264,6 +264,8 @@ class ReplyItem extends StatelessWidget {
semanticsLabel: '置顶', semanticsLabel: '置顶',
), ),
), ),
const TextSpan(text: ' '),
],
buildContent(context, replyItem!, replyReply, null), buildContent(context, replyItem!, replyReply, null),
], ],
), ),
@@ -463,21 +465,28 @@ class ReplyItemRow extends StatelessWidget {
if (replies![i].isUp!) ...[ if (replies![i].isUp!) ...[
const TextSpan(text: ' '), const TextSpan(text: ' '),
const WidgetSpan( const WidgetSpan(
alignment: PlaceholderAlignment.top, alignment: PlaceholderAlignment.middle,
child: PBadge( child: PBadge(
text: 'UP', text: 'UP',
size: 'small', size: 'small',
stack: 'normal', stack: 'normal',
fs: 9, fs: 9,
), ),
) ),
const TextSpan(text: ' '),
], ],
TextSpan( TextSpan(
text: replies![i].root == replies![i].parent text: replies![i].root == replies![i].parent
? ': ' ? ': '
: ' '), : replies![i].isUp!
? ''
: ' '),
buildContent( buildContent(
context, replies![i], replyReply, replyItem), context,
replies![i],
replyReply,
replyItem,
),
], ],
), ),
)), )),