mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: 代码整理
This commit is contained in:
@@ -184,8 +184,9 @@ class VideoDetailData {
|
||||
: List<dynamic>.from(descV2!.map((e) => e.toJson())),
|
||||
"state": state,
|
||||
"duration": duration,
|
||||
"rights":
|
||||
Map.from(rights!).map((k, v) => MapEntry<String, dynamic>(k, v)),
|
||||
"rights": rights == null
|
||||
? {}
|
||||
: Map.from(rights!).map((k, v) => MapEntry<String, dynamic>(k, v)),
|
||||
"owner": owner?.toJson(),
|
||||
"stat": stat?.toJson(),
|
||||
"dynamic": videoDynamic,
|
||||
|
||||
@@ -7,8 +7,8 @@ import 'package:PiliPalaX/utils/storage.dart';
|
||||
|
||||
class BangumiController extends GetxController {
|
||||
final ScrollController scrollController = ScrollController();
|
||||
RxList<BangumiListItemModel> bangumiList = [BangumiListItemModel()].obs;
|
||||
RxList<BangumiListItemModel> bangumiFollowList = [BangumiListItemModel()].obs;
|
||||
RxList<BangumiListItemModel> bangumiList = <BangumiListItemModel>[].obs;
|
||||
RxList<BangumiListItemModel> bangumiFollowList = <BangumiListItemModel>[].obs;
|
||||
int _currentPage = 1;
|
||||
bool isLoadingMore = true;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
|
||||
@@ -139,7 +139,7 @@ class BlackListController extends GetxController {
|
||||
int currentPage = 1;
|
||||
int pageSize = 50;
|
||||
RxInt total = 0.obs;
|
||||
RxList<BlackListItem> blackList = [BlackListItem()].obs;
|
||||
RxList<BlackListItem> blackList = <BlackListItem>[].obs;
|
||||
|
||||
Future queryBlacklist({type = 'init'}) async {
|
||||
if (type == 'init') {
|
||||
|
||||
@@ -20,7 +20,7 @@ import 'package:PiliPalaX/utils/utils.dart';
|
||||
class DynamicsController extends GetxController {
|
||||
int page = 1;
|
||||
String? offset = '';
|
||||
RxList<DynamicItemModel> dynamicsList = [DynamicItemModel()].obs;
|
||||
RxList<DynamicItemModel> dynamicsList = <DynamicItemModel>[].obs;
|
||||
Rx<DynamicsType> dynamicsType = DynamicsType.values[0].obs;
|
||||
RxString dynamicsTypeLabel = '全部'.obs;
|
||||
final ScrollController scrollController = ScrollController();
|
||||
|
||||
@@ -17,7 +17,7 @@ class DynamicDetailController extends GetxController {
|
||||
int currentPage = 0;
|
||||
bool isLoadingMore = false;
|
||||
RxString noMore = ''.obs;
|
||||
RxList<ReplyItemModel> replyList = [ReplyItemModel()].obs;
|
||||
RxList<ReplyItemModel> replyList = <ReplyItemModel>[].obs;
|
||||
RxInt acount = 0.obs;
|
||||
final ScrollController scrollController = ScrollController();
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class FansController extends GetxController {
|
||||
int pn = 1;
|
||||
int ps = 20;
|
||||
int total = 0;
|
||||
RxList<FansItemModel> fansList = [FansItemModel()].obs;
|
||||
RxList<FansItemModel> fansList = <FansItemModel>[].obs;
|
||||
late int mid;
|
||||
late String name;
|
||||
var userInfo;
|
||||
|
||||
@@ -7,7 +7,7 @@ class HotController extends GetxController {
|
||||
final ScrollController scrollController = ScrollController();
|
||||
final int _count = 20;
|
||||
int _currentPage = 1;
|
||||
RxList<HotVideoItemModel> videoList = [HotVideoItemModel()].obs;
|
||||
RxList<HotVideoItemModel> videoList = <HotVideoItemModel>[].obs;
|
||||
bool isLoadingMore = false;
|
||||
bool flag = false;
|
||||
OverlayEntry? popupDialog;
|
||||
|
||||
@@ -43,8 +43,8 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
plPlayerController!.dispose();
|
||||
floating?.dispose();
|
||||
plPlayerController!.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class MemberController extends GetxController {
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
late int ownerMid;
|
||||
// 投稿列表
|
||||
RxList<VListItemModel>? archiveList = [VListItemModel()].obs;
|
||||
RxList<VListItemModel>? archiveList = <VListItemModel>[].obs;
|
||||
dynamic userInfo;
|
||||
RxInt attribute = (-1).obs;
|
||||
RxString attributeText = '关注'.obs;
|
||||
|
||||
@@ -15,7 +15,7 @@ class SSearchController extends GetxController {
|
||||
Box histiryWord = GStrorage.historyword;
|
||||
List historyCacheList = [];
|
||||
RxList historyList = [].obs;
|
||||
RxList<SearchSuggestItem> searchSuggestList = [SearchSuggestItem()].obs;
|
||||
RxList<SearchSuggestItem> searchSuggestList = <SearchSuggestItem>[].obs;
|
||||
final _debouncer =
|
||||
Debouncer(delay: const Duration(milliseconds: 200)); // 设置延迟时间
|
||||
String hintText = '搜索';
|
||||
|
||||
@@ -22,7 +22,7 @@ class VideoReplyController extends GetxController {
|
||||
String? replyLevel;
|
||||
// rpid 请求楼中楼回复
|
||||
String? rpid;
|
||||
RxList<ReplyItemModel> replyList = [ReplyItemModel()].obs;
|
||||
RxList<ReplyItemModel> replyList = <ReplyItemModel>[].obs;
|
||||
// 当前页
|
||||
int currentPage = 0;
|
||||
bool isLoadingMore = false;
|
||||
|
||||
@@ -268,7 +268,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
(value) => {
|
||||
// 完成评论,数据添加
|
||||
if (value != null && value['data'] != null)
|
||||
{_videoReplyController.replyList.add(value['data'])}
|
||||
{_videoReplyController.replyList.insert(0, value['data'])}
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
@@ -12,7 +12,7 @@ class VideoReplyReplyController extends GetxController {
|
||||
// rpid 请求楼中楼回复
|
||||
String? rpid;
|
||||
ReplyType replyType = ReplyType.video;
|
||||
RxList<ReplyItemModel> replyList = [ReplyItemModel()].obs;
|
||||
RxList<ReplyItemModel> replyList = <ReplyItemModel>[].obs;
|
||||
// 当前页
|
||||
int currentPage = 0;
|
||||
bool isLoadingMore = false;
|
||||
|
||||
@@ -209,6 +209,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
videoDetailController.floating?.dispose();
|
||||
floating.dispose();
|
||||
if (!horizontalScreen) {
|
||||
AutoOrientation.portraitUpMode();
|
||||
}
|
||||
@@ -218,9 +220,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
fullScreenStatusListener.cancel();
|
||||
plPlayerController!.dispose();
|
||||
}
|
||||
videoDetailController.floating?.dispose();
|
||||
videoPlayerServiceHandler.onVideoDetailDispose();
|
||||
floating.dispose();
|
||||
_lifecycleListener.dispose();
|
||||
showStatusBar();
|
||||
super.dispose();
|
||||
|
||||
Reference in New Issue
Block a user