mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
opt check reply note
Closes #1095 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -581,20 +581,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
|||||||
) {
|
) {
|
||||||
final Content content = replyItem.content;
|
final Content content = replyItem.content;
|
||||||
final List<InlineSpan> spanChildren = <InlineSpan>[];
|
final List<InlineSpan> spanChildren = <InlineSpan>[];
|
||||||
|
bool hasNote = false;
|
||||||
if (content.richText.hasNote()) {
|
|
||||||
spanChildren.add(
|
|
||||||
TextSpan(
|
|
||||||
text: '[笔记] ',
|
|
||||||
style: TextStyle(
|
|
||||||
color: theme.colorScheme.primary,
|
|
||||||
),
|
|
||||||
recognizer: TapGestureRecognizer()
|
|
||||||
..onTap = () =>
|
|
||||||
PageUtils.handleWebview(content.richText.note.clickUrl),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
final urlKeys = content.urls.keys;
|
final urlKeys = content.urls.keys;
|
||||||
// 构建正则表达式
|
// 构建正则表达式
|
||||||
@@ -626,6 +613,9 @@ class ReplyItemGrpc extends StatelessWidget {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final isCv = url.clickReport.startsWith('{"cvid');
|
final isCv = url.clickReport.startsWith('{"cvid');
|
||||||
|
if (isCv) {
|
||||||
|
hasNote = true;
|
||||||
|
}
|
||||||
final children = [
|
final children = [
|
||||||
if (!isCv && url.hasPrefixIcon())
|
if (!isCv && url.hasPrefixIcon())
|
||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
@@ -825,6 +815,28 @@ class ReplyItemGrpc extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!hasNote &&
|
||||||
|
(content.richText.hasNote() ||
|
||||||
|
replyItem.replyControl.bizScene == 'note')) {
|
||||||
|
final hasClickUrl = content.richText.note.hasClickUrl();
|
||||||
|
spanChildren.insert(
|
||||||
|
0,
|
||||||
|
TextSpan(
|
||||||
|
text: '[笔记] ',
|
||||||
|
style: TextStyle(
|
||||||
|
color: hasClickUrl
|
||||||
|
? theme.colorScheme.primary
|
||||||
|
: theme.colorScheme.secondary,
|
||||||
|
),
|
||||||
|
recognizer: hasClickUrl
|
||||||
|
? (TapGestureRecognizer()
|
||||||
|
..onTap = () =>
|
||||||
|
PageUtils.handleWebview(content.richText.note.clickUrl))
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return TextSpan(children: spanChildren);
|
return TextSpan(children: spanChildren);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user