mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-24 02:56:58 +08:00
@@ -7,14 +7,22 @@ class DanmakuMsg {
|
||||
Map<String, BaseEmote>? emots;
|
||||
BaseEmote? uemote;
|
||||
|
||||
DanmakuMsg();
|
||||
DanmakuMsg({
|
||||
required this.name,
|
||||
required this.uid,
|
||||
required this.text,
|
||||
this.emots,
|
||||
this.uemote,
|
||||
});
|
||||
|
||||
DanmakuMsg.fromPrefetch(Map<String, dynamic> obj) {
|
||||
final user = obj['user'];
|
||||
name = user['base']['name'];
|
||||
uid = user['uid'];
|
||||
text = obj['text'];
|
||||
emots = (obj['emots'] as Map<String, dynamic>?)?.map((k, v) => MapEntry(k, BaseEmote.fromJson(v)));
|
||||
emots = (obj['emots'] as Map<String, dynamic>?)?.map(
|
||||
(k, v) => MapEntry(k, BaseEmote.fromJson(v)),
|
||||
);
|
||||
if ((obj['emoticon']?['emoticon_unique'] as String?)?.isNotEmpty == true) {
|
||||
uemote = BaseEmote.fromJson(obj['emoticon']);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ class BaseEmote {
|
||||
late String emoticonUnique;
|
||||
late double width;
|
||||
double? height;
|
||||
late final isUpower = emoticonUnique.startsWith('upower_');
|
||||
|
||||
BaseEmote.fromJson(Map<String, dynamic> json) {
|
||||
url = json['url'];
|
||||
|
||||
Reference in New Issue
Block a user