mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: send live emote
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
23
lib/models/live/live_emoticons/data.dart
Normal file
23
lib/models/live/live_emoticons/data.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'datum.dart';
|
||||
|
||||
class LiveEmoteData {
|
||||
int? fansBrand;
|
||||
List<LiveEmoteDatum>? data;
|
||||
dynamic purchaseUrl;
|
||||
|
||||
LiveEmoteData({this.fansBrand, this.data, this.purchaseUrl});
|
||||
|
||||
factory LiveEmoteData.fromJson(Map<String, dynamic> json) => LiveEmoteData(
|
||||
fansBrand: json['fans_brand'] as int?,
|
||||
data: (json['data'] as List<dynamic>?)
|
||||
?.map((e) => LiveEmoteDatum.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
purchaseUrl: json['purchase_url'] as dynamic,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'fans_brand': fansBrand,
|
||||
'data': data?.map((e) => e.toJson()).toList(),
|
||||
'purchase_url': purchaseUrl,
|
||||
};
|
||||
}
|
||||
71
lib/models/live/live_emoticons/datum.dart
Normal file
71
lib/models/live/live_emoticons/datum.dart
Normal file
@@ -0,0 +1,71 @@
|
||||
import 'emoticon.dart';
|
||||
import 'top_show.dart';
|
||||
import 'top_show_recent.dart';
|
||||
|
||||
class LiveEmoteDatum {
|
||||
List<LiveEmoticon>? emoticons;
|
||||
int? pkgId;
|
||||
String? pkgName;
|
||||
int? pkgType;
|
||||
String? pkgDescript;
|
||||
int? pkgPerm;
|
||||
int? unlockIdentity;
|
||||
int? unlockNeedGift;
|
||||
String? currentCover;
|
||||
List<dynamic>? recentlyUsedEmoticons;
|
||||
TopShow? topShow;
|
||||
TopShowRecent? topShowRecent;
|
||||
|
||||
LiveEmoteDatum({
|
||||
this.emoticons,
|
||||
this.pkgId,
|
||||
this.pkgName,
|
||||
this.pkgType,
|
||||
this.pkgDescript,
|
||||
this.pkgPerm,
|
||||
this.unlockIdentity,
|
||||
this.unlockNeedGift,
|
||||
this.currentCover,
|
||||
this.recentlyUsedEmoticons,
|
||||
this.topShow,
|
||||
this.topShowRecent,
|
||||
});
|
||||
|
||||
factory LiveEmoteDatum.fromJson(Map<String, dynamic> json) => LiveEmoteDatum(
|
||||
emoticons: (json['emoticons'] as List<dynamic>?)
|
||||
?.map((e) => LiveEmoticon.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
pkgId: json['pkg_id'] as int?,
|
||||
pkgName: json['pkg_name'] as String?,
|
||||
pkgType: json['pkg_type'] as int?,
|
||||
pkgDescript: json['pkg_descript'] as String?,
|
||||
pkgPerm: json['pkg_perm'] as int?,
|
||||
unlockIdentity: json['unlock_identity'] as int?,
|
||||
unlockNeedGift: json['unlock_need_gift'] as int?,
|
||||
currentCover: json['current_cover'] as String?,
|
||||
recentlyUsedEmoticons:
|
||||
json['recently_used_emoticons'] as List<dynamic>?,
|
||||
topShow: json['top_show'] == null
|
||||
? null
|
||||
: TopShow.fromJson(json['top_show'] as Map<String, dynamic>),
|
||||
topShowRecent: json['top_show_recent'] == null
|
||||
? null
|
||||
: TopShowRecent.fromJson(
|
||||
json['top_show_recent'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'emoticons': emoticons?.map((e) => e.toJson()).toList(),
|
||||
'pkg_id': pkgId,
|
||||
'pkg_name': pkgName,
|
||||
'pkg_type': pkgType,
|
||||
'pkg_descript': pkgDescript,
|
||||
'pkg_perm': pkgPerm,
|
||||
'unlock_identity': unlockIdentity,
|
||||
'unlock_need_gift': unlockNeedGift,
|
||||
'current_cover': currentCover,
|
||||
'recently_used_emoticons': recentlyUsedEmoticons,
|
||||
'top_show': topShow?.toJson(),
|
||||
'top_show_recent': topShowRecent?.toJson(),
|
||||
};
|
||||
}
|
||||
83
lib/models/live/live_emoticons/emoticon.dart
Normal file
83
lib/models/live/live_emoticons/emoticon.dart
Normal file
@@ -0,0 +1,83 @@
|
||||
class LiveEmoticon {
|
||||
String? emoji;
|
||||
String? descript;
|
||||
String? url;
|
||||
int? isDynamic;
|
||||
int? inPlayerArea;
|
||||
int? width;
|
||||
int? height;
|
||||
int? identity;
|
||||
int? unlockNeedGift;
|
||||
int? perm;
|
||||
int? unlockNeedLevel;
|
||||
int? emoticonValueType;
|
||||
int? bulgeDisplay;
|
||||
String? unlockShowText;
|
||||
String? unlockShowColor;
|
||||
String? emoticonUnique;
|
||||
String? unlockShowImage;
|
||||
int? emoticonId;
|
||||
|
||||
LiveEmoticon({
|
||||
this.emoji,
|
||||
this.descript,
|
||||
this.url,
|
||||
this.isDynamic,
|
||||
this.inPlayerArea,
|
||||
this.width,
|
||||
this.height,
|
||||
this.identity,
|
||||
this.unlockNeedGift,
|
||||
this.perm,
|
||||
this.unlockNeedLevel,
|
||||
this.emoticonValueType,
|
||||
this.bulgeDisplay,
|
||||
this.unlockShowText,
|
||||
this.unlockShowColor,
|
||||
this.emoticonUnique,
|
||||
this.unlockShowImage,
|
||||
this.emoticonId,
|
||||
});
|
||||
|
||||
factory LiveEmoticon.fromJson(Map<String, dynamic> json) => LiveEmoticon(
|
||||
emoji: json['emoji'] as String?,
|
||||
descript: json['descript'] as String?,
|
||||
url: json['url'] as String?,
|
||||
isDynamic: json['is_dynamic'] as int?,
|
||||
inPlayerArea: json['in_player_area'] as int?,
|
||||
width: json['width'] as int? ?? 0,
|
||||
height: json['height'] as int? ?? 0,
|
||||
identity: json['identity'] as int?,
|
||||
unlockNeedGift: json['unlock_need_gift'] as int?,
|
||||
perm: json['perm'] as int?,
|
||||
unlockNeedLevel: json['unlock_need_level'] as int?,
|
||||
emoticonValueType: json['emoticon_value_type'] as int?,
|
||||
bulgeDisplay: json['bulge_display'] as int?,
|
||||
unlockShowText: json['unlock_show_text'] as String?,
|
||||
unlockShowColor: json['unlock_show_color'] as String?,
|
||||
emoticonUnique: json['emoticon_unique'] as String?,
|
||||
unlockShowImage: json['unlock_show_image'] as String?,
|
||||
emoticonId: json['emoticon_id'] as int?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'emoji': emoji,
|
||||
'descript': descript,
|
||||
'url': url,
|
||||
'is_dynamic': isDynamic,
|
||||
'in_player_area': inPlayerArea,
|
||||
'width': width,
|
||||
'height': height,
|
||||
'identity': identity,
|
||||
'unlock_need_gift': unlockNeedGift,
|
||||
'perm': perm,
|
||||
'unlock_need_level': unlockNeedLevel,
|
||||
'emoticon_value_type': emoticonValueType,
|
||||
'bulge_display': bulgeDisplay,
|
||||
'unlock_show_text': unlockShowText,
|
||||
'unlock_show_color': unlockShowColor,
|
||||
'emoticon_unique': emoticonUnique,
|
||||
'unlock_show_image': unlockShowImage,
|
||||
'emoticon_id': emoticonId,
|
||||
};
|
||||
}
|
||||
26
lib/models/live/live_emoticons/live_emoticons.dart
Normal file
26
lib/models/live/live_emoticons/live_emoticons.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'data.dart';
|
||||
|
||||
class LiveEmoticons {
|
||||
int? code;
|
||||
String? message;
|
||||
int? ttl;
|
||||
LiveEmoteData? data;
|
||||
|
||||
LiveEmoticons({this.code, this.message, this.ttl, this.data});
|
||||
|
||||
factory LiveEmoticons.fromJson(Map<String, dynamic> json) => LiveEmoticons(
|
||||
code: json['code'] as int?,
|
||||
message: json['message'] as String?,
|
||||
ttl: json['ttl'] as int?,
|
||||
data: json['data'] == null
|
||||
? null
|
||||
: LiveEmoteData.fromJson(json['data'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'code': code,
|
||||
'message': message,
|
||||
'ttl': ttl,
|
||||
'data': data?.toJson(),
|
||||
};
|
||||
}
|
||||
16
lib/models/live/live_emoticons/top_left.dart
Normal file
16
lib/models/live/live_emoticons/top_left.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
class TopLeft {
|
||||
String? image;
|
||||
String? text;
|
||||
|
||||
TopLeft({this.image, this.text});
|
||||
|
||||
factory TopLeft.fromJson(Map<String, dynamic> json) => TopLeft(
|
||||
image: json['image'] as String?,
|
||||
text: json['text'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'image': image,
|
||||
'text': text,
|
||||
};
|
||||
}
|
||||
16
lib/models/live/live_emoticons/top_right.dart
Normal file
16
lib/models/live/live_emoticons/top_right.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
class TopRight {
|
||||
String? image;
|
||||
String? text;
|
||||
|
||||
TopRight({this.image, this.text});
|
||||
|
||||
factory TopRight.fromJson(Map<String, dynamic> json) => TopRight(
|
||||
image: json['image'] as String?,
|
||||
text: json['text'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'image': image,
|
||||
'text': text,
|
||||
};
|
||||
}
|
||||
23
lib/models/live/live_emoticons/top_show.dart
Normal file
23
lib/models/live/live_emoticons/top_show.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'top_left.dart';
|
||||
import 'top_right.dart';
|
||||
|
||||
class TopShow {
|
||||
TopLeft? topLeft;
|
||||
TopRight? topRight;
|
||||
|
||||
TopShow({this.topLeft, this.topRight});
|
||||
|
||||
factory TopShow.fromJson(Map<String, dynamic> json) => TopShow(
|
||||
topLeft: json['top_left'] == null
|
||||
? null
|
||||
: TopLeft.fromJson(json['top_left'] as Map<String, dynamic>),
|
||||
topRight: json['top_right'] == null
|
||||
? null
|
||||
: TopRight.fromJson(json['top_right'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'top_left': topLeft?.toJson(),
|
||||
'top_right': topRight?.toJson(),
|
||||
};
|
||||
}
|
||||
23
lib/models/live/live_emoticons/top_show_recent.dart
Normal file
23
lib/models/live/live_emoticons/top_show_recent.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'top_left.dart';
|
||||
import 'top_right.dart';
|
||||
|
||||
class TopShowRecent {
|
||||
TopLeft? topLeft;
|
||||
TopRight? topRight;
|
||||
|
||||
TopShowRecent({this.topLeft, this.topRight});
|
||||
|
||||
factory TopShowRecent.fromJson(Map<String, dynamic> json) => TopShowRecent(
|
||||
topLeft: json['top_left'] == null
|
||||
? null
|
||||
: TopLeft.fromJson(json['top_left'] as Map<String, dynamic>),
|
||||
topRight: json['top_right'] == null
|
||||
? null
|
||||
: TopRight.fromJson(json['top_right'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'top_left': topLeft?.toJson(),
|
||||
'top_right': topRight?.toJson(),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user