mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-14 22:50:06 +08:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d508e0822e | ||
|
|
6147df2030 | ||
|
|
b990f9cf87 | ||
|
|
0fb01f1b7c | ||
|
|
91fe0492c1 | ||
|
|
19bbdaac65 | ||
|
|
1462e6ecf1 | ||
|
|
3364b52e33 | ||
|
|
4ac05caa28 | ||
|
|
132a7e15de | ||
|
|
c2c8a5166b | ||
|
|
a260b1640a | ||
|
|
3031d5e3b0 | ||
|
|
5f2e863cc2 | ||
|
|
9a63e23478 | ||
|
|
c9450992d9 | ||
|
|
8aeb035e55 | ||
|
|
924d51d41b | ||
|
|
b643cb1bd0 | ||
|
|
1f77ee178e | ||
|
|
6d599891dc | ||
|
|
4e9fdfbfbd | ||
|
|
d4ac9ab79a |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -135,4 +135,6 @@ app.*.symbols
|
||||
!/dev/ci/**/Gemfile.lock
|
||||
!.vscode/settings.json
|
||||
|
||||
/lib/build_config.dart
|
||||
/lib/build_config.dart
|
||||
|
||||
devtools_options.yaml
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
|
||||
# The following line activates a set of recommended lints for Flutter apps,
|
||||
# packages, and plugins designed to encourage good coding practices.
|
||||
analyzer:
|
||||
errors:
|
||||
strict_top_level_inference: ignore
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
|
||||
linter:
|
||||
|
||||
@@ -59,8 +59,13 @@ class PBadge extends StatelessWidget {
|
||||
bgColor = Colors.black45;
|
||||
color = Colors.white;
|
||||
case PBadgeType.error:
|
||||
bgColor = theme.error;
|
||||
color = theme.onError;
|
||||
if (Get.isDarkMode) {
|
||||
bgColor = theme.errorContainer;
|
||||
color = theme.onErrorContainer;
|
||||
} else {
|
||||
bgColor = theme.error;
|
||||
color = theme.onError;
|
||||
}
|
||||
case PBadgeType.line_primary:
|
||||
color = theme.primary;
|
||||
bgColor = Colors.transparent;
|
||||
|
||||
@@ -83,7 +83,7 @@ class _MemberReportPanelState extends State<MemberReportPanel> {
|
||||
SmartDialog.showToast('至少选择一项作为举报内容');
|
||||
} else {
|
||||
Get.back();
|
||||
dynamic result = await MemberHttp.reportMember(
|
||||
var result = await MemberHttp.reportMember(
|
||||
widget.mid,
|
||||
reason: _reason.join(','),
|
||||
reasonV2: _reasonV2 != null ? _reasonV2! + 1 : null,
|
||||
|
||||
@@ -42,7 +42,7 @@ class NetworkImgLayer extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return src.isNullOrEmpty.not
|
||||
return src?.isNotEmpty == true
|
||||
? type == ImageType.avatar
|
||||
? ClipOval(child: _buildImage(context))
|
||||
: radius == 0 || type == ImageType.emote
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -295,11 +296,13 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
final item = widget.sources[index];
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: onClose,
|
||||
onTap: () => EasyThrottle.throttle(
|
||||
'preview', const Duration(milliseconds: 555), onClose),
|
||||
onDoubleTapDown: (TapDownDetails details) {
|
||||
_doubleTapLocalPosition = details.localPosition;
|
||||
},
|
||||
onDoubleTap: onDoubleTap,
|
||||
onDoubleTap: () => EasyThrottle.throttle(
|
||||
'preview', const Duration(milliseconds: 555), onDoubleTap),
|
||||
onLongPress: item.sourceType == SourceType.fileImage
|
||||
? null
|
||||
: () => onLongPress(item),
|
||||
@@ -500,14 +503,14 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
contentPadding: const EdgeInsets.fromLTRB(0, 12, 0, 12),
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ListTile(
|
||||
onTap: () {
|
||||
DownloadUtils.onShareImg(item.url);
|
||||
Get.back();
|
||||
DownloadUtils.onShareImg(item.url);
|
||||
},
|
||||
dense: true,
|
||||
title: const Text('分享', style: TextStyle(fontSize: 14)),
|
||||
|
||||
@@ -45,8 +45,8 @@ class VideoCardH extends StatelessWidget {
|
||||
final int aid = videoItem.aid!;
|
||||
final String bvid = videoItem.bvid!;
|
||||
String type = 'video';
|
||||
if (videoItem is SearchVideoItemModel) {
|
||||
var typeOrNull = (videoItem as SearchVideoItemModel).type;
|
||||
if (videoItem case SearchVideoItemModel item) {
|
||||
var typeOrNull = item.type;
|
||||
if (typeOrNull?.isNotEmpty == true) {
|
||||
type = typeOrNull!;
|
||||
}
|
||||
@@ -60,62 +60,54 @@ class VideoCardH extends StatelessWidget {
|
||||
label: Utils.videoItemSemantics(videoItem),
|
||||
excludeSemantics: true,
|
||||
child: InkWell(
|
||||
onLongPress: () {
|
||||
if (onLongPress != null) {
|
||||
onLongPress!();
|
||||
} else {
|
||||
imageSaveDialog(
|
||||
title: videoItem.title,
|
||||
cover: videoItem.pic,
|
||||
);
|
||||
}
|
||||
},
|
||||
onTap: () async {
|
||||
if (onTap != null) {
|
||||
onTap!();
|
||||
return;
|
||||
}
|
||||
if (type == 'ketang') {
|
||||
SmartDialog.showToast('课堂视频暂不支持播放');
|
||||
return;
|
||||
} else if (type == 'live_room') {
|
||||
if (videoItem is SearchVideoItemModel) {
|
||||
int? roomId = (videoItem as SearchVideoItemModel).id;
|
||||
if (roomId != null) {
|
||||
Get.toNamed('/liveRoom?roomid=$roomId');
|
||||
onLongPress: onLongPress ??
|
||||
() => imageSaveDialog(
|
||||
title: videoItem.title,
|
||||
cover: videoItem.pic,
|
||||
),
|
||||
onTap: onTap ??
|
||||
() async {
|
||||
if (type == 'ketang') {
|
||||
SmartDialog.showToast('课堂视频暂不支持播放');
|
||||
return;
|
||||
} else if (type == 'live_room') {
|
||||
if (videoItem case SearchVideoItemModel item) {
|
||||
int? roomId = item.id;
|
||||
if (roomId != null) {
|
||||
Get.toNamed('/liveRoom?roomid=$roomId');
|
||||
}
|
||||
} else {
|
||||
SmartDialog.showToast(
|
||||
'err: live_room : ${videoItem.runtimeType}');
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
SmartDialog.showToast(
|
||||
'err: live_room : ${videoItem.runtimeType}');
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ((videoItem is HotVideoItemModel) &&
|
||||
(videoItem as HotVideoItemModel).redirectUrl?.isNotEmpty ==
|
||||
true) {
|
||||
if (PageUtils.viewPgcFromUri(
|
||||
(videoItem as HotVideoItemModel).redirectUrl!)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
try {
|
||||
final int cid = videoItem.cid ??
|
||||
await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
||||
if (source == 'later') {
|
||||
onViewLater!(cid);
|
||||
} else {
|
||||
PageUtils.toVideoPage(
|
||||
'bvid=$bvid&cid=$cid',
|
||||
arguments: {
|
||||
'videoItem': videoItem,
|
||||
'heroTag': Utils.makeHeroTag(aid)
|
||||
},
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
SmartDialog.showToast(err.toString());
|
||||
}
|
||||
},
|
||||
if (videoItem case HotVideoItemModel item) {
|
||||
if (item.redirectUrl?.isNotEmpty == true &&
|
||||
PageUtils.viewPgcFromUri(item.redirectUrl!)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
try {
|
||||
final int? cid = videoItem.cid ??
|
||||
await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
||||
if (cid != null) {
|
||||
if (source == 'later') {
|
||||
onViewLater!(cid);
|
||||
} else {
|
||||
PageUtils.toVideoPage(
|
||||
'bvid=$bvid&cid=$cid',
|
||||
arguments: {
|
||||
'videoItem': videoItem,
|
||||
'heroTag': Utils.makeHeroTag(aid)
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
SmartDialog.showToast(err.toString());
|
||||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: StyleString.safeSpace,
|
||||
@@ -132,9 +124,8 @@ class VideoCardH extends StatelessWidget {
|
||||
final double maxWidth = boxConstraints.maxWidth;
|
||||
final double maxHeight = boxConstraints.maxHeight;
|
||||
num? progress;
|
||||
if (videoItem is HotVideoItemModel) {
|
||||
progress =
|
||||
(videoItem as HotVideoItemModel).progress;
|
||||
if (videoItem case HotVideoItemModel item) {
|
||||
progress = item.progress;
|
||||
}
|
||||
|
||||
return Stack(
|
||||
@@ -145,10 +136,9 @@ class VideoCardH extends StatelessWidget {
|
||||
width: maxWidth,
|
||||
height: maxHeight,
|
||||
),
|
||||
if (videoItem is HotVideoItemModel)
|
||||
if (videoItem case HotVideoItemModel item)
|
||||
PBadge(
|
||||
text:
|
||||
(videoItem as HotVideoItemModel).pgcLabel,
|
||||
text: item.pgcLabel,
|
||||
top: 6.0,
|
||||
right: 6.0,
|
||||
),
|
||||
@@ -222,32 +212,31 @@ class VideoCardH extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if ((videoItem is SearchVideoItemModel) &&
|
||||
(videoItem as SearchVideoItemModel).titleList?.isNotEmpty == true)
|
||||
Expanded(
|
||||
child: Text.rich(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 2,
|
||||
TextSpan(
|
||||
children: [
|
||||
for (var i
|
||||
in (videoItem as SearchVideoItemModel).titleList!)
|
||||
TextSpan(
|
||||
text: i['text'],
|
||||
style: TextStyle(
|
||||
fontSize: theme.textTheme.bodyMedium!.fontSize,
|
||||
height: 1.42,
|
||||
letterSpacing: 0.3,
|
||||
color: i['type'] == 'em'
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.onSurface,
|
||||
if (videoItem case SearchVideoItemModel item) ...[
|
||||
if (item.titleList?.isNotEmpty == true)
|
||||
Expanded(
|
||||
child: Text.rich(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 2,
|
||||
TextSpan(
|
||||
children: [
|
||||
for (var i in item.titleList!)
|
||||
TextSpan(
|
||||
text: i['text'],
|
||||
style: TextStyle(
|
||||
fontSize: theme.textTheme.bodyMedium!.fontSize,
|
||||
height: 1.42,
|
||||
letterSpacing: 0.3,
|
||||
color: i['type'] == 'em'
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
else
|
||||
)
|
||||
] else
|
||||
Expanded(
|
||||
child: Text(
|
||||
videoItem.title,
|
||||
|
||||
@@ -37,30 +37,28 @@ class VideoCardHMemberVideo extends StatelessWidget {
|
||||
title: videoItem.title,
|
||||
cover: videoItem.cover,
|
||||
),
|
||||
onTap: () async {
|
||||
if (onTap != null) {
|
||||
onTap!();
|
||||
return;
|
||||
}
|
||||
if (videoItem.isPgc == true && videoItem.uri?.isNotEmpty == true) {
|
||||
if (PageUtils.viewPgcFromUri(videoItem.uri!)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (videoItem.bvid == null || videoItem.cid == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
PageUtils.toVideoPage(
|
||||
'bvid=${videoItem.bvid}&cid=${videoItem.cid}',
|
||||
arguments: {
|
||||
'heroTag': Utils.makeHeroTag(videoItem.bvid),
|
||||
},
|
||||
);
|
||||
} catch (err) {
|
||||
SmartDialog.showToast(err.toString());
|
||||
}
|
||||
},
|
||||
onTap: onTap ??
|
||||
() async {
|
||||
if (videoItem.isPgc == true &&
|
||||
videoItem.uri?.isNotEmpty == true) {
|
||||
if (PageUtils.viewPgcFromUri(videoItem.uri!)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (videoItem.bvid == null || videoItem.cid == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
PageUtils.toVideoPage(
|
||||
'bvid=${videoItem.bvid}&cid=${videoItem.cid}',
|
||||
arguments: {
|
||||
'heroTag': Utils.makeHeroTag(videoItem.bvid),
|
||||
},
|
||||
);
|
||||
} catch (err) {
|
||||
SmartDialog.showToast(err.toString());
|
||||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: StyleString.safeSpace,
|
||||
|
||||
@@ -72,9 +72,8 @@ class VideoCustomActions {
|
||||
SmartDialog.showToast("请退出账号后重新登录");
|
||||
return;
|
||||
}
|
||||
if (videoItem is RecVideoItemAppModel) {
|
||||
RecVideoItemAppModel v = videoItem as RecVideoItemAppModel;
|
||||
ThreePoint? tp = v.threePoint;
|
||||
if (videoItem case RecVideoItemAppModel item) {
|
||||
ThreePoint? tp = item.threePoint;
|
||||
if (tp == null) {
|
||||
SmartDialog.showToast("未能获取threePoint");
|
||||
return;
|
||||
@@ -92,8 +91,8 @@ class VideoCustomActions {
|
||||
var res = await VideoHttp.feedDislike(
|
||||
reasonId: r?.id,
|
||||
feedbackId: f?.id,
|
||||
id: v.param!,
|
||||
goto: v.goto!,
|
||||
id: item.param!,
|
||||
goto: item.goto!,
|
||||
);
|
||||
SmartDialog.dismiss();
|
||||
SmartDialog.showToast(
|
||||
@@ -143,8 +142,8 @@ class VideoCustomActions {
|
||||
onPressed: () async {
|
||||
SmartDialog.showLoading(msg: '正在提交');
|
||||
var res = await VideoHttp.feedDislikeCancel(
|
||||
id: v.param!,
|
||||
goto: v.goto!,
|
||||
id: item.param!,
|
||||
goto: item.goto!,
|
||||
);
|
||||
SmartDialog.dismiss();
|
||||
SmartDialog.showToast(
|
||||
@@ -183,8 +182,7 @@ class VideoCustomActions {
|
||||
Get.back();
|
||||
SmartDialog.showLoading(msg: '正在提交');
|
||||
var res = await VideoHttp.dislikeVideo(
|
||||
bvid: videoItem.bvid as String,
|
||||
type: true);
|
||||
bvid: videoItem.bvid!, type: true);
|
||||
SmartDialog.dismiss();
|
||||
SmartDialog.showToast(
|
||||
res['status'] ? "点踩成功" : res['msg'],
|
||||
@@ -203,8 +201,7 @@ class VideoCustomActions {
|
||||
Get.back();
|
||||
SmartDialog.showLoading(msg: '正在提交');
|
||||
var res = await VideoHttp.dislikeVideo(
|
||||
bvid: videoItem.bvid as String,
|
||||
type: false);
|
||||
bvid: videoItem.bvid!, type: false);
|
||||
SmartDialog.dismiss();
|
||||
SmartDialog.showToast(
|
||||
res['status'] ? "取消踩" : res['msg']);
|
||||
|
||||
@@ -24,7 +24,7 @@ class Api {
|
||||
|
||||
// 字幕
|
||||
// aid, cid
|
||||
static const String subtitleUrl = '/x/player/wbi/v2';
|
||||
static const String playInfo = '/x/player/wbi/v2';
|
||||
|
||||
// 视频详情
|
||||
// 竖屏 https://api.bilibili.com/x/web-interface/view?aid=527403921
|
||||
|
||||
@@ -19,7 +19,7 @@ class BangumiHttp {
|
||||
type,
|
||||
indexType,
|
||||
}) async {
|
||||
dynamic res = await Request().get(
|
||||
var res = await Request().get(
|
||||
Api.pgcIndexResult,
|
||||
queryParameters: {
|
||||
...params,
|
||||
@@ -42,7 +42,7 @@ class BangumiHttp {
|
||||
type,
|
||||
indexType,
|
||||
}) async {
|
||||
dynamic res = await Request().get(
|
||||
var res = await Request().get(
|
||||
Api.pgcIndexCondition,
|
||||
queryParameters: {
|
||||
if (seasonType != null) 'season_type': seasonType,
|
||||
|
||||
@@ -3,9 +3,11 @@ import 'package:PiliPlus/http/api.dart';
|
||||
import 'package:PiliPlus/http/constants.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/article_info/data.dart';
|
||||
import 'package:PiliPlus/models/common/dynamic/dynamics_type.dart';
|
||||
import 'package:PiliPlus/models/common/reply/reply_option_type.dart';
|
||||
import 'package:PiliPlus/models/dynamics/article_list/data.dart';
|
||||
import 'package:PiliPlus/models/dynamics/dyn_reserve/data.dart';
|
||||
import 'package:PiliPlus/models/dynamics/dyn_topic_feed/topic_card_list.dart';
|
||||
import 'package:PiliPlus/models/dynamics/dyn_topic_top/top_details.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
@@ -300,7 +302,10 @@ class DynamicsHttp {
|
||||
}),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': res.data['data']};
|
||||
return {
|
||||
'status': true,
|
||||
'data': ArticleInfoData.fromJson(res.data['data'])
|
||||
};
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
@@ -459,7 +464,10 @@ class DynamicsHttp {
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': res.data['data']};
|
||||
return {
|
||||
'status': true,
|
||||
'data': DynReserveData.fromJson(res.data['data'])
|
||||
};
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
|
||||
@@ -136,11 +136,12 @@ class LiveHttp {
|
||||
}
|
||||
|
||||
static Future liveRoomDanmaPrefetch({roomId}) async {
|
||||
var res = await Request().get(Api.liveRoomDmPrefetch, queryParameters: {
|
||||
'roomid': roomId,
|
||||
});
|
||||
var res = await Request().get(
|
||||
Api.liveRoomDmPrefetch,
|
||||
queryParameters: {'roomid': roomId},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': res.data['data']['room']};
|
||||
return {'status': true, 'data': res.data['data']?['room']};
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
|
||||
@@ -478,7 +478,7 @@ class LoginHttp {
|
||||
}
|
||||
|
||||
static Future<Map> logout(Account account) async {
|
||||
dynamic res = await Request().post(
|
||||
var res = await Request().post(
|
||||
Api.logout,
|
||||
data: {'biliCSRF': account.csrf},
|
||||
options: Options(
|
||||
|
||||
@@ -66,7 +66,7 @@ class MemberHttp {
|
||||
'statistics': Constants.statisticsApp,
|
||||
'vmid': mid.toString(),
|
||||
};
|
||||
dynamic res = await Request().get(
|
||||
var res = await Request().get(
|
||||
Api.spaceArticle,
|
||||
queryParameters: data,
|
||||
options: Options(
|
||||
@@ -96,7 +96,7 @@ class MemberHttp {
|
||||
'statistics': Constants.statisticsApp,
|
||||
'up_mid': mid.toString(),
|
||||
};
|
||||
dynamic res = await Request().get(
|
||||
var res = await Request().get(
|
||||
Api.spaceFav,
|
||||
queryParameters: data,
|
||||
options: Options(
|
||||
@@ -117,7 +117,7 @@ class MemberHttp {
|
||||
required int? mid,
|
||||
required int pn,
|
||||
}) async {
|
||||
dynamic res = await Request().get(
|
||||
var res = await Request().get(
|
||||
Api.seasonSeries,
|
||||
queryParameters: {
|
||||
'mid': mid,
|
||||
@@ -165,7 +165,7 @@ class MemberHttp {
|
||||
'statistics': Constants.statisticsApp,
|
||||
'vmid': mid.toString(),
|
||||
};
|
||||
dynamic res = await Request().get(
|
||||
var res = await Request().get(
|
||||
switch (type) {
|
||||
ContributeType.video => Api.spaceArchive,
|
||||
ContributeType.charging => Api.spaceChargingArchive,
|
||||
@@ -213,7 +213,7 @@ class MemberHttp {
|
||||
'statistics': Constants.statisticsApp,
|
||||
'vmid': mid.toString(),
|
||||
};
|
||||
dynamic res = await Request().get(
|
||||
var res = await Request().get(
|
||||
Api.spaceStory,
|
||||
queryParameters: data,
|
||||
options: Options(
|
||||
@@ -245,7 +245,7 @@ class MemberHttp {
|
||||
'statistics': Constants.statisticsApp,
|
||||
'vmid': mid.toString(),
|
||||
};
|
||||
dynamic res = await Request().get(
|
||||
var res = await Request().get(
|
||||
Api.space,
|
||||
queryParameters: data,
|
||||
options: Options(
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:PiliPlus/http/api.dart';
|
||||
import 'package:PiliPlus/http/constants.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/bfs_res/data.dart';
|
||||
import 'package:PiliPlus/models/msg/account.dart';
|
||||
import 'package:PiliPlus/models/msg/im_user_infos/datum.dart';
|
||||
import 'package:PiliPlus/models/msg/msg_dnd/uid_setting.dart';
|
||||
@@ -151,7 +152,7 @@ class MsgHttp {
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
'status': true,
|
||||
'data': res.data['data']..['img_size'] = file.length,
|
||||
'data': BfsResData.fromJson(res.data['data']),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
|
||||
@@ -6,18 +6,16 @@ import 'package:PiliPlus/models/video/reply/data.dart';
|
||||
import 'package:PiliPlus/models/video/reply/emote.dart';
|
||||
import 'package:PiliPlus/models/video/reply/item.dart';
|
||||
import 'package:PiliPlus/utils/accounts/account.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
class ReplyHttp {
|
||||
static Options get _options =>
|
||||
Options(extra: {'account': AnonymousAccount()});
|
||||
static final Options _options =
|
||||
Options(extra: {'account': AnonymousAccount(), 'checkReply': true});
|
||||
|
||||
static RegExp replyRegExp =
|
||||
RegExp(GStorage.banWordForReply, caseSensitive: false);
|
||||
|
||||
@Deprecated('Use replyListGrpc instead')
|
||||
static Future<LoadingState> replyList({
|
||||
required bool isLogin,
|
||||
required int oid,
|
||||
@@ -38,7 +36,7 @@ class ReplyHttp {
|
||||
'{"offset":"${nextOffset.replaceAll('"', '\\"')}"}',
|
||||
'mode': sort + 2, //2:按时间排序;3:按热度排序
|
||||
},
|
||||
options: isLogin.not ? _options : null,
|
||||
options: !isLogin ? _options : null,
|
||||
)
|
||||
: await Request().get(
|
||||
Api.replyList,
|
||||
@@ -49,7 +47,7 @@ class ReplyHttp {
|
||||
'pn': page,
|
||||
'ps': 20,
|
||||
},
|
||||
options: isLogin.not ? _options : null,
|
||||
options: !isLogin ? _options : null,
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
ReplyData replyData = ReplyData.fromJson(res.data['data']);
|
||||
@@ -59,7 +57,7 @@ class ReplyHttp {
|
||||
replyData.topReplies!.removeWhere((item) {
|
||||
bool hasMatch = replyRegExp.hasMatch(item.content?.message ?? '');
|
||||
// remove subreplies
|
||||
if (hasMatch.not) {
|
||||
if (!hasMatch) {
|
||||
if (item.replies?.isNotEmpty == true) {
|
||||
item.replies!.removeWhere((item) =>
|
||||
replyRegExp.hasMatch(item.content?.message ?? ''));
|
||||
@@ -74,7 +72,7 @@ class ReplyHttp {
|
||||
replyData.replies!.removeWhere((item) {
|
||||
bool hasMatch = replyRegExp.hasMatch(item.content?.message ?? '');
|
||||
// remove subreplies
|
||||
if (hasMatch.not) {
|
||||
if (!hasMatch) {
|
||||
if (item.replies?.isNotEmpty == true) {
|
||||
item.replies!.removeWhere((item) =>
|
||||
replyRegExp.hasMatch(item.content?.message ?? ''));
|
||||
@@ -92,7 +90,7 @@ class ReplyHttp {
|
||||
replyData.topReplies!.removeWhere((item) {
|
||||
bool hasMatch = needRemove(item);
|
||||
// remove subreplies
|
||||
if (hasMatch.not) {
|
||||
if (!hasMatch) {
|
||||
if (item.replies?.isNotEmpty == true) {
|
||||
item.replies!.removeWhere(needRemove);
|
||||
}
|
||||
@@ -106,7 +104,7 @@ class ReplyHttp {
|
||||
replyData.replies!.removeWhere((item) {
|
||||
bool hasMatch = needRemove(item);
|
||||
// remove subreplies
|
||||
if (hasMatch.not) {
|
||||
if (!hasMatch) {
|
||||
if (item.replies?.isNotEmpty == true) {
|
||||
item.replies!.removeWhere(needRemove);
|
||||
}
|
||||
@@ -137,7 +135,6 @@ class ReplyHttp {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Deprecated('Use replyReplyListGrpc instead')
|
||||
static Future<LoadingState<ReplyReplyData>> replyReplyList({
|
||||
required bool isLogin,
|
||||
required int oid,
|
||||
@@ -158,7 +155,7 @@ class ReplyHttp {
|
||||
'sort': 1,
|
||||
if (isLogin) 'csrf': Accounts.main.csrf,
|
||||
},
|
||||
options: isLogin.not ? _options : null,
|
||||
options: !isLogin ? _options : null,
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
ReplyReplyData replyData = ReplyReplyData.fromJson(res.data['data']);
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:PiliPlus/http/api.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/common/search_type.dart';
|
||||
import 'package:PiliPlus/models/pgc/info.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/result.dart';
|
||||
import 'package:PiliPlus/models/search/result.dart';
|
||||
import 'package:PiliPlus/models/search/search_trending/trending_data.dart';
|
||||
import 'package:PiliPlus/models/search/suggest.dart';
|
||||
@@ -159,28 +159,31 @@ class SearchHttp {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<int> ab2c({dynamic aid, dynamic bvid, int? part}) async {
|
||||
Map<String, dynamic> data = {};
|
||||
if (aid != null) {
|
||||
data['aid'] = aid;
|
||||
} else if (bvid != null) {
|
||||
data['bvid'] = bvid;
|
||||
}
|
||||
final dynamic res = await Request().get(Api.ab2c, queryParameters: data);
|
||||
static Future<int?> ab2c({dynamic aid, dynamic bvid, int? part}) async {
|
||||
var res = await Request().get(
|
||||
Api.ab2c,
|
||||
queryParameters: {
|
||||
if (aid != null) 'aid': aid,
|
||||
if (bvid != null) 'bvid': bvid,
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return part != null
|
||||
? ((res.data['data'] as List).getOrNull(part - 1)?['cid'] ??
|
||||
res.data['data'].first['cid'])
|
||||
: res.data['data'].first['cid'];
|
||||
if (res.data['data'] case List list) {
|
||||
return part != null
|
||||
? (list.getOrNull(part - 1)?['cid'] ?? list.firstOrNull?['cid'])
|
||||
: list.firstOrNull?['cid'];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
SmartDialog.showToast("ab2c error: ${res.data['message']}");
|
||||
return -1;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<BangumiInfoModel>> bangumiInfoNew(
|
||||
{int? seasonId, int? epId}) async {
|
||||
final dynamic res = await Request().get(
|
||||
var res = await Request().get(
|
||||
Api.bangumiInfo,
|
||||
queryParameters: {
|
||||
if (seasonId != null) 'season_id': seasonId,
|
||||
@@ -195,7 +198,7 @@ class SearchHttp {
|
||||
}
|
||||
|
||||
static Future<LoadingState> episodeInfo({int? epId}) async {
|
||||
final dynamic res = await Request().get(
|
||||
var res = await Request().get(
|
||||
Api.episodeInfo,
|
||||
queryParameters: {
|
||||
if (epId != null) 'ep_id': epId,
|
||||
@@ -212,15 +215,13 @@ class SearchHttp {
|
||||
dynamic seasonId,
|
||||
dynamic epId,
|
||||
}) async {
|
||||
final Map<String, dynamic> data = {};
|
||||
if (seasonId != null) {
|
||||
data['season_id'] = seasonId;
|
||||
} else if (epId != null) {
|
||||
data['ep_id'] = epId;
|
||||
}
|
||||
final dynamic res =
|
||||
await Request().get(Api.bangumiInfo, queryParameters: data);
|
||||
|
||||
var res = await Request().get(
|
||||
Api.bangumiInfo,
|
||||
queryParameters: {
|
||||
if (seasonId != null) 'season_id': seasonId,
|
||||
if (epId != null) 'ep_id': epId,
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
'status': true,
|
||||
|
||||
@@ -3,6 +3,8 @@ import 'package:PiliPlus/http/api.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/fav_article/data.dart';
|
||||
import 'package:PiliPlus/models/folder_info/data.dart';
|
||||
import 'package:PiliPlus/models/media_list/data.dart';
|
||||
import 'package:PiliPlus/models/model_hot_video_item.dart';
|
||||
import 'package:PiliPlus/models/user/fav_detail.dart';
|
||||
import 'package:PiliPlus/models/user/fav_folder.dart';
|
||||
@@ -12,7 +14,6 @@ import 'package:PiliPlus/models/user/info.dart';
|
||||
import 'package:PiliPlus/models/user/stat.dart';
|
||||
import 'package:PiliPlus/models/user/sub_detail.dart';
|
||||
import 'package:PiliPlus/models/user/sub_folder.dart';
|
||||
import 'package:PiliPlus/models/video/later.dart';
|
||||
import 'package:PiliPlus/models/video_tag/data.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
@@ -189,11 +190,14 @@ class UserHttp {
|
||||
static Future folderInfo({
|
||||
dynamic mediaId,
|
||||
}) async {
|
||||
var res = await Request().get(Api.folderInfo, queryParameters: {
|
||||
'media_id': mediaId,
|
||||
});
|
||||
var res = await Request().get(
|
||||
Api.folderInfo,
|
||||
queryParameters: {
|
||||
'media_id': mediaId,
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': res.data['data']};
|
||||
return {'status': true, 'data': FolderInfo.fromJson(res.data['data'])};
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
@@ -254,7 +258,7 @@ class UserHttp {
|
||||
}
|
||||
return Success({
|
||||
'list': list,
|
||||
'count': res.data['data']['count'],
|
||||
'count': res.data['data']?['count'] ?? 0,
|
||||
});
|
||||
} else {
|
||||
return Error(res.data['message']);
|
||||
@@ -341,7 +345,7 @@ class UserHttp {
|
||||
'csrf': Accounts.main.csrf,
|
||||
'resources': aids.join(',')
|
||||
};
|
||||
dynamic res = await Request().post(
|
||||
var res = await Request().post(
|
||||
Api.toViewDel,
|
||||
data: params,
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType),
|
||||
@@ -651,7 +655,7 @@ class UserHttp {
|
||||
|
||||
// 取消订阅
|
||||
static Future cancelSub({required int id, required int type}) async {
|
||||
late dynamic res;
|
||||
late Response res;
|
||||
if (type == 11) {
|
||||
res = await Request().post(
|
||||
Api.unfavFolder,
|
||||
@@ -719,15 +723,7 @@ class UserHttp {
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
'status': true,
|
||||
'data': res.data['data']['media_list'] != null
|
||||
? res.data['data']['media_list']
|
||||
.map<MediaVideoItemModel>(
|
||||
(e) => MediaVideoItemModel.fromJson(e))
|
||||
.toList()
|
||||
: <MediaVideoItemModel>[]
|
||||
};
|
||||
return {'status': true, 'data': MediaListData.fromJson(res.data['data'])};
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
|
||||
@@ -12,11 +12,16 @@ import 'package:PiliPlus/models/member/article.dart';
|
||||
import 'package:PiliPlus/models/model_hot_video_item.dart';
|
||||
import 'package:PiliPlus/models/model_rec_video_item.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_rank/pgc_rank_item_model.dart';
|
||||
import 'package:PiliPlus/models/pgc_lcf.dart';
|
||||
import 'package:PiliPlus/models/play_info/data.dart';
|
||||
import 'package:PiliPlus/models/triple/pgc_triple.dart';
|
||||
import 'package:PiliPlus/models/triple/ugc_triple.dart';
|
||||
import 'package:PiliPlus/models/user/fav_folder.dart';
|
||||
import 'package:PiliPlus/models/video/ai.dart';
|
||||
import 'package:PiliPlus/models/video/note_list/data.dart';
|
||||
import 'package:PiliPlus/models/video/play/url.dart';
|
||||
import 'package:PiliPlus/models/video_detail_res.dart';
|
||||
import 'package:PiliPlus/models/video_detail/video_detail_response.dart';
|
||||
import 'package:PiliPlus/models/video_relation/data.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
import 'package:PiliPlus/utils/recommend_filter.dart';
|
||||
@@ -226,7 +231,7 @@ class VideoHttp {
|
||||
'data': data,
|
||||
};
|
||||
} else {
|
||||
if (epid != null && usePgcApi.not && forcePgcApi != true) {
|
||||
if (epid != null && !usePgcApi && forcePgcApi != true) {
|
||||
return videoUrl(
|
||||
avid: avid,
|
||||
bvid: bvid,
|
||||
@@ -314,7 +319,7 @@ class VideoHttp {
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
'status': true,
|
||||
'data': res.data['data'],
|
||||
'data': VideoRelation.fromJson(res.data['data']),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
@@ -348,7 +353,7 @@ class VideoHttp {
|
||||
queryParameters: {'ep_id': epId},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': res.data['data']};
|
||||
return {'status': true, 'data': PgcLCF.fromJson(res.data['data'])};
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
@@ -396,7 +401,7 @@ class VideoHttp {
|
||||
),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': res.data['data']};
|
||||
return {'status': true, 'data': PgcTriple.fromJson(res.data['data'])};
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
@@ -424,7 +429,7 @@ class VideoHttp {
|
||||
),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': res.data['data']};
|
||||
return {'status': true, 'data': UgcTriple.fromJson(res.data['data'])};
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
@@ -892,11 +897,10 @@ class VideoHttp {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> subtitlesJson(
|
||||
{String? aid, String? bvid, required int cid}) async {
|
||||
static Future playInfo({String? aid, String? bvid, required int cid}) async {
|
||||
assert(aid != null || bvid != null);
|
||||
var res = await Request().get(
|
||||
Api.subtitleUrl,
|
||||
Api.playInfo,
|
||||
queryParameters: {
|
||||
if (aid != null) 'aid': aid,
|
||||
if (bvid != null) 'bvid': bvid,
|
||||
@@ -904,20 +908,16 @@ class VideoHttp {
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
dynamic data = res.data['data'];
|
||||
return {
|
||||
'status': true,
|
||||
'subtitles': data['subtitle']?['subtitles'],
|
||||
'view_points': data['view_points'],
|
||||
'last_play_cid': data['last_play_cid'],
|
||||
'interaction': data['interaction'],
|
||||
'data': PlayInfoData.fromJson(res.data['data']),
|
||||
};
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
}
|
||||
|
||||
static Future vttSubtitles(Map<String, dynamic> subtile) async {
|
||||
static Future vttSubtitles(String subtitleUrl) async {
|
||||
String subtitleTimecode(num seconds) {
|
||||
int h = seconds ~/ 3600;
|
||||
seconds %= 3600;
|
||||
@@ -938,7 +938,7 @@ class VideoHttp {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
var res = await Request().get("https:${subtile['subtitle_url']}");
|
||||
var res = await Request().get("https:$subtitleUrl");
|
||||
|
||||
if (res.data?['body'] is List) {
|
||||
return await compute(processList, res.data['body'] as List);
|
||||
|
||||
@@ -129,7 +129,7 @@ class MyApp extends StatelessWidget {
|
||||
// 主题色
|
||||
Color defaultColor =
|
||||
colorThemeTypes[setting.get(SettingBoxKey.customColor, defaultValue: 0)]
|
||||
['color'];
|
||||
.color;
|
||||
Color brandColor = defaultColor;
|
||||
// 是否动态取色
|
||||
bool isDynamicColor =
|
||||
|
||||
85
lib/models/article_info/data.dart
Normal file
85
lib/models/article_info/data.dart
Normal file
@@ -0,0 +1,85 @@
|
||||
import 'package:PiliPlus/models/article_info/share_channel.dart';
|
||||
import 'package:PiliPlus/models/article_info/stats.dart';
|
||||
|
||||
class ArticleInfoData {
|
||||
int? like;
|
||||
bool? attention;
|
||||
bool? favorite;
|
||||
int? coin;
|
||||
Stats? stats;
|
||||
String? title;
|
||||
String? bannerUrl;
|
||||
int? mid;
|
||||
String? authorName;
|
||||
bool? isAuthor;
|
||||
List? imageUrls;
|
||||
List? originImageUrls;
|
||||
bool? shareable;
|
||||
bool? showLaterWatch;
|
||||
bool? showSmallWindow;
|
||||
bool? inList;
|
||||
int? pre;
|
||||
int? next;
|
||||
List<ShareChannel>? shareChannels;
|
||||
int? type;
|
||||
String? videoUrl;
|
||||
String? location;
|
||||
bool? disableShare;
|
||||
|
||||
ArticleInfoData({
|
||||
this.like,
|
||||
this.attention,
|
||||
this.favorite,
|
||||
this.coin,
|
||||
this.stats,
|
||||
this.title,
|
||||
this.bannerUrl,
|
||||
this.mid,
|
||||
this.authorName,
|
||||
this.isAuthor,
|
||||
this.imageUrls,
|
||||
this.originImageUrls,
|
||||
this.shareable,
|
||||
this.showLaterWatch,
|
||||
this.showSmallWindow,
|
||||
this.inList,
|
||||
this.pre,
|
||||
this.next,
|
||||
this.shareChannels,
|
||||
this.type,
|
||||
this.videoUrl,
|
||||
this.location,
|
||||
this.disableShare,
|
||||
});
|
||||
|
||||
factory ArticleInfoData.fromJson(Map<String, dynamic> json) =>
|
||||
ArticleInfoData(
|
||||
like: json['like'] as int?,
|
||||
attention: json['attention'] as bool?,
|
||||
favorite: json['favorite'] as bool?,
|
||||
coin: json['coin'] as int?,
|
||||
stats: json['stats'] == null
|
||||
? null
|
||||
: Stats.fromJson(json['stats'] as Map<String, dynamic>),
|
||||
title: json['title'] as String?,
|
||||
bannerUrl: json['banner_url'] as String?,
|
||||
mid: json['mid'] as int?,
|
||||
authorName: json['author_name'] as String?,
|
||||
isAuthor: json['is_author'] as bool?,
|
||||
imageUrls: json['image_urls'],
|
||||
originImageUrls: json['origin_image_urls'],
|
||||
shareable: json['shareable'] as bool?,
|
||||
showLaterWatch: json['show_later_watch'] as bool?,
|
||||
showSmallWindow: json['show_small_window'] as bool?,
|
||||
inList: json['in_list'] as bool?,
|
||||
pre: json['pre'] as int?,
|
||||
next: json['next'] as int?,
|
||||
shareChannels: (json['share_channels'] as List<dynamic>?)
|
||||
?.map((e) => ShareChannel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
type: json['type'] as int?,
|
||||
videoUrl: json['video_url'] as String?,
|
||||
location: json['location'] as String?,
|
||||
disableShare: json['disable_share'] as bool?,
|
||||
);
|
||||
}
|
||||
13
lib/models/article_info/share_channel.dart
Normal file
13
lib/models/article_info/share_channel.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
class ShareChannel {
|
||||
String? name;
|
||||
String? picture;
|
||||
String? shareChannel;
|
||||
|
||||
ShareChannel({this.name, this.picture, this.shareChannel});
|
||||
|
||||
factory ShareChannel.fromJson(Map<String, dynamic> json) => ShareChannel(
|
||||
name: json['name'] as String?,
|
||||
picture: json['picture'] as String?,
|
||||
shareChannel: json['share_channel'] as String?,
|
||||
);
|
||||
}
|
||||
32
lib/models/article_info/stats.dart
Normal file
32
lib/models/article_info/stats.dart
Normal file
@@ -0,0 +1,32 @@
|
||||
class Stats {
|
||||
int? view;
|
||||
int? favorite;
|
||||
int? like;
|
||||
int? dislike;
|
||||
int? reply;
|
||||
int? share;
|
||||
int? coin;
|
||||
int? dynam1c;
|
||||
|
||||
Stats({
|
||||
this.view,
|
||||
this.favorite,
|
||||
this.like,
|
||||
this.dislike,
|
||||
this.reply,
|
||||
this.share,
|
||||
this.coin,
|
||||
this.dynam1c,
|
||||
});
|
||||
|
||||
factory Stats.fromJson(Map<String, dynamic> json) => Stats(
|
||||
view: json['view'] as int?,
|
||||
favorite: json['favorite'] as int?,
|
||||
like: json['like'] as int?,
|
||||
dislike: json['dislike'] as int?,
|
||||
reply: json['reply'] as int?,
|
||||
share: json['share'] as int?,
|
||||
coin: json['coin'] as int?,
|
||||
dynam1c: json['dynamic'] as int?,
|
||||
);
|
||||
}
|
||||
22
lib/models/bfs_res/data.dart
Normal file
22
lib/models/bfs_res/data.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
class BfsResData {
|
||||
String? imageUrl;
|
||||
int? imageWidth;
|
||||
int? imageHeight;
|
||||
double? imgSize;
|
||||
|
||||
BfsResData({this.imageUrl, this.imageWidth, this.imageHeight, this.imgSize});
|
||||
|
||||
factory BfsResData.fromJson(Map<String, dynamic> json) => BfsResData(
|
||||
imageUrl: json['image_url'] as String?,
|
||||
imageWidth: json['image_width'] as int?,
|
||||
imageHeight: json['image_height'] as int?,
|
||||
imgSize: (json['img_size'] as num?)?.toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'image_url': imageUrl,
|
||||
'image_width': imageWidth,
|
||||
'image_height': imageHeight,
|
||||
'img_size': imgSize,
|
||||
};
|
||||
}
|
||||
@@ -1,23 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
const List<Map<String, dynamic>> colorThemeTypes = [
|
||||
{'color': Color(0xFF5CB67B), 'label': '默认绿'},
|
||||
{'color': Color(0xFFFF7299), 'label': '粉红色'},
|
||||
{'color': Colors.red, 'label': '红色'},
|
||||
{'color': Colors.orange, 'label': '橙色'},
|
||||
{'color': Colors.amber, 'label': '琥珀色'},
|
||||
{'color': Colors.yellow, 'label': '黄色'},
|
||||
{'color': Colors.lime, 'label': '酸橙色'},
|
||||
{'color': Colors.lightGreen, 'label': '浅绿色'},
|
||||
{'color': Colors.green, 'label': '绿色'},
|
||||
{'color': Colors.teal, 'label': '青色'},
|
||||
{'color': Colors.cyan, 'label': '蓝绿色'},
|
||||
{'color': Colors.lightBlue, 'label': '浅蓝色'},
|
||||
{'color': Colors.blue, 'label': '蓝色'},
|
||||
{'color': Colors.indigo, 'label': '靛蓝色'},
|
||||
{'color': Colors.purple, 'label': '紫色'},
|
||||
{'color': Colors.deepPurple, 'label': '深紫色'},
|
||||
{'color': Colors.blueGrey, 'label': '蓝灰色'},
|
||||
{'color': Colors.brown, 'label': '棕色'},
|
||||
{'color': Colors.grey, 'label': '灰色'},
|
||||
const List<({Color color, String label})> colorThemeTypes = [
|
||||
(color: Color(0xFF5CB67B), label: '默认绿'),
|
||||
(color: Color(0xFFFF7299), label: '粉红色'),
|
||||
(color: Colors.red, label: '红色'),
|
||||
(color: Colors.orange, label: '橙色'),
|
||||
(color: Colors.amber, label: '琥珀色'),
|
||||
(color: Colors.yellow, label: '黄色'),
|
||||
(color: Colors.lime, label: '酸橙色'),
|
||||
(color: Colors.lightGreen, label: '浅绿色'),
|
||||
(color: Colors.green, label: '绿色'),
|
||||
(color: Colors.teal, label: '青色'),
|
||||
(color: Colors.cyan, label: '蓝绿色'),
|
||||
(color: Colors.lightBlue, label: '浅蓝色'),
|
||||
(color: Colors.blue, label: '蓝色'),
|
||||
(color: Colors.indigo, label: '靛蓝色'),
|
||||
(color: Colors.purple, label: '紫色'),
|
||||
(color: Colors.deepPurple, label: '深紫色'),
|
||||
(color: Colors.blueGrey, label: '蓝灰色'),
|
||||
(color: Colors.brown, label: '棕色'),
|
||||
(color: Colors.grey, label: '灰色'),
|
||||
];
|
||||
|
||||
@@ -311,6 +311,7 @@ class Live {
|
||||
class Common {
|
||||
Common({
|
||||
this.cover,
|
||||
this.desc,
|
||||
this.desc1,
|
||||
this.desc2,
|
||||
this.headText,
|
||||
@@ -321,6 +322,7 @@ class Common {
|
||||
this.title,
|
||||
});
|
||||
String? cover;
|
||||
String? desc;
|
||||
String? desc1;
|
||||
String? desc2;
|
||||
String? headText;
|
||||
@@ -332,6 +334,7 @@ class Common {
|
||||
|
||||
Common.fromJson(Map<String, dynamic> json) {
|
||||
cover = json['cover'];
|
||||
desc = json['desc'];
|
||||
desc1 = json['desc1'];
|
||||
desc2 = json['desc2'];
|
||||
headText = json['head_text'];
|
||||
|
||||
31
lib/models/dynamics/dyn_reserve/data.dart
Normal file
31
lib/models/dynamics/dyn_reserve/data.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
class DynReserveData {
|
||||
int? finalBtnStatus;
|
||||
int? btnMode;
|
||||
int? reserveUpdate;
|
||||
String? descUpdate;
|
||||
String? toast;
|
||||
|
||||
DynReserveData({
|
||||
this.finalBtnStatus,
|
||||
this.btnMode,
|
||||
this.reserveUpdate,
|
||||
this.descUpdate,
|
||||
this.toast,
|
||||
});
|
||||
|
||||
factory DynReserveData.fromJson(Map<String, dynamic> json) => DynReserveData(
|
||||
finalBtnStatus: json['final_btn_status'] as int?,
|
||||
btnMode: json['btn_mode'] as int?,
|
||||
reserveUpdate: json['reserve_update'] as int?,
|
||||
descUpdate: json['desc_update'] as String?,
|
||||
toast: json['toast'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'final_btn_status': finalBtnStatus,
|
||||
'btn_mode': btnMode,
|
||||
'reserve_update': reserveUpdate,
|
||||
'desc_update': descUpdate,
|
||||
'toast': toast,
|
||||
};
|
||||
}
|
||||
@@ -297,7 +297,7 @@ class ModuleAuthorModel extends Avatar {
|
||||
String? pubTime;
|
||||
int? pubTs;
|
||||
String? type;
|
||||
Map? decorate;
|
||||
Decorate? decorate;
|
||||
|
||||
ModuleAuthorModel.fromJson(Map<String, dynamic> json) : super.fromJson(json) {
|
||||
if (json['official'] != null) {
|
||||
@@ -311,13 +311,65 @@ class ModuleAuthorModel extends Avatar {
|
||||
pubTs = json['pub_ts'] == 0 ? null : json['pub_ts'];
|
||||
type = json['type'];
|
||||
if (PendantAvatar.showDynDecorate) {
|
||||
decorate = json['decorate'];
|
||||
decorate =
|
||||
json['decorate'] == null ? null : Decorate.fromJson(json['decorate']);
|
||||
} else {
|
||||
pendant = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Decorate {
|
||||
String? cardUrl;
|
||||
Fan? fan;
|
||||
int? id;
|
||||
String? jumpUrl;
|
||||
String? name;
|
||||
int? type;
|
||||
|
||||
Decorate({
|
||||
this.cardUrl,
|
||||
this.fan,
|
||||
this.id,
|
||||
this.jumpUrl,
|
||||
this.name,
|
||||
this.type,
|
||||
});
|
||||
|
||||
factory Decorate.fromJson(Map<String, dynamic> json) => Decorate(
|
||||
cardUrl: json["card_url"],
|
||||
fan: json["fan"] == null ? null : Fan.fromJson(json["fan"]),
|
||||
id: json["id"],
|
||||
jumpUrl: json["jump_url"],
|
||||
name: json["name"],
|
||||
type: json["type"],
|
||||
);
|
||||
}
|
||||
|
||||
class Fan {
|
||||
String? color;
|
||||
bool? isFan;
|
||||
String? numPrefix;
|
||||
String? numStr;
|
||||
int? number;
|
||||
|
||||
Fan({
|
||||
this.color,
|
||||
this.isFan,
|
||||
this.numPrefix,
|
||||
this.numStr,
|
||||
this.number,
|
||||
});
|
||||
|
||||
factory Fan.fromJson(Map<String, dynamic> json) => Fan(
|
||||
color: json["color"],
|
||||
isFan: json["is_fan"],
|
||||
numPrefix: json["num_prefix"],
|
||||
numStr: json["num_str"],
|
||||
number: json["number"],
|
||||
);
|
||||
}
|
||||
|
||||
// 单个动态详情 - 动态信息
|
||||
class ModuleDynamicModel {
|
||||
ModuleDynamicModel({
|
||||
@@ -843,10 +895,10 @@ class DynamicMajorModel {
|
||||
// MAJOR_TYPE_OPUS 图文/文章
|
||||
String? type;
|
||||
Map? courses;
|
||||
Map? common;
|
||||
Common? common;
|
||||
Map? music;
|
||||
ModuleBlocked? blocked;
|
||||
Map? medialist;
|
||||
Medialist? medialist;
|
||||
|
||||
SubscriptionNew? subscriptionNew;
|
||||
|
||||
@@ -871,19 +923,39 @@ class DynamicMajorModel {
|
||||
none =
|
||||
json['none'] != null ? DynamicNoneModel.fromJson(json['none']) : null;
|
||||
type = json['type'];
|
||||
courses = json['courses'] ?? {};
|
||||
common = json['common'] ?? {};
|
||||
music = json['music'] ?? {};
|
||||
courses = json['courses'];
|
||||
common = json['common'] == null ? null : Common.fromJson(json['common']);
|
||||
music = json['music'];
|
||||
blocked = json['blocked'] == null
|
||||
? null
|
||||
: ModuleBlocked.fromJson(json['blocked']);
|
||||
medialist = json['medialist'];
|
||||
medialist = json['medialist'] == null
|
||||
? null
|
||||
: Medialist.fromJson(json['medialist']);
|
||||
subscriptionNew = json['subscription_new'] == null
|
||||
? null
|
||||
: SubscriptionNew.fromJson(json['subscription_new']);
|
||||
}
|
||||
}
|
||||
|
||||
class Medialist {
|
||||
dynamic id;
|
||||
String? cover;
|
||||
String? title;
|
||||
String? subTitle;
|
||||
String? jumpUrl;
|
||||
Badge? badge;
|
||||
|
||||
Medialist.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
cover = json['cover'];
|
||||
title = json['title'];
|
||||
subTitle = json['sub_title'];
|
||||
jumpUrl = json['jump_url'];
|
||||
badge = json['badge'] == null ? null : Badge.fromJson(json['badge']);
|
||||
}
|
||||
}
|
||||
|
||||
class SubscriptionNew {
|
||||
LiveRcmd? liveRcmd;
|
||||
String? style;
|
||||
@@ -1004,18 +1076,12 @@ class WatchedShow {
|
||||
int? num;
|
||||
String? textSmall;
|
||||
String? textLarge;
|
||||
String? icon;
|
||||
String? iconLocation;
|
||||
String? iconWeb;
|
||||
|
||||
WatchedShow({
|
||||
this.watchedShowSwitch,
|
||||
this.num,
|
||||
this.textSmall,
|
||||
this.textLarge,
|
||||
this.icon,
|
||||
this.iconLocation,
|
||||
this.iconWeb,
|
||||
});
|
||||
|
||||
factory WatchedShow.fromJson(Map<String, dynamic> json) => WatchedShow(
|
||||
@@ -1023,9 +1089,6 @@ class WatchedShow {
|
||||
num: json["num"],
|
||||
textSmall: json["text_small"],
|
||||
textLarge: json["text_large"],
|
||||
icon: json["icon"],
|
||||
iconLocation: json["icon_location"],
|
||||
iconWeb: json["icon_web"],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1065,7 +1128,7 @@ class DynamicArchiveModel {
|
||||
});
|
||||
|
||||
int? aid;
|
||||
Map? badge;
|
||||
Badge? badge;
|
||||
String? bvid;
|
||||
String? cover;
|
||||
String? desc;
|
||||
@@ -1080,7 +1143,7 @@ class DynamicArchiveModel {
|
||||
|
||||
DynamicArchiveModel.fromJson(Map<String, dynamic> json) {
|
||||
aid = json['aid'] is String ? int.parse(json['aid']) : json['aid'];
|
||||
badge = json['badge'];
|
||||
badge = json['badge'] == null ? null : Badge.fromJson(json['badge']);
|
||||
bvid = json['bvid'] ?? json['epid'].toString() ?? ' ';
|
||||
cover = json['cover'];
|
||||
disablePreview = json['disable_preview'];
|
||||
@@ -1094,6 +1157,18 @@ class DynamicArchiveModel {
|
||||
}
|
||||
}
|
||||
|
||||
class Badge {
|
||||
Badge({
|
||||
this.text,
|
||||
});
|
||||
|
||||
String? text;
|
||||
|
||||
Badge.fromJson(Map<String, dynamic> json) {
|
||||
text = json['text'] == '投稿视频' ? null : json['text'];
|
||||
}
|
||||
}
|
||||
|
||||
class DynamicDrawModel {
|
||||
DynamicDrawModel({
|
||||
this.id,
|
||||
@@ -1317,7 +1392,7 @@ class DynamicLive2Model {
|
||||
this.title,
|
||||
});
|
||||
|
||||
Map? badge;
|
||||
Badge? badge;
|
||||
String? cover;
|
||||
String? descFirst;
|
||||
String? descSecond;
|
||||
@@ -1328,7 +1403,7 @@ class DynamicLive2Model {
|
||||
String? title;
|
||||
|
||||
DynamicLive2Model.fromJson(Map<String, dynamic> json) {
|
||||
badge = json['badge'];
|
||||
badge = json['badge'] == null ? null : Badge.fromJson(json['badge']);
|
||||
cover = json['cover'];
|
||||
descFirst = json['desc_first'];
|
||||
descSecond = json['desc_second'];
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:PiliPlus/models/model_avatar.dart';
|
||||
|
||||
class FansDataModel {
|
||||
FansDataModel({
|
||||
this.total,
|
||||
@@ -36,7 +38,7 @@ class FansItemModel {
|
||||
String? uname;
|
||||
String? face;
|
||||
String? sign;
|
||||
Map? officialVerify;
|
||||
BaseOfficialVerify? officialVerify;
|
||||
|
||||
FansItemModel.fromJson(Map<String, dynamic> json) {
|
||||
mid = json['mid'];
|
||||
@@ -47,6 +49,8 @@ class FansItemModel {
|
||||
uname = json['uname'];
|
||||
face = json['face'];
|
||||
sign = json['sign'] == '' ? '还没有签名' : json['sign'];
|
||||
officialVerify = json['official_verify'];
|
||||
officialVerify = json['official_verify'] == null
|
||||
? null
|
||||
: BaseOfficialVerify.fromJson(json['official_verify']);
|
||||
}
|
||||
}
|
||||
|
||||
22
lib/models/folder_info/cnt_info.dart
Normal file
22
lib/models/folder_info/cnt_info.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
class CntInfo {
|
||||
int? collect;
|
||||
int? play;
|
||||
int? thumbUp;
|
||||
int? share;
|
||||
|
||||
CntInfo({this.collect, this.play, this.thumbUp, this.share});
|
||||
|
||||
factory CntInfo.fromJson(Map<String, dynamic> json) => CntInfo(
|
||||
collect: json['collect'] as int?,
|
||||
play: json['play'] as int?,
|
||||
thumbUp: json['thumb_up'] as int?,
|
||||
share: json['share'] as int?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'collect': collect,
|
||||
'play': play,
|
||||
'thumb_up': thumbUp,
|
||||
'share': share,
|
||||
};
|
||||
}
|
||||
90
lib/models/folder_info/data.dart
Normal file
90
lib/models/folder_info/data.dart
Normal file
@@ -0,0 +1,90 @@
|
||||
import 'package:PiliPlus/models/folder_info/cnt_info.dart';
|
||||
import 'package:PiliPlus/models/folder_info/upper.dart';
|
||||
|
||||
class FolderInfo {
|
||||
int? id;
|
||||
int? fid;
|
||||
int? mid;
|
||||
int? attr;
|
||||
String? title;
|
||||
String? cover;
|
||||
Upper? upper;
|
||||
int? coverType;
|
||||
CntInfo? cntInfo;
|
||||
int? type;
|
||||
String? intro;
|
||||
int? ctime;
|
||||
int? mtime;
|
||||
int? state;
|
||||
int? favState;
|
||||
int? likeState;
|
||||
int? mediaCount;
|
||||
bool? isTop;
|
||||
|
||||
FolderInfo({
|
||||
this.id,
|
||||
this.fid,
|
||||
this.mid,
|
||||
this.attr,
|
||||
this.title,
|
||||
this.cover,
|
||||
this.upper,
|
||||
this.coverType,
|
||||
this.cntInfo,
|
||||
this.type,
|
||||
this.intro,
|
||||
this.ctime,
|
||||
this.mtime,
|
||||
this.state,
|
||||
this.favState,
|
||||
this.likeState,
|
||||
this.mediaCount,
|
||||
this.isTop,
|
||||
});
|
||||
|
||||
factory FolderInfo.fromJson(Map<String, dynamic> json) => FolderInfo(
|
||||
id: json['id'] as int?,
|
||||
fid: json['fid'] as int?,
|
||||
mid: json['mid'] as int?,
|
||||
attr: json['attr'] as int?,
|
||||
title: json['title'] as String?,
|
||||
cover: json['cover'] as String?,
|
||||
upper: json['upper'] == null
|
||||
? null
|
||||
: Upper.fromJson(json['upper'] as Map<String, dynamic>),
|
||||
coverType: json['cover_type'] as int?,
|
||||
cntInfo: json['cnt_info'] == null
|
||||
? null
|
||||
: CntInfo.fromJson(json['cnt_info'] as Map<String, dynamic>),
|
||||
type: json['type'] as int?,
|
||||
intro: json['intro'] as String?,
|
||||
ctime: json['ctime'] as int?,
|
||||
mtime: json['mtime'] as int?,
|
||||
state: json['state'] as int?,
|
||||
favState: json['fav_state'] as int?,
|
||||
likeState: json['like_state'] as int?,
|
||||
mediaCount: json['media_count'] as int?,
|
||||
isTop: json['is_top'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'id': id,
|
||||
'fid': fid,
|
||||
'mid': mid,
|
||||
'attr': attr,
|
||||
'title': title,
|
||||
'cover': cover,
|
||||
'upper': upper?.toJson(),
|
||||
'cover_type': coverType,
|
||||
'cnt_info': cntInfo?.toJson(),
|
||||
'type': type,
|
||||
'intro': intro,
|
||||
'ctime': ctime,
|
||||
'mtime': mtime,
|
||||
'state': state,
|
||||
'fav_state': favState,
|
||||
'like_state': likeState,
|
||||
'media_count': mediaCount,
|
||||
'is_top': isTop,
|
||||
};
|
||||
}
|
||||
35
lib/models/folder_info/upper.dart
Normal file
35
lib/models/folder_info/upper.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
class Upper {
|
||||
int? mid;
|
||||
String? name;
|
||||
String? face;
|
||||
bool? followed;
|
||||
int? vipType;
|
||||
int? vipStatue;
|
||||
|
||||
Upper({
|
||||
this.mid,
|
||||
this.name,
|
||||
this.face,
|
||||
this.followed,
|
||||
this.vipType,
|
||||
this.vipStatue,
|
||||
});
|
||||
|
||||
factory Upper.fromJson(Map<String, dynamic> json) => Upper(
|
||||
mid: json['mid'] as int?,
|
||||
name: json['name'] as String?,
|
||||
face: json['face'] as String?,
|
||||
followed: json['followed'] as bool?,
|
||||
vipType: json['vip_type'] as int?,
|
||||
vipStatue: json['vip_statue'] as int?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'mid': mid,
|
||||
'name': name,
|
||||
'face': face,
|
||||
'followed': followed,
|
||||
'vip_type': vipType,
|
||||
'vip_statue': vipStatue,
|
||||
};
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:PiliPlus/models/model_avatar.dart';
|
||||
|
||||
class FollowDataModel {
|
||||
FollowDataModel({
|
||||
this.total,
|
||||
@@ -37,7 +39,7 @@ class FollowItemModel {
|
||||
String? uname;
|
||||
String? face;
|
||||
String? sign;
|
||||
Map? officialVerify;
|
||||
BaseOfficialVerify? officialVerify;
|
||||
|
||||
FollowItemModel.fromJson(Map<String, dynamic> json) {
|
||||
mid = json['mid'];
|
||||
@@ -48,6 +50,8 @@ class FollowItemModel {
|
||||
uname = json['uname'];
|
||||
face = json['face'];
|
||||
sign = json['sign'] == '' ? '还没有签名' : json['sign'];
|
||||
officialVerify = json['official_verify'];
|
||||
officialVerify = json['official_verify'] == null
|
||||
? null
|
||||
: BaseOfficialVerify.fromJson(json['official_verify']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ class RecVideoItemAppModel extends BaseRecVideoItemModel {
|
||||
String? talkBack;
|
||||
|
||||
String? cardType;
|
||||
Map? adInfo;
|
||||
ThreePoint? threePoint;
|
||||
|
||||
RecVideoItemAppModel.fromJson(Map<String, dynamic> json) {
|
||||
@@ -46,7 +45,6 @@ class RecVideoItemAppModel extends BaseRecVideoItemModel {
|
||||
}
|
||||
|
||||
cardType = json['card_type'];
|
||||
adInfo = json['ad_info'];
|
||||
threePoint = json['three_point_v2'] != null
|
||||
? ThreePoint.fromJson(json['three_point_v2'])
|
||||
: null;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
|
||||
class LiveItemModel {
|
||||
LiveItemModel({
|
||||
this.roomId,
|
||||
@@ -19,9 +21,6 @@ class LiveItemModel {
|
||||
this.sessionId,
|
||||
this.groupId,
|
||||
this.pkId,
|
||||
this.verify,
|
||||
this.headBox,
|
||||
this.headBoxType,
|
||||
this.watchedShow,
|
||||
});
|
||||
|
||||
@@ -44,10 +43,7 @@ class LiveItemModel {
|
||||
String? sessionId;
|
||||
int? groupId;
|
||||
int? pkId;
|
||||
Map? verify;
|
||||
Map? headBox;
|
||||
int? headBoxType;
|
||||
Map? watchedShow;
|
||||
WatchedShow? watchedShow;
|
||||
|
||||
LiveItemModel.fromJson(Map<String, dynamic> json) {
|
||||
roomId = json['roomid'];
|
||||
@@ -69,9 +65,6 @@ class LiveItemModel {
|
||||
sessionId = json['session_id'];
|
||||
groupId = json['group_id'];
|
||||
pkId = json['pk_id'];
|
||||
verify = json['verify'];
|
||||
headBox = json['head_box'];
|
||||
headBoxType = json['head_box_type'];
|
||||
watchedShow = json['watched_show'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
|
||||
class RoomInfoH5Model {
|
||||
RoomInfoH5Model({
|
||||
this.roomInfo,
|
||||
@@ -5,15 +7,13 @@ class RoomInfoH5Model {
|
||||
this.isRoomFeed,
|
||||
this.watchedShow,
|
||||
this.likeInfoV3,
|
||||
this.blockInfo,
|
||||
});
|
||||
|
||||
RoomInfo? roomInfo;
|
||||
AnchorInfo? anchorInfo;
|
||||
int? isRoomFeed;
|
||||
Map? watchedShow;
|
||||
WatchedShow? watchedShow;
|
||||
LikeInfoV3? likeInfoV3;
|
||||
Map? blockInfo;
|
||||
|
||||
RoomInfoH5Model.fromJson(Map<String, dynamic> json) {
|
||||
roomInfo =
|
||||
@@ -22,11 +22,12 @@ class RoomInfoH5Model {
|
||||
? null
|
||||
: AnchorInfo.fromJson(json['anchor_info']);
|
||||
isRoomFeed = json['is_room_feed'];
|
||||
watchedShow = json['watched_show'];
|
||||
watchedShow = json['watched_show'] == null
|
||||
? null
|
||||
: WatchedShow.fromJson(json['watched_show']);
|
||||
likeInfoV3 = json['like_info_v3'] == null
|
||||
? null
|
||||
: LikeInfoV3.fromJson(json['like_info_v3']);
|
||||
blockInfo = json['block_info'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
13
lib/models/media_list/badge.dart
Normal file
13
lib/models/media_list/badge.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
class Badge {
|
||||
String? text;
|
||||
int? bgStyle;
|
||||
String? img;
|
||||
|
||||
Badge({this.text, this.bgStyle, this.img});
|
||||
|
||||
factory Badge.fromJson(Map<String, dynamic> json) => Badge(
|
||||
text: json['text'] as String?,
|
||||
bgStyle: json['bg_style'] as int?,
|
||||
img: json['img'] as String?,
|
||||
);
|
||||
}
|
||||
41
lib/models/media_list/cnt_info.dart
Normal file
41
lib/models/media_list/cnt_info.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
class CntInfo {
|
||||
int? collect;
|
||||
int? play;
|
||||
int? thumbUp;
|
||||
int? thumbDown;
|
||||
int? share;
|
||||
int? reply;
|
||||
int? danmaku;
|
||||
int? coin;
|
||||
int? vt;
|
||||
int? playSwitch;
|
||||
String? viewText1;
|
||||
|
||||
CntInfo({
|
||||
this.collect,
|
||||
this.play,
|
||||
this.thumbUp,
|
||||
this.thumbDown,
|
||||
this.share,
|
||||
this.reply,
|
||||
this.danmaku,
|
||||
this.coin,
|
||||
this.vt,
|
||||
this.playSwitch,
|
||||
this.viewText1,
|
||||
});
|
||||
|
||||
factory CntInfo.fromJson(Map<String, dynamic> json) => CntInfo(
|
||||
collect: json['collect'] as int?,
|
||||
play: json['play'] as int?,
|
||||
thumbUp: json['thumb_up'] as int?,
|
||||
thumbDown: json['thumb_down'] as int?,
|
||||
share: json['share'] as int?,
|
||||
reply: json['reply'] as int?,
|
||||
danmaku: json['danmaku'] as int?,
|
||||
coin: json['coin'] as int?,
|
||||
vt: json['vt'] as int?,
|
||||
playSwitch: json['play_switch'] as int?,
|
||||
viewText1: json['view_text_1'] as String?,
|
||||
);
|
||||
}
|
||||
11
lib/models/media_list/coin.dart
Normal file
11
lib/models/media_list/coin.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
class Coin {
|
||||
int? maxNum;
|
||||
int? coinNumber;
|
||||
|
||||
Coin({this.maxNum, this.coinNumber});
|
||||
|
||||
factory Coin.fromJson(Map<String, dynamic> json) => Coin(
|
||||
maxNum: json['max_num'] as int?,
|
||||
coinNumber: json['coin_number'] as int?,
|
||||
);
|
||||
}
|
||||
20
lib/models/media_list/data.dart
Normal file
20
lib/models/media_list/data.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:PiliPlus/models/media_list/media_list.dart';
|
||||
|
||||
class MediaListData {
|
||||
List<MediaListItemModel>? mediaList;
|
||||
bool? hasMore;
|
||||
int? totalCount;
|
||||
String? nextStartKey;
|
||||
|
||||
MediaListData(
|
||||
{this.mediaList, this.hasMore, this.totalCount, this.nextStartKey});
|
||||
|
||||
factory MediaListData.fromJson(Map<String, dynamic> json) => MediaListData(
|
||||
mediaList: (json['media_list'] as List<dynamic>?)
|
||||
?.map((e) => MediaListItemModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
hasMore: json['has_more'] as bool?,
|
||||
totalCount: json['total_count'] as int?,
|
||||
nextStartKey: json['next_start_key'] as String?,
|
||||
);
|
||||
}
|
||||
13
lib/models/media_list/dimension.dart
Normal file
13
lib/models/media_list/dimension.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
class Dimension {
|
||||
int? width;
|
||||
int? height;
|
||||
int? rotate;
|
||||
|
||||
Dimension({this.width, this.height, this.rotate});
|
||||
|
||||
factory Dimension.fromJson(Map<String, dynamic> json) => Dimension(
|
||||
width: json['width'] as int?,
|
||||
height: json['height'] as int?,
|
||||
rotate: json['rotate'] as int?,
|
||||
);
|
||||
}
|
||||
113
lib/models/media_list/media_list.dart
Normal file
113
lib/models/media_list/media_list.dart
Normal file
@@ -0,0 +1,113 @@
|
||||
import 'package:PiliPlus/models/media_list/badge.dart';
|
||||
import 'package:PiliPlus/models/media_list/cnt_info.dart';
|
||||
import 'package:PiliPlus/models/media_list/coin.dart';
|
||||
import 'package:PiliPlus/models/media_list/ogv_info.dart';
|
||||
import 'package:PiliPlus/models/media_list/page.dart';
|
||||
import 'package:PiliPlus/models/media_list/rights.dart';
|
||||
import 'package:PiliPlus/models/media_list/upper.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
|
||||
class MediaListItemModel {
|
||||
int? get id => aid;
|
||||
int? aid;
|
||||
int? offset;
|
||||
int? index;
|
||||
String? intro;
|
||||
int? attr;
|
||||
int? tid;
|
||||
int? copyRight;
|
||||
CntInfo? cntInfo;
|
||||
String? cover;
|
||||
int? duration;
|
||||
int? pubtime;
|
||||
int? likeState;
|
||||
int? favState;
|
||||
int? page;
|
||||
List<Page>? pages;
|
||||
String? title;
|
||||
int? type;
|
||||
Upper? upper;
|
||||
String? link;
|
||||
String? bvid;
|
||||
String? shortLink;
|
||||
Rights? rights;
|
||||
dynamic elecInfo;
|
||||
Coin? coin;
|
||||
OgvInfo? ogvInfo;
|
||||
double? progressPercent;
|
||||
Badge? badge;
|
||||
bool? forbidFav;
|
||||
int? moreType;
|
||||
int? businessOid;
|
||||
int? cid;
|
||||
|
||||
MediaListItemModel({
|
||||
this.aid,
|
||||
this.offset,
|
||||
this.index,
|
||||
this.intro,
|
||||
this.attr,
|
||||
this.tid,
|
||||
this.copyRight,
|
||||
this.cntInfo,
|
||||
this.cover,
|
||||
this.duration,
|
||||
this.pubtime,
|
||||
this.likeState,
|
||||
this.favState,
|
||||
this.page,
|
||||
this.pages,
|
||||
this.title,
|
||||
this.type,
|
||||
this.upper,
|
||||
this.link,
|
||||
this.bvid,
|
||||
this.shortLink,
|
||||
this.rights,
|
||||
this.elecInfo,
|
||||
this.coin,
|
||||
this.ogvInfo,
|
||||
this.progressPercent,
|
||||
this.badge,
|
||||
this.forbidFav,
|
||||
this.moreType,
|
||||
this.businessOid,
|
||||
this.cid,
|
||||
});
|
||||
|
||||
MediaListItemModel.fromJson(Map<String, dynamic> json) {
|
||||
aid = json['id'] as int?;
|
||||
offset = json['offset'] as int?;
|
||||
index = json['index'] as int?;
|
||||
intro = json['intro'] as String?;
|
||||
attr = json['attr'] as int?;
|
||||
tid = json['tid'] as int?;
|
||||
copyRight = json['copy_right'] as int?;
|
||||
cntInfo =
|
||||
json['cnt_info'] == null ? null : CntInfo.fromJson(json['cnt_info']);
|
||||
cover = json['cover'] as String?;
|
||||
duration = json['duration'] as int?;
|
||||
pubtime = json['pubtime'] as int?;
|
||||
likeState = json['like_state'] as int?;
|
||||
favState = json['fav_state'] as int?;
|
||||
page = json['page'] as int?;
|
||||
pages = (json['pages'] as List?)?.map((e) => Page.fromJson(e)).toList();
|
||||
title = json['title'] as String?;
|
||||
type = json['type'] as int?;
|
||||
upper = json['upper'] == null ? null : Upper.fromJson(json['upper']);
|
||||
link = json['link'] as String?;
|
||||
bvid = json['bv_id'] as String?;
|
||||
shortLink = json['short_link'] as String?;
|
||||
rights = json['rights'] == null ? null : Rights.fromJson(json['rights']);
|
||||
elecInfo = json['elec_info'] as dynamic;
|
||||
coin = json['coin'] == null ? null : Coin.fromJson(json['coin']);
|
||||
ogvInfo =
|
||||
json['ogv_info'] == null ? null : OgvInfo.fromJson(json['ogv_info']);
|
||||
progressPercent = (json['progress_percent'] as num?)?.toDouble();
|
||||
badge = json['badge'] == null ? null : Badge.fromJson(json['badge']);
|
||||
forbidFav = json['forbid_fav'] as bool?;
|
||||
moreType = json['more_type'] as int?;
|
||||
businessOid = json['business_oid'] as int?;
|
||||
cid = pages.getOrNull((page ?? 1) - 1)?.id;
|
||||
}
|
||||
}
|
||||
21
lib/models/media_list/ogv_info.dart
Normal file
21
lib/models/media_list/ogv_info.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
import 'package:PiliPlus/models/media_list/dimension.dart';
|
||||
|
||||
class OgvInfo {
|
||||
int? epid;
|
||||
int? seasonId;
|
||||
int? aid;
|
||||
int? cid;
|
||||
Dimension? dimension;
|
||||
|
||||
OgvInfo({this.epid, this.seasonId, this.aid, this.cid, this.dimension});
|
||||
|
||||
factory OgvInfo.fromJson(Map<String, dynamic> json) => OgvInfo(
|
||||
epid: json['epid'] as int?,
|
||||
seasonId: json['season_id'] as int?,
|
||||
aid: json['aid'] as int?,
|
||||
cid: json['cid'] as int?,
|
||||
dimension: json['dimension'] == null
|
||||
? null
|
||||
: Dimension.fromJson(json['dimension'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
36
lib/models/media_list/page.dart
Normal file
36
lib/models/media_list/page.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
import 'package:PiliPlus/models/media_list/dimension.dart';
|
||||
|
||||
class Page {
|
||||
int? id;
|
||||
String? title;
|
||||
String? intro;
|
||||
int? duration;
|
||||
String? link;
|
||||
int? page;
|
||||
String? from;
|
||||
Dimension? dimension;
|
||||
|
||||
Page({
|
||||
this.id,
|
||||
this.title,
|
||||
this.intro,
|
||||
this.duration,
|
||||
this.link,
|
||||
this.page,
|
||||
this.from,
|
||||
this.dimension,
|
||||
});
|
||||
|
||||
factory Page.fromJson(Map<String, dynamic> json) => Page(
|
||||
id: json["id"],
|
||||
title: json["title"],
|
||||
intro: json["intro"],
|
||||
duration: json["duration"],
|
||||
link: json["link"],
|
||||
page: json["page"],
|
||||
from: json["from"],
|
||||
dimension: json["dimension"] == null
|
||||
? null
|
||||
: Dimension.fromJson(json["dimension"]),
|
||||
);
|
||||
}
|
||||
38
lib/models/media_list/rights.dart
Normal file
38
lib/models/media_list/rights.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
class Rights {
|
||||
int? bp;
|
||||
int? elec;
|
||||
int? download;
|
||||
int? movie;
|
||||
int? pay;
|
||||
int? ugcPay;
|
||||
int? hd5;
|
||||
int? noReprint;
|
||||
int? autoplay;
|
||||
int? noBackground;
|
||||
|
||||
Rights({
|
||||
this.bp,
|
||||
this.elec,
|
||||
this.download,
|
||||
this.movie,
|
||||
this.pay,
|
||||
this.ugcPay,
|
||||
this.hd5,
|
||||
this.noReprint,
|
||||
this.autoplay,
|
||||
this.noBackground,
|
||||
});
|
||||
|
||||
factory Rights.fromJson(Map<String, dynamic> json) => Rights(
|
||||
bp: json['bp'] as int?,
|
||||
elec: json['elec'] as int?,
|
||||
download: json['download'] as int?,
|
||||
movie: json['movie'] as int?,
|
||||
pay: json['pay'] as int?,
|
||||
ugcPay: json['ugc_pay'] as int?,
|
||||
hd5: json['hd5'] as int?,
|
||||
noReprint: json['no_reprint'] as int?,
|
||||
autoplay: json['autoplay'] as int?,
|
||||
noBackground: json['no_background'] as int?,
|
||||
);
|
||||
}
|
||||
47
lib/models/media_list/upper.dart
Normal file
47
lib/models/media_list/upper.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
class Upper {
|
||||
int? mid;
|
||||
String? name;
|
||||
String? face;
|
||||
int? followed;
|
||||
int? fans;
|
||||
int? vipType;
|
||||
int? vipStatue;
|
||||
int? vipDueDate;
|
||||
int? vipPayType;
|
||||
int? officialRole;
|
||||
String? officialTitle;
|
||||
String? officialDesc;
|
||||
String? displayName;
|
||||
|
||||
Upper({
|
||||
this.mid,
|
||||
this.name,
|
||||
this.face,
|
||||
this.followed,
|
||||
this.fans,
|
||||
this.vipType,
|
||||
this.vipStatue,
|
||||
this.vipDueDate,
|
||||
this.vipPayType,
|
||||
this.officialRole,
|
||||
this.officialTitle,
|
||||
this.officialDesc,
|
||||
this.displayName,
|
||||
});
|
||||
|
||||
factory Upper.fromJson(Map<String, dynamic> json) => Upper(
|
||||
mid: json['mid'] as int?,
|
||||
name: json['name'] as String?,
|
||||
face: json['face'] as String?,
|
||||
followed: json['followed'] as int?,
|
||||
fans: json['fans'] as int?,
|
||||
vipType: json['vip_type'] as int?,
|
||||
vipStatue: json['vip_statue'] as int?,
|
||||
vipDueDate: json['vip_due_date'] as int?,
|
||||
vipPayType: json['vip_pay_type'] as int?,
|
||||
officialRole: json['official_role'] as int?,
|
||||
officialTitle: json['official_title'] as String?,
|
||||
officialDesc: json['official_desc'] as String?,
|
||||
displayName: json['display_name'] as String?,
|
||||
);
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:PiliPlus/models/model_avatar.dart';
|
||||
|
||||
class MemberInfoModel {
|
||||
@@ -24,7 +25,7 @@ class MemberInfoModel {
|
||||
int? level;
|
||||
bool? isFollowed;
|
||||
String? topPhoto;
|
||||
Map? official;
|
||||
BaseOfficialVerify? official;
|
||||
Vip? vip;
|
||||
LiveRoom? liveRoom;
|
||||
int? isSeniorMember;
|
||||
@@ -38,7 +39,9 @@ class MemberInfoModel {
|
||||
level = json['level'];
|
||||
isFollowed = json['is_followed'];
|
||||
topPhoto = json['top_photo'];
|
||||
official = json['official'];
|
||||
official = json['official'] == null
|
||||
? null
|
||||
: BaseOfficialVerify.fromJson(json['official']);
|
||||
vip = Vip.fromJson(json['vip']);
|
||||
liveRoom =
|
||||
json['live_room'] != null ? LiveRoom.fromJson(json['live_room']) : null;
|
||||
@@ -65,7 +68,7 @@ class LiveRoom {
|
||||
String? cover;
|
||||
int? roomId;
|
||||
int? roundStatus;
|
||||
Map? watchedShow;
|
||||
WatchedShow? watchedShow;
|
||||
|
||||
LiveRoom.fromJson(Map<String, dynamic> json) {
|
||||
roomStatus = json['roomStatus'];
|
||||
@@ -75,6 +78,8 @@ class LiveRoom {
|
||||
cover = json['cover'];
|
||||
roomId = json['roomid'];
|
||||
roundStatus = json['roundStatus'];
|
||||
watchedShow = json['watched_show'];
|
||||
watchedShow = json['watched_show'] == null
|
||||
? null
|
||||
: WatchedShow.fromJson(json['watched_show']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class SystemNotifyList {
|
||||
int? id;
|
||||
int? cursor;
|
||||
@@ -46,7 +48,18 @@ class SystemNotifyList {
|
||||
: null;
|
||||
type = json['type'];
|
||||
title = json['title'];
|
||||
content = json['content'];
|
||||
if (json['content'] != null) {
|
||||
try {
|
||||
dynamic jsonContent = jsonDecode(json['content']);
|
||||
if (jsonContent?['web'] != null) {
|
||||
content = jsonContent['web'];
|
||||
} else {
|
||||
content = json['content'];
|
||||
}
|
||||
} catch (_) {
|
||||
content = json['content'];
|
||||
}
|
||||
}
|
||||
source = json['source'] != null ? Source.fromJson(json['source']) : null;
|
||||
timeAt = json['time_at'];
|
||||
cardType = json['card_type'];
|
||||
|
||||
@@ -1,315 +0,0 @@
|
||||
class BangumiInfoModel {
|
||||
BangumiInfoModel({
|
||||
this.activity,
|
||||
this.actors,
|
||||
this.alias,
|
||||
this.areas,
|
||||
this.bkgCover,
|
||||
this.cover,
|
||||
this.enableVt,
|
||||
this.episodes,
|
||||
this.evaluate,
|
||||
this.freya,
|
||||
this.jpTitle,
|
||||
this.link,
|
||||
this.mediaId,
|
||||
this.newEp,
|
||||
this.playStrategy,
|
||||
this.positive,
|
||||
this.publish,
|
||||
this.rating,
|
||||
this.record,
|
||||
this.rights,
|
||||
this.seasonId,
|
||||
this.seasonTitle,
|
||||
this.seasons,
|
||||
this.series,
|
||||
this.shareCopy,
|
||||
this.shareSubTitle,
|
||||
this.shareUrl,
|
||||
this.show,
|
||||
this.showSeasonType,
|
||||
this.squareCover,
|
||||
this.stat,
|
||||
this.status,
|
||||
this.styles,
|
||||
this.subTitle,
|
||||
this.title,
|
||||
this.total,
|
||||
this.type,
|
||||
this.userStatus,
|
||||
this.staff,
|
||||
});
|
||||
|
||||
Map? activity;
|
||||
String? actors;
|
||||
String? alias;
|
||||
List? areas;
|
||||
String? bkgCover;
|
||||
String? cover;
|
||||
String? enableVt;
|
||||
List<EpisodeItem>? episodes;
|
||||
String? evaluate;
|
||||
Map? freya;
|
||||
String? jpTitle;
|
||||
String? link;
|
||||
int? mediaId;
|
||||
Map? newEp;
|
||||
Map? playStrategy;
|
||||
Map? positive;
|
||||
Map? publish;
|
||||
Map? rating;
|
||||
String? record;
|
||||
Map? rights;
|
||||
int? seasonId;
|
||||
String? seasonTitle;
|
||||
List? seasons;
|
||||
Map? series;
|
||||
String? shareCopy;
|
||||
String? shareSubTitle;
|
||||
String? shareUrl;
|
||||
Map? show;
|
||||
int? showSeasonType;
|
||||
String? squareCover;
|
||||
Map? stat;
|
||||
int? status;
|
||||
List? styles;
|
||||
String? subTitle;
|
||||
String? title;
|
||||
int? total;
|
||||
int? type;
|
||||
UserStatus? userStatus;
|
||||
String? staff;
|
||||
List<Section>? section;
|
||||
|
||||
BangumiInfoModel.fromJson(Map<String, dynamic> json) {
|
||||
activity = json['activity'];
|
||||
actors = json['actors'];
|
||||
alias = json['alias'];
|
||||
areas = json['areas'];
|
||||
bkgCover = json['bkg_cover'];
|
||||
cover = json['cover'];
|
||||
enableVt = json['enableVt'];
|
||||
episodes = (json['episodes'] as List?)
|
||||
?.map<EpisodeItem>((e) => EpisodeItem.fromJson(e))
|
||||
.toList();
|
||||
evaluate = json['evaluate'];
|
||||
freya = json['freya'];
|
||||
jpTitle = json['jp_title'];
|
||||
link = json['link'];
|
||||
mediaId = json['media_id'];
|
||||
newEp = json['new_ep'];
|
||||
playStrategy = json['play_strategy'];
|
||||
positive = json['positive'];
|
||||
publish = json['publish'];
|
||||
rating = json['rating'];
|
||||
record = json['record'];
|
||||
rights = json['rights'];
|
||||
seasonId = json['season_id'];
|
||||
seasonTitle = json['season_title'];
|
||||
seasons = json['seasons'];
|
||||
series = json['series'];
|
||||
shareCopy = json['share_copy'];
|
||||
shareSubTitle = json['share_sub_title'];
|
||||
shareUrl = json['share_url'];
|
||||
show = json['show'];
|
||||
showSeasonType = json['show_season_type'];
|
||||
squareCover = json['square_cover'];
|
||||
stat = json['stat'];
|
||||
status = json['status'];
|
||||
styles = json['styles'];
|
||||
subTitle = json['sub_title'];
|
||||
title = json['title'];
|
||||
total = json['total'];
|
||||
type = json['type'];
|
||||
if (json['user_status'] != null) {
|
||||
userStatus = UserStatus.fromJson(json['user_status']);
|
||||
}
|
||||
staff = json['staff'];
|
||||
section = (json['section'] as List?)
|
||||
?.map((item) => Section.fromJson(item))
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
class Section {
|
||||
Section({
|
||||
this.episodes,
|
||||
});
|
||||
List<EpisodeItem>? episodes;
|
||||
|
||||
Section.fromJson(Map<String, dynamic> json) {
|
||||
episodes = (json['episodes'] as List?)
|
||||
?.map<EpisodeItem>((e) => EpisodeItem.fromJson(e))
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
class EpisodeItem {
|
||||
EpisodeItem({
|
||||
this.aid,
|
||||
this.badge,
|
||||
this.badgeInfo,
|
||||
this.badgeType,
|
||||
this.bvid,
|
||||
this.cid,
|
||||
this.cover,
|
||||
this.dimension,
|
||||
this.duration,
|
||||
this.enableVt,
|
||||
this.epId,
|
||||
this.from,
|
||||
this.id,
|
||||
this.isViewHide,
|
||||
this.link,
|
||||
this.longTitle,
|
||||
this.pubTime,
|
||||
this.pv,
|
||||
this.releaseDate,
|
||||
this.rights,
|
||||
this.shareCopy,
|
||||
this.shareUrl,
|
||||
this.shortLink,
|
||||
this.skip,
|
||||
this.status,
|
||||
this.subtitle,
|
||||
this.title,
|
||||
this.vid,
|
||||
this.showTitle,
|
||||
});
|
||||
|
||||
int? aid;
|
||||
String? badge;
|
||||
Map? badgeInfo;
|
||||
int? badgeType;
|
||||
String? bvid;
|
||||
int? cid;
|
||||
String? cover;
|
||||
Map? dimension;
|
||||
int? duration;
|
||||
bool? enableVt;
|
||||
int? epId;
|
||||
String? from;
|
||||
int? id;
|
||||
bool? isViewHide;
|
||||
String? link;
|
||||
String? longTitle;
|
||||
int? pubTime;
|
||||
int? pv;
|
||||
String? releaseDate;
|
||||
Map? rights;
|
||||
String? shareCopy;
|
||||
String? shareUrl;
|
||||
String? shortLink;
|
||||
Map? skip;
|
||||
int? status;
|
||||
String? subtitle;
|
||||
String? title;
|
||||
String? vid;
|
||||
String? showTitle;
|
||||
|
||||
EpisodeItem.fromJson(Map<String, dynamic> json) {
|
||||
aid = json['aid'];
|
||||
badge = json['badge'] != '' ? json['badge'] : null;
|
||||
badgeInfo = json['badge_info'];
|
||||
badgeType = json['badge_type'];
|
||||
bvid = json['bvid'];
|
||||
cid = json['cid'];
|
||||
cover = json['cover'];
|
||||
dimension = json['dimension'];
|
||||
duration = json['duration'];
|
||||
enableVt = json['enable_vt'];
|
||||
epId = json['ep_id'];
|
||||
from = json['from'];
|
||||
id = json['id'];
|
||||
isViewHide = json['is_view_hide'];
|
||||
link = json['link'];
|
||||
longTitle = json['long_title'];
|
||||
pubTime = json['pub_time'];
|
||||
pv = json['pv'];
|
||||
releaseDate = json['release_date'];
|
||||
rights = json['rights'];
|
||||
shareCopy = json['share_copy'];
|
||||
shareUrl = json['share_url'];
|
||||
shortLink = json['short_link'];
|
||||
skip = json['skip'];
|
||||
status = json['status'];
|
||||
subtitle = json['subtitle'];
|
||||
title = json['title'];
|
||||
vid = json['vid'];
|
||||
showTitle = json['show_title'];
|
||||
}
|
||||
}
|
||||
|
||||
class UserStatus {
|
||||
UserStatus({
|
||||
this.areaLimit,
|
||||
this.banAreaShow,
|
||||
this.follow,
|
||||
this.followStatus,
|
||||
this.login,
|
||||
this.pay,
|
||||
this.payPackPaid,
|
||||
this.progress,
|
||||
this.sponsor,
|
||||
this.vipInfo,
|
||||
});
|
||||
int? areaLimit;
|
||||
int? banAreaShow;
|
||||
int? follow;
|
||||
int? followStatus;
|
||||
int? login;
|
||||
int? pay;
|
||||
int? payPackPaid;
|
||||
UserProgress? progress;
|
||||
int? sponsor;
|
||||
VipInfo? vipInfo;
|
||||
UserStatus.fromJson(Map<String, dynamic> json) {
|
||||
areaLimit = json['area_limit'];
|
||||
banAreaShow = json['ban_area_show'];
|
||||
follow = json['follow'];
|
||||
followStatus = json['follow_status'];
|
||||
login = json['login'];
|
||||
pay = json['pay'];
|
||||
payPackPaid = json['pay_pack_paid'];
|
||||
if (json['progress'] != null) {
|
||||
progress = UserProgress.fromJson(json['progress']);
|
||||
}
|
||||
sponsor = json['sponsor'];
|
||||
if (json['vip_info'] != null) {
|
||||
vipInfo = VipInfo.fromJson(json['vip_info']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class UserProgress {
|
||||
UserProgress({
|
||||
this.lastEpId,
|
||||
this.lastEpIndex,
|
||||
this.lastTime,
|
||||
});
|
||||
int? lastEpId;
|
||||
String? lastEpIndex;
|
||||
int? lastTime;
|
||||
UserProgress.fromJson(Map<String, dynamic> json) {
|
||||
lastEpId = json['last_ep_id'];
|
||||
lastEpIndex = json['last_ep_index'];
|
||||
lastTime = json['last_time'];
|
||||
}
|
||||
}
|
||||
|
||||
class VipInfo {
|
||||
VipInfo({
|
||||
this.dueDate,
|
||||
this.status,
|
||||
this.type,
|
||||
});
|
||||
int? dueDate;
|
||||
int? status;
|
||||
int? type;
|
||||
VipInfo.fromJson(Map<String, dynamic> json) {
|
||||
dueDate = json['due_date'];
|
||||
status = json['status'];
|
||||
type = json['type'];
|
||||
}
|
||||
}
|
||||
13
lib/models/pgc/pgc_info_model/activity.dart
Normal file
13
lib/models/pgc/pgc_info_model/activity.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
class Activity {
|
||||
String? headBgUrl;
|
||||
int? id;
|
||||
String? title;
|
||||
|
||||
Activity({this.headBgUrl, this.id, this.title});
|
||||
|
||||
factory Activity.fromJson(Map<String, dynamic> json) => Activity(
|
||||
headBgUrl: json['head_bg_url'] as String?,
|
||||
id: json['id'] as int?,
|
||||
title: json['title'] as String?,
|
||||
);
|
||||
}
|
||||
11
lib/models/pgc/pgc_info_model/area.dart
Normal file
11
lib/models/pgc/pgc_info_model/area.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
class Area {
|
||||
int? id;
|
||||
String? name;
|
||||
|
||||
Area({this.id, this.name});
|
||||
|
||||
factory Area.fromJson(Map<String, dynamic> json) => Area(
|
||||
id: json['id'] as int?,
|
||||
name: json['name'] as String?,
|
||||
);
|
||||
}
|
||||
13
lib/models/pgc/pgc_info_model/badge_info.dart
Normal file
13
lib/models/pgc/pgc_info_model/badge_info.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
class BadgeInfo {
|
||||
String? bgColor;
|
||||
String? bgColorNight;
|
||||
String? text;
|
||||
|
||||
BadgeInfo({this.bgColor, this.bgColorNight, this.text});
|
||||
|
||||
factory BadgeInfo.fromJson(Map<String, dynamic> json) => BadgeInfo(
|
||||
bgColor: json['bg_color'] as String?,
|
||||
bgColorNight: json['bg_color_night'] as String?,
|
||||
text: json['text'] as String?,
|
||||
);
|
||||
}
|
||||
15
lib/models/pgc/pgc_info_model/danmaku.dart
Normal file
15
lib/models/pgc/pgc_info_model/danmaku.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
class Danmaku {
|
||||
String? icon;
|
||||
String? pureText;
|
||||
String? text;
|
||||
int? value;
|
||||
|
||||
Danmaku({this.icon, this.pureText, this.text, this.value});
|
||||
|
||||
factory Danmaku.fromJson(Map<String, dynamic> json) => Danmaku(
|
||||
icon: json['icon'] as String?,
|
||||
pureText: json['pure_text'] as String?,
|
||||
text: json['text'] as String?,
|
||||
value: json['value'] as int?,
|
||||
);
|
||||
}
|
||||
13
lib/models/pgc/pgc_info_model/dimension.dart
Normal file
13
lib/models/pgc/pgc_info_model/dimension.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
class Dimension {
|
||||
int? height;
|
||||
int? rotate;
|
||||
int? width;
|
||||
|
||||
Dimension({this.height, this.rotate, this.width});
|
||||
|
||||
factory Dimension.fromJson(Map<String, dynamic> json) => Dimension(
|
||||
height: json['height'] as int?,
|
||||
rotate: json['rotate'] as int?,
|
||||
width: json['width'] as int?,
|
||||
);
|
||||
}
|
||||
11
lib/models/pgc/pgc_info_model/ed.dart
Normal file
11
lib/models/pgc/pgc_info_model/ed.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
class Ed {
|
||||
int? end;
|
||||
int? start;
|
||||
|
||||
Ed({this.end, this.start});
|
||||
|
||||
factory Ed.fromJson(Map<String, dynamic> json) => Ed(
|
||||
end: json['end'] as int?,
|
||||
start: json['start'] as int?,
|
||||
);
|
||||
}
|
||||
114
lib/models/pgc/pgc_info_model/episode.dart
Normal file
114
lib/models/pgc/pgc_info_model/episode.dart
Normal file
@@ -0,0 +1,114 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/badge_info.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/dimension.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/rights.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/skip.dart';
|
||||
|
||||
class EpisodeItem {
|
||||
int? aid;
|
||||
String? badge;
|
||||
BadgeInfo? badgeInfo;
|
||||
int? badgeType;
|
||||
String? bvid;
|
||||
int? cid;
|
||||
String? cover;
|
||||
Dimension? dimension;
|
||||
int? duration;
|
||||
bool? enableVt;
|
||||
int? epId;
|
||||
String? from;
|
||||
int? id;
|
||||
bool? isViewHide;
|
||||
String? link;
|
||||
String? longTitle;
|
||||
int? pubTime;
|
||||
int? pv;
|
||||
String? releaseDate;
|
||||
Rights? rights;
|
||||
int? sectionType;
|
||||
String? shareCopy;
|
||||
String? shareUrl;
|
||||
String? shortLink;
|
||||
bool? showDrmLoginDialog;
|
||||
String? showTitle;
|
||||
Skip? skip;
|
||||
int? status;
|
||||
String? subtitle;
|
||||
String? title;
|
||||
String? vid;
|
||||
|
||||
EpisodeItem({
|
||||
this.aid,
|
||||
this.badge,
|
||||
this.badgeInfo,
|
||||
this.badgeType,
|
||||
this.bvid,
|
||||
this.cid,
|
||||
this.cover,
|
||||
this.dimension,
|
||||
this.duration,
|
||||
this.enableVt,
|
||||
this.epId,
|
||||
this.from,
|
||||
this.id,
|
||||
this.isViewHide,
|
||||
this.link,
|
||||
this.longTitle,
|
||||
this.pubTime,
|
||||
this.pv,
|
||||
this.releaseDate,
|
||||
this.rights,
|
||||
this.sectionType,
|
||||
this.shareCopy,
|
||||
this.shareUrl,
|
||||
this.shortLink,
|
||||
this.showDrmLoginDialog,
|
||||
this.showTitle,
|
||||
this.skip,
|
||||
this.status,
|
||||
this.subtitle,
|
||||
this.title,
|
||||
this.vid,
|
||||
});
|
||||
|
||||
factory EpisodeItem.fromJson(Map<String, dynamic> json) => EpisodeItem(
|
||||
aid: json['aid'] as int?,
|
||||
badge: json['badge'] as String?,
|
||||
badgeInfo: json['badge_info'] == null
|
||||
? null
|
||||
: BadgeInfo.fromJson(json['badge_info'] as Map<String, dynamic>),
|
||||
badgeType: json['badge_type'] as int?,
|
||||
bvid: json['bvid'] as String?,
|
||||
cid: json['cid'] as int?,
|
||||
cover: json['cover'] as String?,
|
||||
dimension: json['dimension'] == null
|
||||
? null
|
||||
: Dimension.fromJson(json['dimension'] as Map<String, dynamic>),
|
||||
duration: json['duration'] as int?,
|
||||
enableVt: json['enable_vt'] as bool?,
|
||||
epId: json['ep_id'] as int?,
|
||||
from: json['from'] as String?,
|
||||
id: json['id'] as int?,
|
||||
isViewHide: json['is_view_hide'] as bool?,
|
||||
link: json['link'] as String?,
|
||||
longTitle: json['long_title'] as String?,
|
||||
pubTime: json['pub_time'] as int?,
|
||||
pv: json['pv'] as int?,
|
||||
releaseDate: json['release_date'] as String?,
|
||||
rights: json['rights'] == null
|
||||
? null
|
||||
: Rights.fromJson(json['rights'] as Map<String, dynamic>),
|
||||
sectionType: json['section_type'] as int?,
|
||||
shareCopy: json['share_copy'] as String?,
|
||||
shareUrl: json['share_url'] as String?,
|
||||
shortLink: json['short_link'] as String?,
|
||||
showDrmLoginDialog: json['showDrmLoginDialog'] as bool?,
|
||||
showTitle: json['show_title'] as String?,
|
||||
skip: json['skip'] == null
|
||||
? null
|
||||
: Skip.fromJson(json['skip'] as Map<String, dynamic>),
|
||||
status: json['status'] as int?,
|
||||
subtitle: json['subtitle'] as String?,
|
||||
title: json['title'] as String?,
|
||||
vid: json['vid'] as String?,
|
||||
);
|
||||
}
|
||||
11
lib/models/pgc/pgc_info_model/freya.dart
Normal file
11
lib/models/pgc/pgc_info_model/freya.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
class Freya {
|
||||
int? bubbleShowCnt;
|
||||
int? iconShow;
|
||||
|
||||
Freya({this.bubbleShowCnt, this.iconShow});
|
||||
|
||||
factory Freya.fromJson(Map<String, dynamic> json) => Freya(
|
||||
bubbleShowCnt: json['bubble_show_cnt'] as int?,
|
||||
iconShow: json['icon_show'] as int?,
|
||||
);
|
||||
}
|
||||
11
lib/models/pgc/pgc_info_model/icon_font.dart
Normal file
11
lib/models/pgc/pgc_info_model/icon_font.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
class IconFont {
|
||||
String? name;
|
||||
String? text;
|
||||
|
||||
IconFont({this.name, this.text});
|
||||
|
||||
factory IconFont.fromJson(Map<String, dynamic> json) => IconFont(
|
||||
name: json['name'] as String?,
|
||||
text: json['text'] as String?,
|
||||
);
|
||||
}
|
||||
15
lib/models/pgc/pgc_info_model/new_ep.dart
Normal file
15
lib/models/pgc/pgc_info_model/new_ep.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
class NewEp {
|
||||
String? desc;
|
||||
int? id;
|
||||
int? isNew;
|
||||
String? title;
|
||||
|
||||
NewEp({this.desc, this.id, this.isNew, this.title});
|
||||
|
||||
factory NewEp.fromJson(Map<String, dynamic> json) => NewEp(
|
||||
desc: json['desc'] as String?,
|
||||
id: json['id'] as int?,
|
||||
isNew: json['is_new'] as int?,
|
||||
title: json['title'] as String?,
|
||||
);
|
||||
}
|
||||
11
lib/models/pgc/pgc_info_model/op.dart
Normal file
11
lib/models/pgc/pgc_info_model/op.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
class Op {
|
||||
int? end;
|
||||
int? start;
|
||||
|
||||
Op({this.end, this.start});
|
||||
|
||||
factory Op.fromJson(Map<String, dynamic> json) => Op(
|
||||
end: json['end'] as int?,
|
||||
start: json['start'] as int?,
|
||||
);
|
||||
}
|
||||
26
lib/models/pgc/pgc_info_model/pay_type.dart
Normal file
26
lib/models/pgc/pgc_info_model/pay_type.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
class PayType {
|
||||
int? allowDiscount;
|
||||
int? allowPack;
|
||||
int? allowTicket;
|
||||
int? allowTimeLimit;
|
||||
int? allowVipDiscount;
|
||||
int? forbidBb;
|
||||
|
||||
PayType({
|
||||
this.allowDiscount,
|
||||
this.allowPack,
|
||||
this.allowTicket,
|
||||
this.allowTimeLimit,
|
||||
this.allowVipDiscount,
|
||||
this.forbidBb,
|
||||
});
|
||||
|
||||
factory PayType.fromJson(Map<String, dynamic> json) => PayType(
|
||||
allowDiscount: json['allow_discount'] as int?,
|
||||
allowPack: json['allow_pack'] as int?,
|
||||
allowTicket: json['allow_ticket'] as int?,
|
||||
allowTimeLimit: json['allow_time_limit'] as int?,
|
||||
allowVipDiscount: json['allow_vip_discount'] as int?,
|
||||
forbidBb: json['forbid_bb'] as int?,
|
||||
);
|
||||
}
|
||||
42
lib/models/pgc/pgc_info_model/payment.dart
Normal file
42
lib/models/pgc/pgc_info_model/payment.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/pay_type.dart';
|
||||
|
||||
class Payment {
|
||||
int? discount;
|
||||
PayType? payType;
|
||||
String? price;
|
||||
String? promotion;
|
||||
String? tip;
|
||||
int? viewStartTime;
|
||||
int? vipDiscount;
|
||||
String? vipFirstPromotion;
|
||||
String? vipPrice;
|
||||
String? vipPromotion;
|
||||
|
||||
Payment({
|
||||
this.discount,
|
||||
this.payType,
|
||||
this.price,
|
||||
this.promotion,
|
||||
this.tip,
|
||||
this.viewStartTime,
|
||||
this.vipDiscount,
|
||||
this.vipFirstPromotion,
|
||||
this.vipPrice,
|
||||
this.vipPromotion,
|
||||
});
|
||||
|
||||
factory Payment.fromJson(Map<String, dynamic> json) => Payment(
|
||||
discount: json['discount'] as int?,
|
||||
payType: json['pay_type'] == null
|
||||
? null
|
||||
: PayType.fromJson(json['pay_type'] as Map<String, dynamic>),
|
||||
price: json['price'] as String?,
|
||||
promotion: json['promotion'] as String?,
|
||||
tip: json['tip'] as String?,
|
||||
viewStartTime: json['view_start_time'] as int?,
|
||||
vipDiscount: json['vip_discount'] as int?,
|
||||
vipFirstPromotion: json['vip_first_promotion'] as String?,
|
||||
vipPrice: json['vip_price'] as String?,
|
||||
vipPromotion: json['vip_promotion'] as String?,
|
||||
);
|
||||
}
|
||||
13
lib/models/pgc/pgc_info_model/pendant.dart
Normal file
13
lib/models/pgc/pgc_info_model/pendant.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
class Pendant {
|
||||
String? image;
|
||||
String? name;
|
||||
int? pid;
|
||||
|
||||
Pendant({this.image, this.name, this.pid});
|
||||
|
||||
factory Pendant.fromJson(Map<String, dynamic> json) => Pendant(
|
||||
image: json['image'] as String?,
|
||||
name: json['name'] as String?,
|
||||
pid: json['pid'] as int?,
|
||||
);
|
||||
}
|
||||
9
lib/models/pgc/pgc_info_model/play_strategy.dart
Normal file
9
lib/models/pgc/pgc_info_model/play_strategy.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
class PlayStrategy {
|
||||
List? strategies;
|
||||
|
||||
PlayStrategy({this.strategies});
|
||||
|
||||
factory PlayStrategy.fromJson(Map<String, dynamic> json) => PlayStrategy(
|
||||
strategies: json['strategies'],
|
||||
);
|
||||
}
|
||||
11
lib/models/pgc/pgc_info_model/positive.dart
Normal file
11
lib/models/pgc/pgc_info_model/positive.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
class Positive {
|
||||
int? id;
|
||||
String? title;
|
||||
|
||||
Positive({this.id, this.title});
|
||||
|
||||
factory Positive.fromJson(Map<String, dynamic> json) => Positive(
|
||||
id: json['id'] as int?,
|
||||
title: json['title'] as String?,
|
||||
);
|
||||
}
|
||||
26
lib/models/pgc/pgc_info_model/publish.dart
Normal file
26
lib/models/pgc/pgc_info_model/publish.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
class Publish {
|
||||
int? isFinish;
|
||||
int? isStarted;
|
||||
String? pubTime;
|
||||
String? pubTimeShow;
|
||||
int? unknowPubDate;
|
||||
int? weekday;
|
||||
|
||||
Publish({
|
||||
this.isFinish,
|
||||
this.isStarted,
|
||||
this.pubTime,
|
||||
this.pubTimeShow,
|
||||
this.unknowPubDate,
|
||||
this.weekday,
|
||||
});
|
||||
|
||||
factory Publish.fromJson(Map<String, dynamic> json) => Publish(
|
||||
isFinish: json['is_finish'] as int?,
|
||||
isStarted: json['is_started'] as int?,
|
||||
pubTime: json['pub_time'] as String?,
|
||||
pubTimeShow: json['pub_time_show'] as String?,
|
||||
unknowPubDate: json['unknow_pub_date'] as int?,
|
||||
weekday: json['weekday'] as int?,
|
||||
);
|
||||
}
|
||||
11
lib/models/pgc/pgc_info_model/rating.dart
Normal file
11
lib/models/pgc/pgc_info_model/rating.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
class Rating {
|
||||
int? count;
|
||||
double? score;
|
||||
|
||||
Rating({this.count, this.score});
|
||||
|
||||
factory Rating.fromJson(Map<String, dynamic> json) => Rating(
|
||||
count: json['count'] as int?,
|
||||
score: (json['score'] as num?)?.toDouble(),
|
||||
);
|
||||
}
|
||||
206
lib/models/pgc/pgc_info_model/result.dart
Normal file
206
lib/models/pgc/pgc_info_model/result.dart
Normal file
@@ -0,0 +1,206 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/activity.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/area.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/episode.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/freya.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/icon_font.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/new_ep.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/payment.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/play_strategy.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/positive.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/publish.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/rating.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/rights.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/season.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/section.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/series.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/show.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/stat.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/up_info.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/user_status.dart';
|
||||
|
||||
class BangumiInfoModel {
|
||||
Activity? activity;
|
||||
String? actors;
|
||||
String? alias;
|
||||
List<Area>? areas;
|
||||
String? bkgCover;
|
||||
String? cover;
|
||||
bool? deliveryFragmentVideo;
|
||||
bool? enableVt;
|
||||
List<EpisodeItem>? episodes;
|
||||
String? evaluate;
|
||||
Freya? freya;
|
||||
int? hideEpVvVtDm;
|
||||
IconFont? iconFont;
|
||||
String? jpTitle;
|
||||
String? link;
|
||||
int? mediaId;
|
||||
int? mode;
|
||||
NewEp? newEp;
|
||||
Payment? payment;
|
||||
PlayStrategy? playStrategy;
|
||||
Positive? positive;
|
||||
Publish? publish;
|
||||
Rating? rating;
|
||||
String? record;
|
||||
Rights? rights;
|
||||
int? seasonId;
|
||||
String? seasonTitle;
|
||||
List<Season>? seasons;
|
||||
List<Section>? section;
|
||||
Series? series;
|
||||
String? shareCopy;
|
||||
String? shareSubTitle;
|
||||
String? shareUrl;
|
||||
Show? show;
|
||||
int? showSeasonType;
|
||||
String? squareCover;
|
||||
String? staff;
|
||||
Stat? stat;
|
||||
int? status;
|
||||
List? styles;
|
||||
String? subtitle;
|
||||
String? title;
|
||||
int? total;
|
||||
int? type;
|
||||
UpInfo? upInfo;
|
||||
UserStatus? userStatus;
|
||||
|
||||
BangumiInfoModel({
|
||||
this.activity,
|
||||
this.actors,
|
||||
this.alias,
|
||||
this.areas,
|
||||
this.bkgCover,
|
||||
this.cover,
|
||||
this.deliveryFragmentVideo,
|
||||
this.enableVt,
|
||||
this.episodes,
|
||||
this.evaluate,
|
||||
this.freya,
|
||||
this.hideEpVvVtDm,
|
||||
this.iconFont,
|
||||
this.jpTitle,
|
||||
this.link,
|
||||
this.mediaId,
|
||||
this.mode,
|
||||
this.newEp,
|
||||
this.payment,
|
||||
this.playStrategy,
|
||||
this.positive,
|
||||
this.publish,
|
||||
this.rating,
|
||||
this.record,
|
||||
this.rights,
|
||||
this.seasonId,
|
||||
this.seasonTitle,
|
||||
this.seasons,
|
||||
this.section,
|
||||
this.series,
|
||||
this.shareCopy,
|
||||
this.shareSubTitle,
|
||||
this.shareUrl,
|
||||
this.show,
|
||||
this.showSeasonType,
|
||||
this.squareCover,
|
||||
this.staff,
|
||||
this.stat,
|
||||
this.status,
|
||||
this.styles,
|
||||
this.subtitle,
|
||||
this.title,
|
||||
this.total,
|
||||
this.type,
|
||||
this.upInfo,
|
||||
this.userStatus,
|
||||
});
|
||||
|
||||
factory BangumiInfoModel.fromJson(Map<String, dynamic> json) =>
|
||||
BangumiInfoModel(
|
||||
activity: json['activity'] == null
|
||||
? null
|
||||
: Activity.fromJson(json['activity'] as Map<String, dynamic>),
|
||||
actors: json['actors'] as String?,
|
||||
alias: json['alias'] as String?,
|
||||
areas: (json['areas'] as List<dynamic>?)
|
||||
?.map((e) => Area.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
bkgCover: json['bkg_cover'] as String?,
|
||||
cover: json['cover'] as String?,
|
||||
deliveryFragmentVideo: json['delivery_fragment_video'] as bool?,
|
||||
enableVt: json['enable_vt'] as bool?,
|
||||
episodes: (json['episodes'] as List<dynamic>?)
|
||||
?.map((e) => EpisodeItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
evaluate: json['evaluate'] as String?,
|
||||
freya: json['freya'] == null
|
||||
? null
|
||||
: Freya.fromJson(json['freya'] as Map<String, dynamic>),
|
||||
hideEpVvVtDm: json['hide_ep_vv_vt_dm'] as int?,
|
||||
iconFont: json['icon_font'] == null
|
||||
? null
|
||||
: IconFont.fromJson(json['icon_font'] as Map<String, dynamic>),
|
||||
jpTitle: json['jp_title'] as String?,
|
||||
link: json['link'] as String?,
|
||||
mediaId: json['media_id'] as int?,
|
||||
mode: json['mode'] as int?,
|
||||
newEp: json['new_ep'] == null
|
||||
? null
|
||||
: NewEp.fromJson(json['new_ep'] as Map<String, dynamic>),
|
||||
payment: json['payment'] == null
|
||||
? null
|
||||
: Payment.fromJson(json['payment'] as Map<String, dynamic>),
|
||||
playStrategy: json['play_strategy'] == null
|
||||
? null
|
||||
: PlayStrategy.fromJson(
|
||||
json['play_strategy'] as Map<String, dynamic>),
|
||||
positive: json['positive'] == null
|
||||
? null
|
||||
: Positive.fromJson(json['positive'] as Map<String, dynamic>),
|
||||
publish: json['publish'] == null
|
||||
? null
|
||||
: Publish.fromJson(json['publish'] as Map<String, dynamic>),
|
||||
rating: json['rating'] == null
|
||||
? null
|
||||
: Rating.fromJson(json['rating'] as Map<String, dynamic>),
|
||||
record: json['record'] as String?,
|
||||
rights: json['rights'] == null
|
||||
? null
|
||||
: Rights.fromJson(json['rights'] as Map<String, dynamic>),
|
||||
seasonId: json['season_id'] as int?,
|
||||
seasonTitle: json['season_title'] as String?,
|
||||
seasons: (json['seasons'] as List<dynamic>?)
|
||||
?.map((e) => Season.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
section: (json['section'] as List<dynamic>?)
|
||||
?.map((e) => Section.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
series: json['series'] == null
|
||||
? null
|
||||
: Series.fromJson(json['series'] as Map<String, dynamic>),
|
||||
shareCopy: json['share_copy'] as String?,
|
||||
shareSubTitle: json['share_sub_title'] as String?,
|
||||
shareUrl: json['share_url'] as String?,
|
||||
show: json['show'] == null
|
||||
? null
|
||||
: Show.fromJson(json['show'] as Map<String, dynamic>),
|
||||
showSeasonType: json['show_season_type'] as int?,
|
||||
squareCover: json['square_cover'] as String?,
|
||||
staff: json['staff'] as String?,
|
||||
stat: json['stat'] == null
|
||||
? null
|
||||
: Stat.fromJson(json['stat'] as Map<String, dynamic>),
|
||||
status: json['status'] as int?,
|
||||
styles: json['styles'],
|
||||
subtitle: json['subtitle'] as String?,
|
||||
title: json['title'] as String?,
|
||||
total: json['total'] as int?,
|
||||
type: json['type'] as int?,
|
||||
upInfo: json['up_info'] == null
|
||||
? null
|
||||
: UpInfo.fromJson(json['up_info'] as Map<String, dynamic>),
|
||||
userStatus: json['user_status'] == null
|
||||
? null
|
||||
: UserStatus.fromJson(json['user_status'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
13
lib/models/pgc/pgc_info_model/rights.dart
Normal file
13
lib/models/pgc/pgc_info_model/rights.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
class Rights {
|
||||
int? allowDm;
|
||||
int? allowDownload;
|
||||
int? areaLimit;
|
||||
|
||||
Rights({this.allowDm, this.allowDownload, this.areaLimit});
|
||||
|
||||
factory Rights.fromJson(Map<String, dynamic> json) => Rights(
|
||||
allowDm: json['allow_dm'] as int?,
|
||||
allowDownload: json['allow_download'] as int?,
|
||||
areaLimit: json['area_limit'] as int?,
|
||||
);
|
||||
}
|
||||
63
lib/models/pgc/pgc_info_model/season.dart
Normal file
63
lib/models/pgc/pgc_info_model/season.dart
Normal file
@@ -0,0 +1,63 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/badge_info.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/icon_font.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/new_ep.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/stat.dart';
|
||||
|
||||
class Season {
|
||||
String? badge;
|
||||
BadgeInfo? badgeInfo;
|
||||
int? badgeType;
|
||||
String? cover;
|
||||
bool? enableVt;
|
||||
String? horizontalCover1610;
|
||||
String? horizontalCover169;
|
||||
IconFont? iconFont;
|
||||
int? mediaId;
|
||||
NewEp? newEp;
|
||||
int? seasonId;
|
||||
String? seasonTitle;
|
||||
int? seasonType;
|
||||
Stat? stat;
|
||||
|
||||
Season({
|
||||
this.badge,
|
||||
this.badgeInfo,
|
||||
this.badgeType,
|
||||
this.cover,
|
||||
this.enableVt,
|
||||
this.horizontalCover1610,
|
||||
this.horizontalCover169,
|
||||
this.iconFont,
|
||||
this.mediaId,
|
||||
this.newEp,
|
||||
this.seasonId,
|
||||
this.seasonTitle,
|
||||
this.seasonType,
|
||||
this.stat,
|
||||
});
|
||||
|
||||
factory Season.fromJson(Map<String, dynamic> json) => Season(
|
||||
badge: json['badge'] as String?,
|
||||
badgeInfo: json['badge_info'] == null
|
||||
? null
|
||||
: BadgeInfo.fromJson(json['badge_info'] as Map<String, dynamic>),
|
||||
badgeType: json['badge_type'] as int?,
|
||||
cover: json['cover'] as String?,
|
||||
enableVt: json['enable_vt'] as bool?,
|
||||
horizontalCover1610: json['horizontal_cover_1610'] as String?,
|
||||
horizontalCover169: json['horizontal_cover_169'] as String?,
|
||||
iconFont: json['icon_font'] == null
|
||||
? null
|
||||
: IconFont.fromJson(json['icon_font'] as Map<String, dynamic>),
|
||||
mediaId: json['media_id'] as int?,
|
||||
newEp: json['new_ep'] == null
|
||||
? null
|
||||
: NewEp.fromJson(json['new_ep'] as Map<String, dynamic>),
|
||||
seasonId: json['season_id'] as int?,
|
||||
seasonTitle: json['season_title'] as String?,
|
||||
seasonType: json['season_type'] as int?,
|
||||
stat: json['stat'] == null
|
||||
? null
|
||||
: Stat.fromJson(json['stat'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
36
lib/models/pgc/pgc_info_model/section.dart
Normal file
36
lib/models/pgc/pgc_info_model/section.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/episode.dart';
|
||||
|
||||
class Section {
|
||||
int? attr;
|
||||
int? episodeId;
|
||||
List<dynamic>? episodeIds;
|
||||
List<EpisodeItem>? episodes;
|
||||
int? id;
|
||||
String? title;
|
||||
int? type;
|
||||
int? type2;
|
||||
|
||||
Section({
|
||||
this.attr,
|
||||
this.episodeId,
|
||||
this.episodeIds,
|
||||
this.episodes,
|
||||
this.id,
|
||||
this.title,
|
||||
this.type,
|
||||
this.type2,
|
||||
});
|
||||
|
||||
factory Section.fromJson(Map<String, dynamic> json) => Section(
|
||||
attr: json['attr'] as int?,
|
||||
episodeId: json['episode_id'] as int?,
|
||||
episodeIds: json['episode_ids'] as List<dynamic>?,
|
||||
episodes: (json['episodes'] as List<dynamic>?)
|
||||
?.map((e) => EpisodeItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
id: json['id'] as int?,
|
||||
title: json['title'] as String?,
|
||||
type: json['type'] as int?,
|
||||
type2: json['type2'] as int?,
|
||||
);
|
||||
}
|
||||
13
lib/models/pgc/pgc_info_model/series.dart
Normal file
13
lib/models/pgc/pgc_info_model/series.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
class Series {
|
||||
int? displayType;
|
||||
int? seriesId;
|
||||
String? seriesTitle;
|
||||
|
||||
Series({this.displayType, this.seriesId, this.seriesTitle});
|
||||
|
||||
factory Series.fromJson(Map<String, dynamic> json) => Series(
|
||||
displayType: json['display_type'] as int?,
|
||||
seriesId: json['series_id'] as int?,
|
||||
seriesTitle: json['series_title'] as String?,
|
||||
);
|
||||
}
|
||||
9
lib/models/pgc/pgc_info_model/show.dart
Normal file
9
lib/models/pgc/pgc_info_model/show.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
class Show {
|
||||
int? wideScreen;
|
||||
|
||||
Show({this.wideScreen});
|
||||
|
||||
factory Show.fromJson(Map<String, dynamic> json) => Show(
|
||||
wideScreen: json['wide_screen'] as int?,
|
||||
);
|
||||
}
|
||||
18
lib/models/pgc/pgc_info_model/skip.dart
Normal file
18
lib/models/pgc/pgc_info_model/skip.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/ed.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/op.dart';
|
||||
|
||||
class Skip {
|
||||
Ed? ed;
|
||||
Op? op;
|
||||
|
||||
Skip({this.ed, this.op});
|
||||
|
||||
factory Skip.fromJson(Map<String, dynamic> json) => Skip(
|
||||
ed: json['ed'] == null
|
||||
? null
|
||||
: Ed.fromJson(json['ed'] as Map<String, dynamic>),
|
||||
op: json['op'] == null
|
||||
? null
|
||||
: Op.fromJson(json['op'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
38
lib/models/pgc/pgc_info_model/stat.dart
Normal file
38
lib/models/pgc/pgc_info_model/stat.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
class Stat {
|
||||
int? coins;
|
||||
int? danmakus;
|
||||
int? favorite;
|
||||
int? favorites;
|
||||
String? followText;
|
||||
int? likes;
|
||||
int? reply;
|
||||
int? share;
|
||||
int? views;
|
||||
int? vt;
|
||||
|
||||
Stat({
|
||||
this.coins,
|
||||
this.danmakus,
|
||||
this.favorite,
|
||||
this.favorites,
|
||||
this.followText,
|
||||
this.likes,
|
||||
this.reply,
|
||||
this.share,
|
||||
this.views,
|
||||
this.vt,
|
||||
});
|
||||
|
||||
factory Stat.fromJson(Map<String, dynamic> json) => Stat(
|
||||
coins: json["coins"],
|
||||
danmakus: json["danmakus"],
|
||||
favorite: json["favorite"],
|
||||
favorites: json["favorites"],
|
||||
followText: json["follow_text"],
|
||||
likes: json["likes"],
|
||||
reply: json["reply"],
|
||||
share: json["share"],
|
||||
views: json["views"],
|
||||
vt: json["vt"],
|
||||
);
|
||||
}
|
||||
24
lib/models/pgc/pgc_info_model/stat_for_unity.dart
Normal file
24
lib/models/pgc/pgc_info_model/stat_for_unity.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/danmaku.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/vt.dart';
|
||||
|
||||
class StatForUnity {
|
||||
int? coin;
|
||||
Danmaku? danmaku;
|
||||
int? likes;
|
||||
int? reply;
|
||||
Vt? vt;
|
||||
|
||||
StatForUnity({this.coin, this.danmaku, this.likes, this.reply, this.vt});
|
||||
|
||||
factory StatForUnity.fromJson(Map<String, dynamic> json) => StatForUnity(
|
||||
coin: json['coin'] as int?,
|
||||
danmaku: json['danmaku'] == null
|
||||
? null
|
||||
: Danmaku.fromJson(json['danmaku'] as Map<String, dynamic>),
|
||||
likes: json['likes'] as int?,
|
||||
reply: json['reply'] as int?,
|
||||
vt: json['vt'] == null
|
||||
? null
|
||||
: Vt.fromJson(json['vt'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
54
lib/models/pgc/pgc_info_model/up_info.dart
Normal file
54
lib/models/pgc/pgc_info_model/up_info.dart
Normal file
@@ -0,0 +1,54 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/pendant.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/vip_label.dart';
|
||||
|
||||
class UpInfo {
|
||||
String? avatar;
|
||||
String? avatarSubscriptUrl;
|
||||
int? follower;
|
||||
int? isFollow;
|
||||
int? mid;
|
||||
String? nicknameColor;
|
||||
Pendant? pendant;
|
||||
int? themeType;
|
||||
String? uname;
|
||||
int? verifyType;
|
||||
VipLabel? vipLabel;
|
||||
int? vipStatus;
|
||||
int? vipType;
|
||||
|
||||
UpInfo({
|
||||
this.avatar,
|
||||
this.avatarSubscriptUrl,
|
||||
this.follower,
|
||||
this.isFollow,
|
||||
this.mid,
|
||||
this.nicknameColor,
|
||||
this.pendant,
|
||||
this.themeType,
|
||||
this.uname,
|
||||
this.verifyType,
|
||||
this.vipLabel,
|
||||
this.vipStatus,
|
||||
this.vipType,
|
||||
});
|
||||
|
||||
factory UpInfo.fromJson(Map<String, dynamic> json) => UpInfo(
|
||||
avatar: json['avatar'] as String?,
|
||||
avatarSubscriptUrl: json['avatar_subscript_url'] as String?,
|
||||
follower: json['follower'] as int?,
|
||||
isFollow: json['is_follow'] as int?,
|
||||
mid: json['mid'] as int?,
|
||||
nicknameColor: json['nickname_color'] as String?,
|
||||
pendant: json['pendant'] == null
|
||||
? null
|
||||
: Pendant.fromJson(json['pendant'] as Map<String, dynamic>),
|
||||
themeType: json['theme_type'] as int?,
|
||||
uname: json['uname'] as String?,
|
||||
verifyType: json['verify_type'] as int?,
|
||||
vipLabel: json['vip_label'] == null
|
||||
? null
|
||||
: VipLabel.fromJson(json['vip_label'] as Map<String, dynamic>),
|
||||
vipStatus: json['vip_status'] as int?,
|
||||
vipType: json['vip_type'] as int?,
|
||||
);
|
||||
}
|
||||
15
lib/models/pgc/pgc_info_model/user_progress.dart
Normal file
15
lib/models/pgc/pgc_info_model/user_progress.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
class UserProgress {
|
||||
UserProgress({
|
||||
this.lastEpId,
|
||||
this.lastEpIndex,
|
||||
this.lastTime,
|
||||
});
|
||||
int? lastEpId;
|
||||
String? lastEpIndex;
|
||||
int? lastTime;
|
||||
UserProgress.fromJson(Map<String, dynamic> json) {
|
||||
lastEpId = json['last_ep_id'];
|
||||
lastEpIndex = json['last_ep_index'];
|
||||
lastTime = json['last_time'];
|
||||
}
|
||||
}
|
||||
39
lib/models/pgc/pgc_info_model/user_status.dart
Normal file
39
lib/models/pgc/pgc_info_model/user_status.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_info_model/user_progress.dart';
|
||||
|
||||
class UserStatus {
|
||||
int? areaLimit;
|
||||
int? banAreaShow;
|
||||
int? follow;
|
||||
int? followStatus;
|
||||
int? login;
|
||||
int? pay;
|
||||
int? payPackPaid;
|
||||
int? sponsor;
|
||||
UserProgress? progress;
|
||||
|
||||
UserStatus({
|
||||
this.areaLimit,
|
||||
this.banAreaShow,
|
||||
this.follow,
|
||||
this.followStatus,
|
||||
this.login,
|
||||
this.pay,
|
||||
this.payPackPaid,
|
||||
this.sponsor,
|
||||
this.progress,
|
||||
});
|
||||
|
||||
factory UserStatus.fromJson(Map<String, dynamic> json) => UserStatus(
|
||||
areaLimit: json['area_limit'] as int?,
|
||||
banAreaShow: json['ban_area_show'] as int?,
|
||||
follow: json['follow'] as int?,
|
||||
followStatus: json['follow_status'] as int?,
|
||||
login: json['login'] as int?,
|
||||
pay: json['pay'] as int?,
|
||||
payPackPaid: json['pay_pack_paid'] as int?,
|
||||
sponsor: json['sponsor'] as int?,
|
||||
progress: json['progress'] == null
|
||||
? null
|
||||
: UserProgress.fromJson(json['progress']),
|
||||
);
|
||||
}
|
||||
23
lib/models/pgc/pgc_info_model/vip_label.dart
Normal file
23
lib/models/pgc/pgc_info_model/vip_label.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
class VipLabel {
|
||||
String? bgColor;
|
||||
int? bgStyle;
|
||||
String? borderColor;
|
||||
String? text;
|
||||
String? textColor;
|
||||
|
||||
VipLabel({
|
||||
this.bgColor,
|
||||
this.bgStyle,
|
||||
this.borderColor,
|
||||
this.text,
|
||||
this.textColor,
|
||||
});
|
||||
|
||||
factory VipLabel.fromJson(Map<String, dynamic> json) => VipLabel(
|
||||
bgColor: json['bg_color'] as String?,
|
||||
bgStyle: json['bg_style'] as int?,
|
||||
borderColor: json['border_color'] as String?,
|
||||
text: json['text'] as String?,
|
||||
textColor: json['text_color'] as String?,
|
||||
);
|
||||
}
|
||||
15
lib/models/pgc/pgc_info_model/vt.dart
Normal file
15
lib/models/pgc/pgc_info_model/vt.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
class Vt {
|
||||
String? icon;
|
||||
String? pureText;
|
||||
String? text;
|
||||
int? value;
|
||||
|
||||
Vt({this.icon, this.pureText, this.text, this.value});
|
||||
|
||||
factory Vt.fromJson(Map<String, dynamic> json) => Vt(
|
||||
icon: json['icon'] as String?,
|
||||
pureText: json['pure_text'] as String?,
|
||||
text: json['text'] as String?,
|
||||
value: json['value'] as int?,
|
||||
);
|
||||
}
|
||||
20
lib/models/pgc_lcf.dart
Normal file
20
lib/models/pgc_lcf.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
class PgcLCF {
|
||||
int? coinNumber;
|
||||
int? favorite;
|
||||
int? isOriginal;
|
||||
int? like;
|
||||
|
||||
PgcLCF({
|
||||
this.coinNumber,
|
||||
this.favorite,
|
||||
this.isOriginal,
|
||||
this.like,
|
||||
});
|
||||
|
||||
factory PgcLCF.fromJson(Map<String, dynamic> json) => PgcLCF(
|
||||
coinNumber: json["coin_number"],
|
||||
favorite: json["favorite"],
|
||||
isOriginal: json["is_original"],
|
||||
like: json["like"],
|
||||
);
|
||||
}
|
||||
30
lib/models/play_info/data.dart
Normal file
30
lib/models/play_info/data.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'package:PiliPlus/models/play_info/interaction.dart';
|
||||
import 'package:PiliPlus/models/play_info/subtitle_info.dart';
|
||||
import 'package:PiliPlus/models/play_info/view_point';
|
||||
|
||||
class PlayInfoData {
|
||||
int? lastPlayCid;
|
||||
SubtitleInfo? subtitle;
|
||||
List<ViewPoint>? viewPoints;
|
||||
Interaction? interaction;
|
||||
|
||||
PlayInfoData({
|
||||
this.lastPlayCid,
|
||||
this.subtitle,
|
||||
this.viewPoints,
|
||||
this.interaction,
|
||||
});
|
||||
|
||||
factory PlayInfoData.fromJson(Map<String, dynamic> json) => PlayInfoData(
|
||||
lastPlayCid: json['last_play_cid'] as int?,
|
||||
subtitle: json['subtitle'] == null
|
||||
? null
|
||||
: SubtitleInfo.fromJson(json['subtitle'] as Map<String, dynamic>),
|
||||
viewPoints: (json['view_points'] as List?)
|
||||
?.map((e) => ViewPoint.fromJson(e))
|
||||
.toList(),
|
||||
interaction: json["interaction"] == null
|
||||
? null
|
||||
: Interaction.fromJson(json["interaction"]),
|
||||
);
|
||||
}
|
||||
34
lib/models/play_info/interaction.dart
Normal file
34
lib/models/play_info/interaction.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
class Interaction {
|
||||
HistoryNode? historyNode;
|
||||
int? graphVersion;
|
||||
|
||||
Interaction({
|
||||
this.historyNode,
|
||||
this.graphVersion,
|
||||
});
|
||||
|
||||
factory Interaction.fromJson(Map<String, dynamic> json) => Interaction(
|
||||
historyNode: json["history_node"] == null
|
||||
? null
|
||||
: HistoryNode.fromJson(json["history_node"]),
|
||||
graphVersion: json["graph_version"],
|
||||
);
|
||||
}
|
||||
|
||||
class HistoryNode {
|
||||
int? nodeId;
|
||||
String? title;
|
||||
int? cid;
|
||||
|
||||
HistoryNode({
|
||||
this.nodeId,
|
||||
this.title,
|
||||
this.cid,
|
||||
});
|
||||
|
||||
factory HistoryNode.fromJson(Map<String, dynamic> json) => HistoryNode(
|
||||
nodeId: json["node_id"],
|
||||
title: json["title"],
|
||||
cid: json["cid"],
|
||||
);
|
||||
}
|
||||
20
lib/models/play_info/subtitle.dart
Normal file
20
lib/models/play_info/subtitle.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
class Subtitle {
|
||||
String? lan;
|
||||
String? lanDoc;
|
||||
String? subtitleUrl;
|
||||
String? subtitleUrlV2;
|
||||
|
||||
Subtitle({
|
||||
this.lan,
|
||||
this.lanDoc,
|
||||
this.subtitleUrl,
|
||||
this.subtitleUrlV2,
|
||||
});
|
||||
|
||||
factory Subtitle.fromJson(Map<String, dynamic> json) => Subtitle(
|
||||
lan: json["lan"],
|
||||
lanDoc: json["lan_doc"],
|
||||
subtitleUrl: json["subtitle_url"],
|
||||
subtitleUrlV2: json["subtitle_url_v2"],
|
||||
);
|
||||
}
|
||||
17
lib/models/play_info/subtitle_info.dart
Normal file
17
lib/models/play_info/subtitle_info.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
import 'package:PiliPlus/models/play_info/subtitle.dart';
|
||||
|
||||
class SubtitleInfo {
|
||||
String? lan;
|
||||
String? lanDoc;
|
||||
List<Subtitle>? subtitles;
|
||||
|
||||
SubtitleInfo({this.lan, this.lanDoc, this.subtitles});
|
||||
|
||||
factory SubtitleInfo.fromJson(Map<String, dynamic> json) => SubtitleInfo(
|
||||
lan: json['lan'] as String?,
|
||||
lanDoc: json['lan_doc'] as String?,
|
||||
subtitles: (json['subtitles'] as List<dynamic>?)
|
||||
?.map((e) => Subtitle.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
34
lib/models/play_info/view_point
Normal file
34
lib/models/play_info/view_point
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
class ViewPoint {
|
||||
int? type;
|
||||
int? from;
|
||||
int? to;
|
||||
String? content;
|
||||
String? imgUrl;
|
||||
String? logoUrl;
|
||||
String? teamType;
|
||||
String? teamName;
|
||||
|
||||
ViewPoint({
|
||||
this.type,
|
||||
this.from,
|
||||
this.to,
|
||||
this.content,
|
||||
this.imgUrl,
|
||||
this.logoUrl,
|
||||
this.teamType,
|
||||
this.teamName,
|
||||
});
|
||||
|
||||
factory ViewPoint.fromJson(Map<String, dynamic> json) => ViewPoint(
|
||||
type: json["type"],
|
||||
from: json["from"],
|
||||
to: json["to"],
|
||||
content: json["content"],
|
||||
imgUrl: json["imgUrl"],
|
||||
logoUrl: json["logoUrl"],
|
||||
teamType: json["team_type"],
|
||||
teamName: json["team_name"],
|
||||
);
|
||||
|
||||
}
|
||||
17
lib/models/relation/data.dart
Normal file
17
lib/models/relation/data.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
class Relation {
|
||||
int? mid;
|
||||
int? attribute;
|
||||
int? mtime;
|
||||
dynamic tag;
|
||||
int? special;
|
||||
|
||||
Relation({this.mid, this.attribute, this.mtime, this.tag, this.special});
|
||||
|
||||
factory Relation.fromJson(Map<String, dynamic> json) => Relation(
|
||||
mid: json['mid'] as int?,
|
||||
attribute: json['attribute'] as int?,
|
||||
mtime: json['mtime'] as int?,
|
||||
tag: json['tag'] as dynamic,
|
||||
special: json['special'] as int?,
|
||||
);
|
||||
}
|
||||
28
lib/models/sponsor_block/segment_item.dart
Normal file
28
lib/models/sponsor_block/segment_item.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
class SegmentItemModel {
|
||||
String cid;
|
||||
String category;
|
||||
String actionType;
|
||||
List<int> segment;
|
||||
String uuid;
|
||||
double videoDuration;
|
||||
|
||||
SegmentItemModel({
|
||||
required this.cid,
|
||||
required this.category,
|
||||
required this.actionType,
|
||||
required this.segment,
|
||||
required this.uuid,
|
||||
required this.videoDuration,
|
||||
});
|
||||
|
||||
factory SegmentItemModel.fromJson(Map<String, dynamic> json) =>
|
||||
SegmentItemModel(
|
||||
cid: json["cid"],
|
||||
category: json["category"],
|
||||
actionType: json["actionType"],
|
||||
segment:
|
||||
List<int>.from(json["segment"]!.map((x) => (x as num).round())),
|
||||
uuid: json["UUID"],
|
||||
videoDuration: (json["videoDuration"] as num).toDouble(),
|
||||
);
|
||||
}
|
||||
29
lib/models/stein_edgeinfo/choice.dart
Normal file
29
lib/models/stein_edgeinfo/choice.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
class Choice {
|
||||
int? id;
|
||||
String? platformAction;
|
||||
String? nativeAction;
|
||||
String? condition;
|
||||
int? cid;
|
||||
String? option;
|
||||
int? isDefault;
|
||||
|
||||
Choice({
|
||||
this.id,
|
||||
this.platformAction,
|
||||
this.nativeAction,
|
||||
this.condition,
|
||||
this.cid,
|
||||
this.option,
|
||||
this.isDefault,
|
||||
});
|
||||
|
||||
factory Choice.fromJson(Map<String, dynamic> json) => Choice(
|
||||
id: json['id'] as int?,
|
||||
platformAction: json['platform_action'] as String?,
|
||||
nativeAction: json['native_action'] as String?,
|
||||
condition: json['condition'] as String?,
|
||||
cid: json['cid'] as int?,
|
||||
option: json['option'] as String?,
|
||||
isDefault: json['is_default'] as int?,
|
||||
);
|
||||
}
|
||||
39
lib/models/stein_edgeinfo/data.dart
Normal file
39
lib/models/stein_edgeinfo/data.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
import 'package:PiliPlus/models/stein_edgeinfo/edges.dart';
|
||||
import 'package:PiliPlus/models/stein_edgeinfo/preload.dart';
|
||||
import 'package:PiliPlus/models/stein_edgeinfo/story_list.dart';
|
||||
|
||||
class EdgeInfoData {
|
||||
String? title;
|
||||
int? edgeId;
|
||||
List<StoryList>? storyList;
|
||||
Edges? edges;
|
||||
String? buvid;
|
||||
Preload? preload;
|
||||
int? isLeaf;
|
||||
|
||||
EdgeInfoData({
|
||||
this.title,
|
||||
this.edgeId,
|
||||
this.storyList,
|
||||
this.edges,
|
||||
this.buvid,
|
||||
this.preload,
|
||||
this.isLeaf,
|
||||
});
|
||||
|
||||
factory EdgeInfoData.fromJson(Map<String, dynamic> json) => EdgeInfoData(
|
||||
title: json['title'] as String?,
|
||||
edgeId: json['edge_id'] as int?,
|
||||
storyList: (json['story_list'] as List<dynamic>?)
|
||||
?.map((e) => StoryList.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
edges: json['edges'] == null
|
||||
? null
|
||||
: Edges.fromJson(json['edges'] as Map<String, dynamic>),
|
||||
buvid: json['buvid'] as String?,
|
||||
preload: json['preload'] == null
|
||||
? null
|
||||
: Preload.fromJson(json['preload'] as Map<String, dynamic>),
|
||||
isLeaf: json['is_leaf'] as int?,
|
||||
);
|
||||
}
|
||||
15
lib/models/stein_edgeinfo/dimension.dart
Normal file
15
lib/models/stein_edgeinfo/dimension.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
class Dimension {
|
||||
int? width;
|
||||
int? height;
|
||||
int? rotate;
|
||||
String? sar;
|
||||
|
||||
Dimension({this.width, this.height, this.rotate, this.sar});
|
||||
|
||||
factory Dimension.fromJson(Map<String, dynamic> json) => Dimension(
|
||||
width: json['width'] as int?,
|
||||
height: json['height'] as int?,
|
||||
rotate: json['rotate'] as int?,
|
||||
sar: json['sar'] as String?,
|
||||
);
|
||||
}
|
||||
23
lib/models/stein_edgeinfo/edges.dart
Normal file
23
lib/models/stein_edgeinfo/edges.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:PiliPlus/models/stein_edgeinfo/dimension.dart';
|
||||
import 'package:PiliPlus/models/stein_edgeinfo/question.dart';
|
||||
import 'package:PiliPlus/models/stein_edgeinfo/skin.dart';
|
||||
|
||||
class Edges {
|
||||
Dimension? dimension;
|
||||
List<Question>? questions;
|
||||
Skin? skin;
|
||||
|
||||
Edges({this.dimension, this.questions, this.skin});
|
||||
|
||||
factory Edges.fromJson(Map<String, dynamic> json) => Edges(
|
||||
dimension: json['dimension'] == null
|
||||
? null
|
||||
: Dimension.fromJson(json['dimension'] as Map<String, dynamic>),
|
||||
questions: (json['questions'] as List<dynamic>?)
|
||||
?.map((e) => Question.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
skin: json['skin'] == null
|
||||
? null
|
||||
: Skin.fromJson(json['skin'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
13
lib/models/stein_edgeinfo/preload.dart
Normal file
13
lib/models/stein_edgeinfo/preload.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
import 'package:PiliPlus/models/stein_edgeinfo/video.dart';
|
||||
|
||||
class Preload {
|
||||
List<Video>? video;
|
||||
|
||||
Preload({this.video});
|
||||
|
||||
factory Preload.fromJson(Map<String, dynamic> json) => Preload(
|
||||
video: (json['video'] as List<dynamic>?)
|
||||
?.map((e) => Video.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
33
lib/models/stein_edgeinfo/question.dart
Normal file
33
lib/models/stein_edgeinfo/question.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:PiliPlus/models/stein_edgeinfo/choice.dart';
|
||||
|
||||
class Question {
|
||||
int? id;
|
||||
int? type;
|
||||
int? startTimeR;
|
||||
int? duration;
|
||||
int? pauseVideo;
|
||||
String? title;
|
||||
List<Choice>? choices;
|
||||
|
||||
Question({
|
||||
this.id,
|
||||
this.type,
|
||||
this.startTimeR,
|
||||
this.duration,
|
||||
this.pauseVideo,
|
||||
this.title,
|
||||
this.choices,
|
||||
});
|
||||
|
||||
factory Question.fromJson(Map<String, dynamic> json) => Question(
|
||||
id: json['id'] as int?,
|
||||
type: json['type'] as int?,
|
||||
startTimeR: json['start_time_r'] as int?,
|
||||
duration: json['duration'] as int?,
|
||||
pauseVideo: json['pause_video'] as int?,
|
||||
title: json['title'] as String?,
|
||||
choices: (json['choices'] as List<dynamic>?)
|
||||
?.map((e) => Choice.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
29
lib/models/stein_edgeinfo/skin.dart
Normal file
29
lib/models/stein_edgeinfo/skin.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
class Skin {
|
||||
String? choiceImage;
|
||||
String? titleTextColor;
|
||||
String? titleShadowColor;
|
||||
int? titleShadowOffsetY;
|
||||
int? titleShadowRadius;
|
||||
String? progressbarColor;
|
||||
String? progressbarShadowColor;
|
||||
|
||||
Skin({
|
||||
this.choiceImage,
|
||||
this.titleTextColor,
|
||||
this.titleShadowColor,
|
||||
this.titleShadowOffsetY,
|
||||
this.titleShadowRadius,
|
||||
this.progressbarColor,
|
||||
this.progressbarShadowColor,
|
||||
});
|
||||
|
||||
factory Skin.fromJson(Map<String, dynamic> json) => Skin(
|
||||
choiceImage: json['choice_image'] as String?,
|
||||
titleTextColor: json['title_text_color'] as String?,
|
||||
titleShadowColor: json['title_shadow_color'] as String?,
|
||||
titleShadowOffsetY: json['title_shadow_offset_y'] as int?,
|
||||
titleShadowRadius: json['title_shadow_radius'] as int?,
|
||||
progressbarColor: json['progressbar_color'] as String?,
|
||||
progressbarShadowColor: json['progressbar_shadow_color'] as String?,
|
||||
);
|
||||
}
|
||||
32
lib/models/stein_edgeinfo/story_list.dart
Normal file
32
lib/models/stein_edgeinfo/story_list.dart
Normal file
@@ -0,0 +1,32 @@
|
||||
class StoryList {
|
||||
int? nodeId;
|
||||
int? edgeId;
|
||||
String? title;
|
||||
int? cid;
|
||||
int? startPos;
|
||||
String? cover;
|
||||
int? isCurrent;
|
||||
int? cursor;
|
||||
|
||||
StoryList({
|
||||
this.nodeId,
|
||||
this.edgeId,
|
||||
this.title,
|
||||
this.cid,
|
||||
this.startPos,
|
||||
this.cover,
|
||||
this.isCurrent,
|
||||
this.cursor,
|
||||
});
|
||||
|
||||
factory StoryList.fromJson(Map<String, dynamic> json) => StoryList(
|
||||
nodeId: json['node_id'] as int?,
|
||||
edgeId: json['edge_id'] as int?,
|
||||
title: json['title'] as String?,
|
||||
cid: json['cid'] as int?,
|
||||
startPos: json['start_pos'] as int?,
|
||||
cover: json['cover'] as String?,
|
||||
isCurrent: json['is_current'] as int?,
|
||||
cursor: json['cursor'] as int?,
|
||||
);
|
||||
}
|
||||
11
lib/models/stein_edgeinfo/video.dart
Normal file
11
lib/models/stein_edgeinfo/video.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
class Video {
|
||||
int? aid;
|
||||
int? cid;
|
||||
|
||||
Video({this.aid, this.cid});
|
||||
|
||||
factory Video.fromJson(Map<String, dynamic> json) => Video(
|
||||
aid: json['aid'] as int?,
|
||||
cid: json['cid'] as int?,
|
||||
);
|
||||
}
|
||||
29
lib/models/triple/pgc_triple.dart
Normal file
29
lib/models/triple/pgc_triple.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
class PgcTriple {
|
||||
int? coin;
|
||||
int? coinNumber;
|
||||
int? favorite;
|
||||
int? fmid;
|
||||
int? follow;
|
||||
int? like;
|
||||
bool? relation;
|
||||
|
||||
PgcTriple({
|
||||
this.coin,
|
||||
this.coinNumber,
|
||||
this.favorite,
|
||||
this.fmid,
|
||||
this.follow,
|
||||
this.like,
|
||||
this.relation,
|
||||
});
|
||||
|
||||
factory PgcTriple.fromJson(Map<String, dynamic> json) => PgcTriple(
|
||||
coin: json["coin"],
|
||||
coinNumber: json["coin_number"],
|
||||
favorite: json["favorite"],
|
||||
fmid: json["fmid"],
|
||||
follow: json["follow"],
|
||||
like: json["like"],
|
||||
relation: json["relation"],
|
||||
);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user