Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-23 16:09:05 +08:00
parent 79e30047f5
commit fcf758e290
10 changed files with 50 additions and 39 deletions

View File

@@ -97,18 +97,12 @@ class LiveRoomChat extends StatelessWidget {
TextSpan _buildMsg(dynamic obj) {
dynamic emots = obj['emots'];
dynamic uemote = obj['uemote'];
List list = [
List<String> list = [
if (emots != null) ...emots.keys,
if (uemote is Map) uemote['emoticon_unique'].replaceFirst('upower_', '')
];
if (list.isNotEmpty) {
list = list.map((e) {
return e.toString().replaceAllMapped(
RegExp(r'\[(.*?)\]'),
(match) => r'\[' + match.group(1)! + r'\]',
);
}).toList();
RegExp regExp = RegExp(list.join('|'));
RegExp regExp = RegExp(list.map(RegExp.escape).join('|'));
final List<InlineSpan> spanChildren = <InlineSpan>[];
(obj['text'] as String).splitMapJoin(
regExp,