mod: sys msg: push dyn

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-05 12:17:51 +08:00
parent 78d13b586a
commit 4776b84c7c

View File

@@ -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(