mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-21 03:15:14 +08:00
tweaks (#1846)
* opt: live extra * opt: remove addPointer * opt: use ssd * opt: cache svg * opt: localToGlobal * opt: disabled icon * opt: onVideoDetailChange switch * fix --------- Co-authored-by: dom <githubaccount56556@proton.me>
This commit is contained in:
committed by
GitHub
parent
4a3d827f7a
commit
e707764f84
@@ -4,26 +4,23 @@ import 'package:PiliPlus/pages/danmaku/danmaku_model.dart';
|
||||
|
||||
class DanmakuMsg {
|
||||
final String name;
|
||||
final Object uid;
|
||||
final String text;
|
||||
final Map<String, BaseEmote>? emots;
|
||||
final BaseEmote? uemote;
|
||||
final LiveDanmaku extra;
|
||||
final Owner? reply;
|
||||
final LiveDanmaku extra;
|
||||
|
||||
const DanmakuMsg({
|
||||
required this.name,
|
||||
required this.uid,
|
||||
required this.text,
|
||||
this.emots,
|
||||
this.uemote,
|
||||
required this.extra,
|
||||
this.reply,
|
||||
required this.extra,
|
||||
});
|
||||
|
||||
factory DanmakuMsg.fromPrefetch(Map<String, dynamic> obj) {
|
||||
final user = obj['user'];
|
||||
final uid = user['uid'];
|
||||
BaseEmote? uemote;
|
||||
if ((obj['emoticon']?['emoticon_unique'] as String?)?.isNotEmpty == true) {
|
||||
uemote = BaseEmote.fromJson(obj['emoticon']);
|
||||
@@ -41,30 +38,28 @@ class DanmakuMsg {
|
||||
}
|
||||
return DanmakuMsg(
|
||||
name: user['base']['name'],
|
||||
uid: uid,
|
||||
text: obj['text'],
|
||||
emots: (obj['emots'] as Map<String, dynamic>?)?.map(
|
||||
(k, v) => MapEntry(k, BaseEmote.fromJson(v)),
|
||||
),
|
||||
uemote: uemote,
|
||||
reply: reply,
|
||||
extra: LiveDanmaku(
|
||||
id: obj['id_str'],
|
||||
mid: uid,
|
||||
mid: user['uid'],
|
||||
dmType: obj['dm_type'],
|
||||
ts: checkInfo['ts'],
|
||||
ct: checkInfo['ct'],
|
||||
),
|
||||
reply: reply,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'name': name,
|
||||
'uid': uid,
|
||||
'text': text,
|
||||
'emots': emots,
|
||||
'uemote': uemote?.toJson(),
|
||||
'emots': ?emots,
|
||||
'uemote': ?uemote?.toJson(),
|
||||
'reply': ?reply?.toJson(),
|
||||
'extra': extra.toJson(),
|
||||
'reply': reply?.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user