show user medal

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-03-22 15:01:30 +08:00
parent fc7fc18b14
commit 2bebf200df
151 changed files with 1435 additions and 1321 deletions

View File

@@ -1,5 +1,6 @@
import 'package:PiliPlus/models/model_owner.dart';
import 'package:PiliPlus/models_new/live/live_danmaku/live_emote.dart';
import 'package:PiliPlus/models_new/live/live_medal_wall/uinfo_medal.dart';
import 'package:PiliPlus/pages/danmaku/danmaku_model.dart';
class DanmakuMsg {
@@ -9,6 +10,7 @@ class DanmakuMsg {
final BaseEmote? uemote;
final Owner? reply;
final LiveDanmaku extra;
final UinfoMedal? medalInfo;
const DanmakuMsg({
required this.name,
@@ -17,6 +19,7 @@ class DanmakuMsg {
this.uemote,
this.reply,
required this.extra,
this.medalInfo,
});
factory DanmakuMsg.fromPrefetch(Map<String, dynamic> obj) {
@@ -36,6 +39,7 @@ class DanmakuMsg {
);
}
}
final medal = user['medal'];
return DanmakuMsg(
name: user['base']['name'],
text: obj['text'],
@@ -51,6 +55,7 @@ class DanmakuMsg {
ts: checkInfo['ts'],
ct: checkInfo['ct'],
),
medalInfo: medal == null ? null : UinfoMedal.fromJson(medal),
);
}