mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
mod: sys msg: push dyn
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -151,7 +151,7 @@ class _SysMsgPageState extends State<SysMsgPage> {
|
|||||||
InlineSpan _buildContent(String content) {
|
InlineSpan _buildContent(String content) {
|
||||||
final List<InlineSpan> spanChildren = <InlineSpan>[];
|
final List<InlineSpan> spanChildren = <InlineSpan>[];
|
||||||
RegExp urlRegExp = RegExp(
|
RegExp urlRegExp = RegExp(
|
||||||
r'#\{([^}]*)\}\{([^}]*)\}|https?:\/\/[^\s/\$.?#].[^\s]*|www\.[^\s/\$.?#].[^\s]*|【(.*?)】');
|
r'#\{([^}]*)\}\{([^}]*)\}|https?:\/\/[^\s/\$.?#].[^\s]*|www\.[^\s/\$.?#].[^\s]*|【(.*?)】|((\d+))');
|
||||||
content.splitMapJoin(
|
content.splitMapJoin(
|
||||||
urlRegExp,
|
urlRegExp,
|
||||||
onMatch: (Match match) {
|
onMatch: (Match match) {
|
||||||
@@ -200,9 +200,29 @@ class _SysMsgPageState extends State<SysMsgPage> {
|
|||||||
);
|
);
|
||||||
spanChildren.add(TextSpan(text: '】'));
|
spanChildren.add(TextSpan(text: '】'));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
spanChildren.add(TextSpan(text: match[0]));
|
||||||
|
}
|
||||||
|
} else if (matchStr.startsWith('(')) {
|
||||||
|
try {
|
||||||
|
match[4]; // dynId
|
||||||
|
spanChildren.add(TextSpan(text: '('));
|
||||||
spanChildren.add(
|
spanChildren.add(
|
||||||
TextSpan(text: match[0]),
|
TextSpan(
|
||||||
|
text: '查看动态',
|
||||||
|
style: TextStyle(color: Theme.of(context).colorScheme.primary),
|
||||||
|
recognizer: TapGestureRecognizer()
|
||||||
|
..onTap = () {
|
||||||
|
try {
|
||||||
|
Utils.pushDynFromId(match[4]);
|
||||||
|
} catch (err) {
|
||||||
|
SmartDialog.showToast(err.toString());
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
spanChildren.add(TextSpan(text: ')'));
|
||||||
|
} catch (e) {
|
||||||
|
spanChildren.add(TextSpan(text: match[0]));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
spanChildren.add(
|
spanChildren.add(
|
||||||
|
|||||||
Reference in New Issue
Block a user