From e0fe2e29f2df97084059c3f30e49558125c2038e Mon Sep 17 00:00:00 2001 From: orz12 Date: Tue, 27 Feb 2024 13:44:28 +0800 Subject: [PATCH] =?UTF-8?q?mod:=20=E4=BB=A3=E7=A0=81=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/models/video_detail_res.dart | 5 +++-- lib/pages/bangumi/controller.dart | 4 ++-- lib/pages/blacklist/index.dart | 2 +- lib/pages/dynamics/controller.dart | 2 +- lib/pages/dynamics/detail/controller.dart | 2 +- lib/pages/fan/controller.dart | 2 +- lib/pages/hot/controller.dart | 2 +- lib/pages/live_room/view.dart | 2 +- lib/pages/member/controller.dart | 2 +- lib/pages/search/controller.dart | 2 +- lib/pages/video/detail/reply/controller.dart | 2 +- lib/pages/video/detail/reply/view.dart | 2 +- lib/pages/video/detail/reply_reply/controller.dart | 2 +- lib/pages/video/detail/view.dart | 4 ++-- 14 files changed, 18 insertions(+), 17 deletions(-) diff --git a/lib/models/video_detail_res.dart b/lib/models/video_detail_res.dart index 38e0b877..787df19c 100644 --- a/lib/models/video_detail_res.dart +++ b/lib/models/video_detail_res.dart @@ -184,8 +184,9 @@ class VideoDetailData { : List.from(descV2!.map((e) => e.toJson())), "state": state, "duration": duration, - "rights": - Map.from(rights!).map((k, v) => MapEntry(k, v)), + "rights": rights == null + ? {} + : Map.from(rights!).map((k, v) => MapEntry(k, v)), "owner": owner?.toJson(), "stat": stat?.toJson(), "dynamic": videoDynamic, diff --git a/lib/pages/bangumi/controller.dart b/lib/pages/bangumi/controller.dart index 3059f152..b8e6577d 100644 --- a/lib/pages/bangumi/controller.dart +++ b/lib/pages/bangumi/controller.dart @@ -7,8 +7,8 @@ import 'package:PiliPalaX/utils/storage.dart'; class BangumiController extends GetxController { final ScrollController scrollController = ScrollController(); - RxList bangumiList = [BangumiListItemModel()].obs; - RxList bangumiFollowList = [BangumiListItemModel()].obs; + RxList bangumiList = [].obs; + RxList bangumiFollowList = [].obs; int _currentPage = 1; bool isLoadingMore = true; Box userInfoCache = GStrorage.userInfo; diff --git a/lib/pages/blacklist/index.dart b/lib/pages/blacklist/index.dart index 53033878..54ed1eb3 100644 --- a/lib/pages/blacklist/index.dart +++ b/lib/pages/blacklist/index.dart @@ -139,7 +139,7 @@ class BlackListController extends GetxController { int currentPage = 1; int pageSize = 50; RxInt total = 0.obs; - RxList blackList = [BlackListItem()].obs; + RxList blackList = [].obs; Future queryBlacklist({type = 'init'}) async { if (type == 'init') { diff --git a/lib/pages/dynamics/controller.dart b/lib/pages/dynamics/controller.dart index 9500c935..d8278d1a 100644 --- a/lib/pages/dynamics/controller.dart +++ b/lib/pages/dynamics/controller.dart @@ -20,7 +20,7 @@ import 'package:PiliPalaX/utils/utils.dart'; class DynamicsController extends GetxController { int page = 1; String? offset = ''; - RxList dynamicsList = [DynamicItemModel()].obs; + RxList dynamicsList = [].obs; Rx dynamicsType = DynamicsType.values[0].obs; RxString dynamicsTypeLabel = '全部'.obs; final ScrollController scrollController = ScrollController(); diff --git a/lib/pages/dynamics/detail/controller.dart b/lib/pages/dynamics/detail/controller.dart index e337d61c..9d4a7192 100644 --- a/lib/pages/dynamics/detail/controller.dart +++ b/lib/pages/dynamics/detail/controller.dart @@ -17,7 +17,7 @@ class DynamicDetailController extends GetxController { int currentPage = 0; bool isLoadingMore = false; RxString noMore = ''.obs; - RxList replyList = [ReplyItemModel()].obs; + RxList replyList = [].obs; RxInt acount = 0.obs; final ScrollController scrollController = ScrollController(); diff --git a/lib/pages/fan/controller.dart b/lib/pages/fan/controller.dart index 310a5da1..29aad57f 100644 --- a/lib/pages/fan/controller.dart +++ b/lib/pages/fan/controller.dart @@ -10,7 +10,7 @@ class FansController extends GetxController { int pn = 1; int ps = 20; int total = 0; - RxList fansList = [FansItemModel()].obs; + RxList fansList = [].obs; late int mid; late String name; var userInfo; diff --git a/lib/pages/hot/controller.dart b/lib/pages/hot/controller.dart index ab0c31c3..c2b2dee8 100644 --- a/lib/pages/hot/controller.dart +++ b/lib/pages/hot/controller.dart @@ -7,7 +7,7 @@ class HotController extends GetxController { final ScrollController scrollController = ScrollController(); final int _count = 20; int _currentPage = 1; - RxList videoList = [HotVideoItemModel()].obs; + RxList videoList = [].obs; bool isLoadingMore = false; bool flag = false; OverlayEntry? popupDialog; diff --git a/lib/pages/live_room/view.dart b/lib/pages/live_room/view.dart index 84100e52..269a4868 100644 --- a/lib/pages/live_room/view.dart +++ b/lib/pages/live_room/view.dart @@ -43,8 +43,8 @@ class _LiveRoomPageState extends State { @override void dispose() { - plPlayerController!.dispose(); floating?.dispose(); + plPlayerController!.dispose(); super.dispose(); } diff --git a/lib/pages/member/controller.dart b/lib/pages/member/controller.dart index 175f5b17..c8dee6df 100644 --- a/lib/pages/member/controller.dart +++ b/lib/pages/member/controller.dart @@ -20,7 +20,7 @@ class MemberController extends GetxController { Box userInfoCache = GStrorage.userInfo; late int ownerMid; // 投稿列表 - RxList? archiveList = [VListItemModel()].obs; + RxList? archiveList = [].obs; dynamic userInfo; RxInt attribute = (-1).obs; RxString attributeText = '关注'.obs; diff --git a/lib/pages/search/controller.dart b/lib/pages/search/controller.dart index 41422733..08998c0f 100644 --- a/lib/pages/search/controller.dart +++ b/lib/pages/search/controller.dart @@ -15,7 +15,7 @@ class SSearchController extends GetxController { Box histiryWord = GStrorage.historyword; List historyCacheList = []; RxList historyList = [].obs; - RxList searchSuggestList = [SearchSuggestItem()].obs; + RxList searchSuggestList = [].obs; final _debouncer = Debouncer(delay: const Duration(milliseconds: 200)); // 设置延迟时间 String hintText = '搜索'; diff --git a/lib/pages/video/detail/reply/controller.dart b/lib/pages/video/detail/reply/controller.dart index 22d86339..49573069 100644 --- a/lib/pages/video/detail/reply/controller.dart +++ b/lib/pages/video/detail/reply/controller.dart @@ -22,7 +22,7 @@ class VideoReplyController extends GetxController { String? replyLevel; // rpid 请求楼中楼回复 String? rpid; - RxList replyList = [ReplyItemModel()].obs; + RxList replyList = [].obs; // 当前页 int currentPage = 0; bool isLoadingMore = false; diff --git a/lib/pages/video/detail/reply/view.dart b/lib/pages/video/detail/reply/view.dart index 61e59c82..c5518717 100644 --- a/lib/pages/video/detail/reply/view.dart +++ b/lib/pages/video/detail/reply/view.dart @@ -268,7 +268,7 @@ class _VideoReplyPanelState extends State (value) => { // 完成评论,数据添加 if (value != null && value['data'] != null) - {_videoReplyController.replyList.add(value['data'])} + {_videoReplyController.replyList.insert(0, value['data'])} }, ); }, diff --git a/lib/pages/video/detail/reply_reply/controller.dart b/lib/pages/video/detail/reply_reply/controller.dart index e8a1c798..bcc47fbb 100644 --- a/lib/pages/video/detail/reply_reply/controller.dart +++ b/lib/pages/video/detail/reply_reply/controller.dart @@ -12,7 +12,7 @@ class VideoReplyReplyController extends GetxController { // rpid 请求楼中楼回复 String? rpid; ReplyType replyType = ReplyType.video; - RxList replyList = [ReplyItemModel()].obs; + RxList replyList = [].obs; // 当前页 int currentPage = 0; bool isLoadingMore = false; diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index e46a1f01..3e1cae2e 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -209,6 +209,8 @@ class _VideoDetailPageState extends State @override void dispose() { + videoDetailController.floating?.dispose(); + floating.dispose(); if (!horizontalScreen) { AutoOrientation.portraitUpMode(); } @@ -218,9 +220,7 @@ class _VideoDetailPageState extends State fullScreenStatusListener.cancel(); plPlayerController!.dispose(); } - videoDetailController.floating?.dispose(); videoPlayerServiceHandler.onVideoDetailDispose(); - floating.dispose(); _lifecycleListener.dispose(); showStatusBar(); super.dispose();