diff --git a/lib/common/widgets/dialog/dialog.dart b/lib/common/widgets/dialog/dialog.dart index cefece90d..99823fd61 100644 --- a/lib/common/widgets/dialog/dialog.dart +++ b/lib/common/widgets/dialog/dialog.dart @@ -4,7 +4,7 @@ import 'package:get/get.dart'; void showConfirmDialog({ required BuildContext context, required String title, - Object? content, + dynamic content, required VoidCallback onConfirm, }) { showDialog( diff --git a/lib/common/widgets/image/image_save.dart b/lib/common/widgets/image/image_save.dart index 6e3374bfc..d9d77fdd7 100644 --- a/lib/common/widgets/image/image_save.dart +++ b/lib/common/widgets/image/image_save.dart @@ -10,7 +10,7 @@ import 'package:get/get.dart'; void imageSaveDialog({ required String? title, required String? cover, - Object? aid, + dynamic aid, String? bvid, }) { final double imgWidth = Get.mediaQuery.size.shortestSide - 8 * 2; diff --git a/lib/common/widgets/image/nine_grid_view.dart b/lib/common/widgets/image/nine_grid_view.dart index ffcd8c0fb..0174bcf5a 100644 --- a/lib/common/widgets/image/nine_grid_view.dart +++ b/lib/common/widgets/image/nine_grid_view.dart @@ -506,7 +506,7 @@ class _ImageUtil { ); } }, - onError: (exception, stackTrace) { + onError: (dynamic exception, StackTrace? stackTrace) { imageStream.removeListener(listener); if (!completer.isCompleted) { completer.completeError(exception, stackTrace); diff --git a/lib/common/widgets/loading_widget/loading_widget.dart b/lib/common/widgets/loading_widget/loading_widget.dart index ce9ec642e..3dc3ee6cc 100644 --- a/lib/common/widgets/loading_widget/loading_widget.dart +++ b/lib/common/widgets/loading_widget/loading_widget.dart @@ -6,17 +6,13 @@ Widget get loadingWidget => const Center(child: CircularProgressIndicator()); Widget get linearLoading => const SliverToBoxAdapter(child: LinearProgressIndicator()); -Widget errorWidget({String? errMsg, VoidCallback? onReload}) => HttpError( +Widget errorWidget({errMsg, onReload}) => HttpError( isSliver: false, errMsg: errMsg, onReload: onReload, ); -Widget scrollErrorWidget({ - String? errMsg, - VoidCallback? onReload, - ScrollController? controller, -}) => CustomScrollView( +Widget scrollErrorWidget({errMsg, onReload, controller}) => CustomScrollView( controller: controller, slivers: [ HttpError( diff --git a/lib/http/dynamics.dart b/lib/http/dynamics.dart index a7732a3fb..4e184713a 100644 --- a/lib/http/dynamics.dart +++ b/lib/http/dynamics.dart @@ -31,14 +31,14 @@ class DynamicsHttp { int? mid, Set? tempBannedList, }) async { - final data = { + Map data = { if (type == DynamicsTabType.up) - 'host_mid': mid! + 'host_mid': mid else ...{ 'type': type.name, 'timezone_offset': '-480', }, - 'offset': ?offset, + 'offset': offset, 'features': 'itemOpusStyle,listOnlyfans', }; var res = await Request().get(Api.followDynamic, queryParameters: data); @@ -120,11 +120,11 @@ class DynamicsHttp { } static Future createDynamic({ - Object? mid, - Object? dynIdStr, // repost dyn - Object? rid, // repost video - Object? dynType, - Object? rawText, + dynamic mid, + dynamic dynIdStr, // repost dyn + dynamic rid, // repost video + dynamic dynType, + dynamic rawText, List? pics, int? publishTime, ReplyOptionType? replyOption, @@ -213,9 +213,9 @@ class DynamicsHttp { // static Future dynamicDetail({ - Object? id, - Object? rid, - Object? type, + dynamic id, + dynamic rid, + dynamic type, bool clearCookie = false, }) async { var res = await Request().get( @@ -255,7 +255,7 @@ class DynamicsHttp { } static Future setTop({ - required Object dynamicId, + required dynamic dynamicId, }) async { var res = await Request().post( Api.setTopDyn, @@ -274,7 +274,7 @@ class DynamicsHttp { } static Future rmTop({ - required Object dynamicId, + required dynamic dynamicId, }) async { var res = await Request().post( Api.rmTopDyn, @@ -293,7 +293,7 @@ class DynamicsHttp { } static Future articleInfo({ - required Object cvId, + required dynamic cvId, }) async { var res = await Request().get( Api.articleInfo, @@ -315,7 +315,7 @@ class DynamicsHttp { } static Future> articleView({ - required Object cvId, + required dynamic cvId, }) async { final res = await Request().get( Api.articleView, @@ -333,7 +333,7 @@ class DynamicsHttp { } static Future> opusDetail({ - required Object opusId, + required dynamic opusId, }) async { final res = await Request().get( Api.opusDetail, @@ -350,7 +350,7 @@ class DynamicsHttp { } } - static Future> voteInfo(Object voteId) async { + static Future> voteInfo(dynamic voteId) async { final res = await Request().get( Api.voteInfo, queryParameters: {'vote_id': voteId}, @@ -392,9 +392,7 @@ class DynamicsHttp { } } - static Future> topicTop({ - required Object topicId, - }) async { + static Future> topicTop({required topicId}) async { final res = await Request().get( Api.topicTop, queryParameters: { @@ -413,7 +411,7 @@ class DynamicsHttp { } static Future> topicFeed({ - required Object topicId, + required topicId, required String offset, required int sortBy, }) async { @@ -440,7 +438,7 @@ class DynamicsHttp { } static Future> articleList({ - required Object id, + required id, }) async { final res = await Request().get( Api.articleList, @@ -457,10 +455,10 @@ class DynamicsHttp { } static Future dynReserve({ - required Object reserveId, - required Object curBtnStatus, - required Object dynamicIdStr, - required Object reserveTotal, + required reserveId, + required curBtnStatus, + required dynamicIdStr, + required reserveTotal, }) async { var res = await Request().post( Api.dynReserve, @@ -506,7 +504,7 @@ class DynamicsHttp { } } - static Future?>> dynPic(Object id) async { + static Future?>> dynPic(dynamic id) async { final res = await Request().get( Api.dynPic, queryParameters: { @@ -531,7 +529,7 @@ class DynamicsHttp { final res = await Request().get( Api.dynMention, queryParameters: { - if (keyword?.isNotEmpty == true) 'keyword': keyword!, + if (keyword?.isNotEmpty == true) 'keyword': keyword, 'web_location': 333.1365, }, ); @@ -621,7 +619,7 @@ class DynamicsHttp { } static Future> reserveInfo({ - required Object sid, + required dynamic sid, }) async { final res = await Request().get( Api.reserveInfo, diff --git a/lib/http/fan.dart b/lib/http/fan.dart index d1787fa55..3df1a5d80 100644 --- a/lib/http/fan.dart +++ b/lib/http/fan.dart @@ -5,8 +5,8 @@ import 'package:PiliPlus/models_new/fans/data.dart'; class FanHttp { static Future> fans({ - required int vmid, - required int pn, + int? vmid, + int? pn, int ps = 20, String? orderType, }) async { @@ -17,7 +17,7 @@ class FanHttp { 'pn': pn, 'ps': ps, 'order': 'desc', - 'order_type': ?orderType, + 'order_type': orderType, }, ); if (res.data['code'] == 0) { diff --git a/lib/http/fav.dart b/lib/http/fav.dart index 5e5447baf..dd682b102 100644 --- a/lib/http/fav.dart +++ b/lib/http/fav.dart @@ -18,7 +18,7 @@ import 'package:PiliPlus/utils/app_sign.dart'; import 'package:dio/dio.dart'; class FavHttp { - static Future favFavFolder(Object mediaId) async { + static Future favFavFolder(mediaId) async { var res = await Request().post( Api.favFavFolder, data: { @@ -34,7 +34,7 @@ class FavHttp { } } - static Future unfavFavFolder(Object mediaId) async { + static Future unfavFavFolder(mediaId) async { var res = await Request().post( Api.unfavFavFolder, data: { @@ -165,7 +165,7 @@ class FavHttp { } } - static Future addFavPugv(Object seasonId) async { + static Future addFavPugv(seasonId) async { var res = await Request().post( Api.addFavPugv, data: { @@ -181,7 +181,7 @@ class FavHttp { } } - static Future delFavPugv(Object seasonId) async { + static Future delFavPugv(seasonId) async { var res = await Request().post( Api.delFavPugv, data: { @@ -215,7 +215,7 @@ class FavHttp { } } - static Future addFavTopic(Object topicId) async { + static Future addFavTopic(topicId) async { var res = await Request().post( Api.addFavTopic, data: { @@ -231,7 +231,7 @@ class FavHttp { } } - static Future delFavTopic(Object topicId) async { + static Future delFavTopic(topicId) async { var res = await Request().post( Api.delFavTopic, data: { @@ -247,7 +247,7 @@ class FavHttp { } } - static Future likeTopic(Object topicId, bool isLike) async { + static Future likeTopic(topicId, bool isLike) async { var res = await Request().post( Api.likeTopic, data: { @@ -284,7 +284,7 @@ class FavHttp { } static Future addFavArticle({ - required Object id, + required dynamic id, }) async { var res = await Request().post( Api.addFavArticle, @@ -304,7 +304,7 @@ class FavHttp { } static Future delFavArticle({ - required Object id, + required dynamic id, }) async { var res = await Request().post( Api.delFavArticle, @@ -387,7 +387,7 @@ class FavHttp { } static Future> favPgc({ - required Object mid, + required dynamic mid, required int type, required int pn, int? followStatus, @@ -412,7 +412,7 @@ class FavHttp { static Future> userfavFolder({ required int pn, required int ps, - required Object mid, + required dynamic mid, }) async { var res = await Request().get( Api.userFavFolder, @@ -452,7 +452,7 @@ class FavHttp { } static Future sortFav({ - required Object mediaId, + required dynamic mediaId, required String sort, }) async { Map data = { @@ -476,7 +476,7 @@ class FavHttp { } static Future cleanFav({ - required Object mediaId, + required dynamic mediaId, }) async { var res = await Request().post( Api.cleanFav, @@ -519,7 +519,7 @@ class FavHttp { static Future addOrEditFolder({ required bool isAdd, - Object? mediaId, + dynamic mediaId, required String title, required int privacy, required String cover, @@ -547,7 +547,7 @@ class FavHttp { } static Future favFolderInfo({ - required Object mediaId, + dynamic mediaId, }) async { var res = await Request().get( Api.favFolderInfo, @@ -564,7 +564,7 @@ class FavHttp { static Future seasonFav({ required bool isFav, - required Object seasonId, + required dynamic seasonId, }) async { var res = await Request().post( isFav ? Api.unfavSeason : Api.favSeason, @@ -625,8 +625,8 @@ class FavHttp { } static Future communityAction({ - required Object opusId, - required Object action, + required dynamic opusId, + required dynamic action, }) async { var res = await Request().post( Api.communityAction, @@ -673,8 +673,8 @@ class FavHttp { // (取消)收藏 static Future unfavAll({ - required Object rid, - required Object type, + required rid, + required type, }) async { var res = await Request().post( Api.unfavAll, @@ -695,9 +695,9 @@ class FavHttp { static Future copyOrMoveFav({ required bool isCopy, required bool isFav, - required Object? srcMediaId, - required Object tarMediaId, - mid, + required dynamic srcMediaId, + required dynamic tarMediaId, + dynamic mid, required String resources, }) async { var res = await Request().post( @@ -709,7 +709,7 @@ class FavHttp { ? Api.copyToview : Api.moveToview, data: { - 'src_media_id': srcMediaId, + 'src_media_id': ?srcMediaId, 'tar_media_id': tarMediaId, 'mid': ?mid, 'resources': resources, @@ -739,9 +739,9 @@ class FavHttp { // 查看视频被收藏在哪个文件夹 static Future> videoInFolder({ - required Object mid, - required Object rid, - Object? type, + dynamic mid, + dynamic rid, + dynamic type, }) async { var res = await Request().get( Api.favFolder, diff --git a/lib/http/follow.dart b/lib/http/follow.dart index 78337acfc..46b3e426a 100644 --- a/lib/http/follow.dart +++ b/lib/http/follow.dart @@ -5,8 +5,8 @@ import 'package:PiliPlus/models_new/follow/data.dart'; class FollowHttp { static Future> followings({ - required int vmid, - required int pn, + int? vmid, + int? pn, int ps = 20, String orderType = '', // ''=>最近关注,'attention'=>最常访问 }) async { diff --git a/lib/http/init.dart b/lib/http/init.dart index cb5eeb97c..3606f85af 100644 --- a/lib/http/init.dart +++ b/lib/http/init.dart @@ -181,7 +181,7 @@ class Request { */ Future get( String url, { - Map? queryParameters, + Map? queryParameters, Options? options, CancelToken? cancelToken, }) async { @@ -209,7 +209,7 @@ class Request { Future post( String url, { Object? data, - Map? queryParameters, + Map? queryParameters, Options? options, CancelToken? cancelToken, }) async { diff --git a/lib/http/live.dart b/lib/http/live.dart index 5b89ad5e3..5164f56bb 100644 --- a/lib/http/live.dart +++ b/lib/http/live.dart @@ -24,12 +24,7 @@ import 'package:PiliPlus/utils/wbi_sign.dart'; import 'package:dio/dio.dart'; class LiveHttp { - static Future sendLiveMsg({ - required Object roomId, - required Object msg, - Object? dmType, - Object? emoticonOptions, - }) async { + static Future sendLiveMsg({roomId, msg, dmType, emoticonOptions}) async { String csrf = Accounts.main.csrf; var res = await Request().post( Api.sendLiveMsg, @@ -71,11 +66,7 @@ class LiveHttp { } } - static Future liveRoomInfo({ - required Object roomId, - Object? qn, - bool onlyAudio = false, - }) async { + static Future liveRoomInfo({roomId, qn, bool onlyAudio = false}) async { var res = await Request().get( Api.liveRoomInfo, queryParameters: { @@ -83,7 +74,7 @@ class LiveHttp { 'protocol': '0, 1', 'format': '0, 1, 2', 'codec': '0, 1', - 'qn': ?qn, + 'qn': qn, 'platform': 'web', 'ptype': 8, 'dolby': 5, @@ -101,7 +92,7 @@ class LiveHttp { } } - static Future liveRoomInfoH5({required Object roomId}) async { + static Future liveRoomInfoH5({roomId, qn}) async { var res = await Request().get( Api.liveRoomInfoH5, queryParameters: { @@ -118,7 +109,7 @@ class LiveHttp { } } - static Future liveRoomDanmaPrefetch({required Object roomId}) async { + static Future liveRoomDanmaPrefetch({roomId}) async { var res = await Request().get( Api.liveRoomDmPrefetch, queryParameters: {'roomid': roomId}, @@ -136,7 +127,7 @@ class LiveHttp { } } - static Future liveRoomGetDanmakuToken({required Object roomId}) async { + static Future liveRoomGetDanmakuToken({roomId}) async { var res = await Request().get( Api.liveRoomDmToken, queryParameters: await WbiSign.makSign({ @@ -177,7 +168,7 @@ class LiveHttp { bool? moduleSelect, }) async { final params = { - if (isLogin) 'access_key': Accounts.main.accessKey!, + if (isLogin) 'access_key': Accounts.main.accessKey, 'appkey': Constants.appKey, 'channel': 'master', 'actionKey': 'appkey', @@ -254,12 +245,12 @@ class LiveHttp { static Future> liveSecondList({ required int pn, required bool isLogin, - required Object? areaId, - required Object? parentAreaId, + required areaId, + required parentAreaId, String? sortType, }) async { final params = { - if (isLogin) 'access_key': Accounts.main.accessKey!, + if (isLogin) 'access_key': Accounts.main.accessKey, 'appkey': Constants.appKey, 'actionKey': 'appkey', 'channel': 'master', @@ -325,7 +316,7 @@ class LiveHttp { required bool isLogin, }) async { final params = { - if (isLogin) 'access_key': Accounts.main.accessKey!, + if (isLogin) 'access_key': Accounts.main.accessKey, 'appkey': Constants.appKey, 'actionKey': 'appkey', 'build': 8430300, @@ -364,7 +355,7 @@ class LiveHttp { required bool isLogin, }) async { final params = { - if (isLogin) 'access_key': Accounts.main.accessKey!, + if (isLogin) 'access_key': Accounts.main.accessKey, 'appkey': Constants.appKey, 'actionKey': 'appkey', 'build': 8430300, @@ -441,10 +432,10 @@ class LiveHttp { static Future?>> liveRoomAreaList({ required bool isLogin, - required Object parentid, + required parentid, }) async { final params = { - if (isLogin) 'access_key': Accounts.main.accessKey!, + if (isLogin) 'access_key': Accounts.main.accessKey, 'appkey': Constants.appKey, 'actionKey': 'appkey', 'build': 8430300, @@ -487,7 +478,7 @@ class LiveHttp { required LiveSearchType type, }) async { final params = { - if (isLogin) 'access_key': Accounts.main.accessKey!, + if (isLogin) 'access_key': Accounts.main.accessKey, 'appkey': Constants.appKey, 'actionKey': 'appkey', 'build': 8430300, @@ -523,7 +514,7 @@ class LiveHttp { } static Future> getLiveInfoByUser( - Object roomId, + dynamic roomId, ) async { var res = await Request().get( Api.getLiveInfoByUser, @@ -604,8 +595,8 @@ class LiveHttp { } static Future liveShieldUser({ - required Object uid, - required Object roomid, + required dynamic uid, + required dynamic roomid, required int type, }) async { final csrf = Accounts.main.csrf; @@ -629,9 +620,9 @@ class LiveHttp { static Future liveLikeReport({ required int clickTime, - required Object roomId, - required Object uid, - Object? anchorId, + required dynamic roomId, + required dynamic uid, + required dynamic anchorId, }) async { var res = await Request().post( Api.liveLikeReport, @@ -639,7 +630,7 @@ class LiveHttp { 'click_time': clickTime, 'room_id': roomId, 'uid': uid, - 'anchor_id': ?anchorId, + 'anchor_id': anchorId, 'web_location': 444.8, 'csrf': Accounts.heartbeat.csrf, }), diff --git a/lib/http/match.dart b/lib/http/match.dart index 6d7dad2dc..0a5ebc670 100644 --- a/lib/http/match.dart +++ b/lib/http/match.dart @@ -5,7 +5,7 @@ import 'package:PiliPlus/models_new/match/match_info/contest.dart'; import 'package:PiliPlus/models_new/match/match_info/data.dart'; class MatchHttp { - static Future> matchInfo(Object cid) async { + static Future> matchInfo(dynamic cid) async { var res = await Request().get( Api.matchInfo, queryParameters: { diff --git a/lib/http/member.dart b/lib/http/member.dart index 3f95fc830..f23efca1c 100644 --- a/lib/http/member.dart +++ b/lib/http/member.dart @@ -31,7 +31,7 @@ import 'package:dio/dio.dart'; class MemberHttp { static Future reportMember( - Object mid, { + dynamic mid, { String? reason, int? reasonV2, }) async { @@ -86,7 +86,7 @@ class MemberHttp { } static Future> seasonSeriesList({ - required int mid, + required int? mid, required int pn, }) async { var res = await Request().get( @@ -108,7 +108,7 @@ class MemberHttp { static Future> spaceArchive({ required ContributeType type, - required int mid, + required int? mid, String? aid, String? order, String? sort, @@ -116,7 +116,7 @@ class MemberHttp { int? next, int? seasonId, int? seriesId, - Object? includeCursor, + includeCursor, }) async { final params = { 'aid': ?aid, @@ -205,13 +205,13 @@ class MemberHttp { } static Future spaceStory({ - required Object mid, - required Object aid, - required Object beforeSize, - required Object afterSize, - required Object cid, - required Object contain, - required Object index, + required mid, + required aid, + required beforeSize, + required afterSize, + required cid, + required contain, + required index, }) async { final params = { 'aid': aid, @@ -248,8 +248,8 @@ class MemberHttp { } static Future> space({ - required int mid, - Object? fromViewAid, + int? mid, + dynamic fromViewAid, }) async { final params = { 'build': 8430300, @@ -281,7 +281,7 @@ class MemberHttp { } static Future memberInfo({ - required int mid, + int? mid, String token = '', }) async { String dmImgStr = Utils.base64EncodeRandomString(16, 64); @@ -317,7 +317,7 @@ class MemberHttp { } } - static Future memberStat({required int mid}) async { + static Future memberStat({int? mid}) async { var res = await Request().get(Api.userStat, queryParameters: {'vmid': mid}); if (res.data['code'] == 0) { return {'status': true, 'data': res.data['data']}; @@ -326,7 +326,7 @@ class MemberHttp { } } - static Future memberCardInfo({required int mid}) async { + static Future memberCardInfo({int? mid}) async { var res = await Request().get( Api.memberCardInfo, queryParameters: { @@ -345,7 +345,7 @@ class MemberHttp { } static Future> searchArchive({ - required Object mid, + required mid, int ps = 30, int tid = 0, int? pn, @@ -359,7 +359,7 @@ class MemberHttp { 'mid': mid, 'ps': ps, 'tid': tid, - 'pn': ?pn, + 'pn': pn, 'keyword': ?keyword, 'order': order, 'platform': 'web', @@ -394,7 +394,7 @@ class MemberHttp { // 用户动态 static Future> memberDynamic({ String? offset, - required int mid, + int? mid, }) async { String dmImgStr = Utils.base64EncodeRandomString(16, 64); String dmCoverImgStr = Utils.base64EncodeRandomString(32, 128); @@ -431,8 +431,8 @@ class MemberHttp { // 搜索用户动态 static Future memberDynamicSearch({ required int pn, - required Object mid, - required Object offset, + required dynamic mid, + required dynamic offset, required String keyword, }) async { var res = await Request().get( @@ -461,8 +461,8 @@ class MemberHttp { static Future> dynSearch({ required int pn, - required Object mid, - required Object offset, + required dynamic mid, + required dynamic offset, required String keyword, }) async { var res = await Request().get( @@ -545,14 +545,14 @@ class MemberHttp { // 获取某分组下的up static Future> followUpGroup({ int? mid, - required int tagid, - required int pn, + int? tagid, + int? pn, int ps = 20, }) async { var res = await Request().get( Api.followUpGroup, queryParameters: { - 'mid': ?mid, + 'mid': mid, 'tagid': tagid, 'pn': pn, 'ps': ps, @@ -573,7 +573,7 @@ class MemberHttp { } } - static Future createFollowTag(Object tagName) async { + static Future createFollowTag(tagName) async { var res = await Request().post( Api.createFollowTag, queryParameters: { @@ -593,7 +593,7 @@ class MemberHttp { } } - static Future updateFollowTag(Object tagid, Object name) async { + static Future updateFollowTag(tagid, name) async { var res = await Request().post( Api.updateFollowTag, queryParameters: { @@ -614,7 +614,7 @@ class MemberHttp { } } - static Future delFollowTag(Object tagid) async { + static Future delFollowTag(tagid) async { var res = await Request().post( Api.delFollowTag, queryParameters: { @@ -669,7 +669,7 @@ class MemberHttp { required int pn, required String name, }) async { - final data = { + Map data = { 'vmid': mid, 'pn': pn, 'ps': ps, @@ -679,10 +679,14 @@ class MemberHttp { 'name': name, 'web_location': 333.999, }; - await WbiSign.makSign(data); + Map params = await WbiSign.makSign(data); var res = await Request().get( Api.followSearch, - queryParameters: data, + queryParameters: { + ...data, + 'w_rid': params['w_rid'], + 'wts': params['wts'], + }, ); if (res.data['code'] == 0) { return Success(FollowData.fromJson(res.data['data'])); @@ -715,7 +719,7 @@ class MemberHttp { } static Future> upowerRank({ - required Object upMid, + required upMid, required int page, int? privilegeType, }) async { diff --git a/lib/http/msg.dart b/lib/http/msg.dart index 4aa4569cd..1ea4dbaab 100644 --- a/lib/http/msg.dart +++ b/lib/http/msg.dart @@ -86,7 +86,7 @@ class MsgHttp { } static Future> msgLikeDetail({ - required Object cardId, + required dynamic cardId, required int pn, }) async { var res = await Request().get( @@ -155,7 +155,7 @@ class MsgHttp { } static Future uploadImage({ - required String path, + required dynamic path, required String bucket, required String dir, }) async { @@ -211,7 +211,7 @@ class MsgHttp { } static Future createTextDynamic( - Object content, + dynamic content, ) async { String csrf = Accounts.main.csrf; Map data = await WbiSign.makSign({ @@ -237,11 +237,7 @@ class MsgHttp { } } - static Future removeDynamic({ - required Object dynIdStr, - Object? dynType, - Object? ridStr, - }) async { + static Future removeDynamic({required dynIdStr, dynType, ridStr}) async { var res = await Request().post( Api.removeDynamic, queryParameters: { @@ -262,7 +258,7 @@ class MsgHttp { } static Future removeMsg( - Object talkerId, + dynamic talkerId, ) async { String csrf = Accounts.main.csrf; Map data = await WbiSign.makSign({ @@ -287,7 +283,7 @@ class MsgHttp { static Future delMsgfeed( int tp, - Object id, + dynamic id, ) async { String csrf = Accounts.main.csrf; var res = await Request().post( @@ -313,7 +309,7 @@ class MsgHttp { } static Future delSysMsg( - Object id, + dynamic id, ) async { String csrf = Accounts.main.csrf; var res = await Request().post( @@ -341,7 +337,7 @@ class MsgHttp { } static Future setTop({ - required Object talkerId, + required dynamic talkerId, required int opType, }) async { String csrf = Accounts.main.csrf; @@ -371,8 +367,8 @@ class MsgHttp { // 消息标记已读 static Future ackSessionMsg({ - required int talkerId, - required int ackSeqno, + int? talkerId, + int? ackSeqno, }) async { String csrf = Accounts.main.csrf; final params = await WbiSign.makSign({ @@ -403,14 +399,14 @@ class MsgHttp { // 发送私信 static Future sendMsg({ - required int senderUid, - required int receiverId, + int? senderUid, + int? receiverId, int? msgType, - required Object content, + dynamic content, }) async { String csrf = Accounts.main.csrf; final devId = getDevId(); - final data = { + Map data = { 'msg': { 'sender_uid': senderUid, 'receiver_id': receiverId, @@ -428,15 +424,15 @@ class MsgHttp { 'csrf_token': csrf, 'csrf': csrf, }; - final params = await WbiSign.makSign(data); + Map params = await WbiSign.makSign(data); var res = await Request().post( Api.sendMsg, - queryParameters: { + queryParameters: { 'w_sender_uid': senderUid, 'w_receiver_id': receiverId, 'w_dev_id': devId, - 'w_rid': params['w_rid']!, - 'wts': params['wts']!, + 'w_rid': params['w_rid'], + 'wts': params['wts'], }, data: data, options: Options( @@ -458,7 +454,7 @@ class MsgHttp { } static Future msgSetNotice({ - required Object id, + required dynamic id, required int noticeState, }) async { final csrf = Accounts.main.csrf; @@ -486,9 +482,9 @@ class MsgHttp { } static Future setMsgDnd({ - required Object uid, + required uid, required int setting, - required Object dndUid, + required dndUid, }) async { final csrf = Accounts.main.csrf; var res = await Request().post( @@ -561,7 +557,7 @@ class MsgHttp { } static Future> getSessionSs({ - required Object talkerUid, + required talkerUid, }) async { final csrf = Accounts.main.csrf; var res = await Request().get( @@ -582,7 +578,7 @@ class MsgHttp { } static Future?>> getMsgDnd({ - required Object uidsStr, + required uidsStr, }) async { final csrf = Accounts.main.csrf; var res = await Request().get( diff --git a/lib/http/pgc.dart b/lib/http/pgc.dart index 7032d6de0..83f40baee 100644 --- a/lib/http/pgc.dart +++ b/lib/http/pgc.dart @@ -15,9 +15,9 @@ class PgcHttp { static Future> pgcIndexResult({ required int page, required Map params, - Object? seasonType, - Object? type, - Object? indexType, + seasonType, + type, + indexType, }) async { var res = await Request().get( Api.pgcIndexResult, @@ -38,15 +38,15 @@ class PgcHttp { } static Future> pgcIndexCondition({ - Object? seasonType, - required Object type, - Object? indexType, + seasonType, + type, + indexType, }) async { var res = await Request().get( Api.pgcIndexCondition, queryParameters: { 'season_type': ?seasonType, - 'type': type, + 'type': ?type, 'index_type': ?indexType, }, ); @@ -58,7 +58,7 @@ class PgcHttp { } static Future?>> pgcIndex({ - required int page, + int? page, int? indexType, }) async { var res = await Request().get( @@ -119,8 +119,8 @@ class PgcHttp { } static Future pgcReviewLike({ - required Object mediaId, - required Object reviewId, + required mediaId, + required reviewId, }) async { var res = await Request().post( Api.pgcReviewLike, @@ -140,8 +140,8 @@ class PgcHttp { } static Future pgcReviewDislike({ - required Object mediaId, - required Object reviewId, + required mediaId, + required reviewId, }) async { var res = await Request().post( Api.pgcReviewDislike, @@ -161,7 +161,7 @@ class PgcHttp { } static Future pgcReviewPost({ - required Object mediaId, + required mediaId, required int score, required String content, bool shareFeed = false, @@ -185,10 +185,10 @@ class PgcHttp { } static Future pgcReviewMod({ - required Object mediaId, + required mediaId, required int score, required String content, - required Object reviewId, + required reviewId, }) async { var res = await Request().post( Api.pgcReviewMod, @@ -209,8 +209,8 @@ class PgcHttp { } static Future pgcReviewDel({ - required Object mediaId, - required Object reviewId, + required mediaId, + required reviewId, }) async { var res = await Request().post( Api.pgcReviewDel, diff --git a/lib/http/reply.dart b/lib/http/reply.dart index 990092993..9a6cbc129 100644 --- a/lib/http/reply.dart +++ b/lib/http/reply.dart @@ -25,7 +25,7 @@ class ReplyHttp { required int page, int sort = 1, required bool antiGoodsReply, - // bool? enableFilter, + bool? enableFilter, }) async { var res = !isLogin ? await Request().get( @@ -248,9 +248,9 @@ class ReplyHttp { } static Future replyTop({ - required Object oid, - required Object type, - required Object rpid, + required oid, + required type, + required rpid, required bool isUpTop, }) async { var res = await Request().post( diff --git a/lib/http/search.dart b/lib/http/search.dart index e86dce6c1..0a4a35a3c 100644 --- a/lib/http/search.dart +++ b/lib/http/search.dart @@ -43,7 +43,7 @@ class SearchHttp { static Future> searchByType({ required SearchType searchType, required String keyword, - required Object page, + required page, String? order, int? duration, int? tids, @@ -53,11 +53,11 @@ class SearchHttp { int? pubBegin, int? pubEnd, }) async { - final params = { + var params = { 'search_type': searchType.name, 'keyword': keyword, 'page': page, - if (order?.isNotEmpty == true) 'order': order!, + if (order?.isNotEmpty == true) 'order': order, 'duration': ?duration, 'tids': ?tids, 'order_sort': ?orderSort, @@ -107,7 +107,7 @@ class SearchHttp { static Future> searchAll({ required String keyword, - required Object page, + required page, String? order, int? duration, int? tids, @@ -117,10 +117,10 @@ class SearchHttp { int? pubBegin, int? pubEnd, }) async { - final params = { + var params = { 'keyword': keyword, 'page': page, - if (order?.isNotEmpty == true) 'order': order!, + if (order?.isNotEmpty == true) 'order': order, 'duration': ?duration, 'tids': ?tids, 'order_sort': ?orderSort, @@ -129,7 +129,7 @@ class SearchHttp { 'pubtime_begin_s': ?pubBegin, 'pubtime_end_s': ?pubEnd, }; - final res = await Request().get( + var res = await Request().get( Api.searchAll, queryParameters: params, ); @@ -148,8 +148,7 @@ class SearchHttp { } } - static Future ab2c({Object? aid, Object? bvid, int? part}) async { - assert(aid != null || bvid != null); + static Future ab2c({dynamic aid, dynamic bvid, int? part}) async { var res = await Request().get( Api.ab2c, queryParameters: { @@ -172,10 +171,9 @@ class SearchHttp { } static Future> pgcInfo({ - Object? seasonId, - Object? epId, + dynamic seasonId, + dynamic epId, }) async { - assert(seasonId != null || epId != null); var res = await Request().get( Api.pgcInfo, queryParameters: { @@ -191,10 +189,9 @@ class SearchHttp { } static Future> pugvInfo({ - Object? seasonId, - Object? epId, + dynamic seasonId, + dynamic epId, }) async { - assert(seasonId != null || epId != null); var res = await Request().get( Api.pugvInfo, queryParameters: { @@ -209,11 +206,11 @@ class SearchHttp { } } - static Future episodeInfo({required Object epId}) async { + static Future episodeInfo({dynamic epId}) async { var res = await Request().get( Api.episodeInfo, queryParameters: { - 'ep_id': epId, + 'ep_id': ?epId, }, ); if (res.data['code'] == 0) { diff --git a/lib/http/user.dart b/lib/http/user.dart index 7d8829fe5..002375470 100644 --- a/lib/http/user.dart +++ b/lib/http/user.dart @@ -150,8 +150,7 @@ class UserHttp { } // 稍后再看 - static Future toViewLater({String? bvid, Object? aid}) async { - assert(aid != null || bvid != null); + static Future toViewLater({String? bvid, dynamic aid}) async { var res = await Request().post( Api.toViewLater, data: { @@ -319,14 +318,14 @@ class UserHttp { // 稍后再看列表 static Future getMediaList({ - required Object type, - required Object bizId, + required dynamic type, + required bizId, required int ps, - Object? oid, + dynamic oid, int? otype, bool withCurrent = false, bool desc = true, - sortField = 1, + dynamic sortField = 1, bool direction = false, }) async { var res = await Request().get( @@ -362,8 +361,8 @@ class UserHttp { } static Future dynamicReport({ - required Object mid, - required Object dynId, + required dynamic mid, + required dynamic dynId, required int reasonType, String? reasonDesc, }) async { @@ -397,7 +396,7 @@ class UserHttp { } } - static Future spaceSettingMod(Map data) async { + static Future spaceSettingMod(data) async { final res = await Request().post( Api.spaceSettingMod, queryParameters: { diff --git a/lib/http/validate.dart b/lib/http/validate.dart index c7243c7b8..69530ca0f 100644 --- a/lib/http/validate.dart +++ b/lib/http/validate.dart @@ -25,10 +25,10 @@ class ValidateHttp { } static Future gaiaVgateValidate({ - required Object? challenge, - required Object? seccode, - required Object? token, - required Object? validate, + required challenge, + required seccode, + required token, + required validate, }) async { final res = await Request().post( Api.gaiaVgateValidate, diff --git a/lib/http/video.dart b/lib/http/video.dart index 2f3a829d4..c92bfaa52 100644 --- a/lib/http/video.dart +++ b/lib/http/video.dart @@ -39,7 +39,7 @@ class VideoHttp { static bool enableFilter = zoneRegExp.pattern.isNotEmpty; // 首页推荐视频 - static Future>> rcmdVideoList({ + static Future rcmdVideoList({ required int ps, required int freshIdx, }) async { @@ -75,9 +75,7 @@ class VideoHttp { } // 添加额外的loginState变量模拟未登录状态 - static Future>> rcmdVideoListApp({ - required int freshIdx, - }) async { + static Future rcmdVideoListApp({required int freshIdx}) async { final params = { 'build': 2001100, 'c_locale': 'zh_CN', @@ -193,8 +191,8 @@ class VideoHttp { String? bvid, required int cid, int? qn, - Object? epid, - Object? seasonId, + dynamic epid, + dynamic seasonId, required bool tryLook, required VideoType videoType, }) async { @@ -282,7 +280,7 @@ class VideoHttp { } } - static Future videoRelation({required String bvid}) async { + static Future videoRelation({required dynamic bvid}) async { var res = await Request().get( Api.videoRelation, queryParameters: { @@ -325,7 +323,7 @@ class VideoHttp { } // 获取点赞/投币/收藏状态 pgc - static Future pgcLikeCoinFav({required Object epId}) async { + static Future pgcLikeCoinFav({dynamic epId}) async { var res = await Request().get( Api.pgcLikeCoinFav, queryParameters: {'ep_id': epId}, @@ -362,10 +360,7 @@ class VideoHttp { } // 一键三连 pgc - static Future pgcTriple({ - required Object epId, - Object? seasonId, - }) async { + static Future pgcTriple({dynamic epId, required dynamic seasonId}) async { var res = await Request().post( Api.pgcTriple, data: { @@ -376,10 +371,7 @@ class VideoHttp { contentType: Headers.formUrlEncodedContentType, headers: { 'origin': 'https://www.bilibili.com', - if (seasonId != null) - 'referer': 'https://www.bilibili.com/bangumi/play/ss$seasonId', - if (seasonId == null) - 'referer': 'https://www.bilibili.com/bangumi/play/ep$epId', + 'referer': 'https://www.bilibili.com/bangumi/play/ss$seasonId', 'user-agent': UaType.pc.ua, }, ), @@ -635,7 +627,7 @@ class VideoHttp { } static Future roomEntryAction({ - required Object roomId, + roomId, }) async { await Request().post( Api.roomEntryAction, @@ -650,14 +642,14 @@ class VideoHttp { } static Future historyReport({ - required Object aid, - required Object type, + aid, + type, }) async { await Request().post( Api.historyReport, data: { - 'aid': aid, - 'type': type, + 'aid': ?aid, + 'type': ?type, 'csrf': Accounts.heartbeat.csrf, }, options: Options(contentType: Headers.formUrlEncodedContentType), @@ -666,13 +658,13 @@ class VideoHttp { // 视频播放进度 static Future heartBeat({ - Object? aid, - Object? bvid, - required Object cid, - required Object progress, - Object? epid, - Object? seasonId, - Object? subType, + aid, + bvid, + cid, + progress, + epid, + seasonId, + subType, required VideoType videoType, }) async { final isPugv = videoType == VideoType.pugv; @@ -694,8 +686,8 @@ class VideoHttp { static Future medialistHistory({ required int desc, - required Object oid, - required Object upperMid, + required dynamic oid, + required dynamic upperMid, }) async { await Request().post( Api.mediaListHistory, @@ -787,13 +779,12 @@ class VideoHttp { } // 查看视频同时在看人数 - static Future onlineTotal({int? aid, String? bvid, required int cid}) async { - assert(aid != null || bvid != null); + static Future onlineTotal({int? aid, String? bvid, int? cid}) async { var res = await Request().get( Api.onlineTotal, queryParameters: { - 'aid': ?aid, - 'bvid': ?bvid, + 'aid': aid, + 'bvid': bvid, 'cid': cid, }, ); @@ -805,14 +796,14 @@ class VideoHttp { } static Future aiConclusion({ - required String bvid, - required int cid, + String? bvid, + int? cid, int? upMid, }) async { final params = await WbiSign.makSign({ 'bvid': bvid, 'cid': cid, - 'up_mid': ?upMid, + 'up_mid': upMid, }); var res = await Request().get(Api.aiConclusion, queryParameters: params); if (res.data['code'] == 0 && res.data['data']['code'] == 0) { @@ -912,7 +903,7 @@ class VideoHttp { } // pgc 排行 - static Future?>> pgcRankList({ + static Future pgcRankList({ int day = 3, required int seasonType, }) async { @@ -935,7 +926,7 @@ class VideoHttp { } // pgc season 排行 - static Future?>> pgcSeasonRankList({ + static Future pgcSeasonRankList({ int day = 3, required int seasonType, }) async { @@ -958,8 +949,8 @@ class VideoHttp { } static Future> getVideoNoteList({ - required Object oid, - Object? uperMid, + dynamic oid, + dynamic uperMid, required int page, }) async { var res = await Request().get( diff --git a/lib/pages/article_list/controller.dart b/lib/pages/article_list/controller.dart index 660d8d515..89e58093f 100644 --- a/lib/pages/article_list/controller.dart +++ b/lib/pages/article_list/controller.dart @@ -9,7 +9,7 @@ import 'package:get/get.dart'; class ArticleListController extends CommonListController { - final id = Get.parameters['id']!; + final id = Get.parameters['id']; @override void onInit() { diff --git a/lib/pages/common/common_whisper_controller.dart b/lib/pages/common/common_whisper_controller.dart index f386cbcad..479228cb2 100644 --- a/lib/pages/common/common_whisper_controller.dart +++ b/lib/pages/common/common_whisper_controller.dart @@ -12,7 +12,7 @@ abstract class CommonWhisperController extends CommonListController { SessionPageType get sessionPageType; - Future onRemove(int index, int talkerId) async { + Future onRemove(int index, int? talkerId) async { var res = await MsgHttp.removeMsg(talkerId); if (res['status']) { loadingState diff --git a/lib/pages/common/publish/common_rich_text_pub_page.dart b/lib/pages/common/publish/common_rich_text_pub_page.dart index 28d49c1be..b11f37bac 100644 --- a/lib/pages/common/publish/common_rich_text_pub_page.dart +++ b/lib/pages/common/publish/common_rich_text_pub_page.dart @@ -182,7 +182,7 @@ abstract class CommonRichTextPubPageState ); } - void onChooseEmote(Object emote, double? width, double? height) { + void onChooseEmote(dynamic emote, double? width, double? height) { if (emote is e.Emote) { final isTextEmote = width == null; onInsertText( diff --git a/lib/pages/dynamics/widgets/additional_panel.dart b/lib/pages/dynamics/widgets/additional_panel.dart index a0ea5f5c6..efe543fb1 100644 --- a/lib/pages/dynamics/widgets/additional_panel.dart +++ b/lib/pages/dynamics/widgets/additional_panel.dart @@ -216,11 +216,11 @@ Widget addWidget( : () async { var res = await DynamicsHttp.dynReserve( - reserveId: reserve.rid!, - curBtnStatus: btn.status!, + reserveId: reserve.rid, + curBtnStatus: btn.status, dynamicIdStr: item.idStr, reserveTotal: - reserve.reserveTotal!, + reserve.reserveTotal, ); if (res['status']) { DynReserveData data = diff --git a/lib/pages/dynamics/widgets/author_panel.dart b/lib/pages/dynamics/widgets/author_panel.dart index a21cd00b4..310be923d 100644 --- a/lib/pages/dynamics/widgets/author_panel.dart +++ b/lib/pages/dynamics/widgets/author_panel.dart @@ -29,7 +29,7 @@ class AuthorPanel extends StatelessWidget { final bool isDetail; final ValueChanged? onRemove; final bool isSave; - final Function(bool isTop, Object dynId)? onSetTop; + final Function(bool isTop, dynamic dynId)? onSetTop; final VoidCallback? onBlock; const AuthorPanel({ @@ -519,7 +519,7 @@ class AuthorPanel extends StatelessWidget { ); } return UserHttp.dynamicReport( - mid: item.modules.moduleAuthor!.mid!, + mid: item.modules.moduleAuthor!.mid, dynId: item.idStr, reasonType: reasonType, ); diff --git a/lib/pages/dynamics/widgets/dynamic_panel.dart b/lib/pages/dynamics/widgets/dynamic_panel.dart index 80852b086..a08df3998 100644 --- a/lib/pages/dynamics/widgets/dynamic_panel.dart +++ b/lib/pages/dynamics/widgets/dynamic_panel.dart @@ -18,7 +18,7 @@ class DynamicPanel extends StatelessWidget { final ValueChanged? onRemove; final Function(List, int)? callback; final bool isSave; - final Function(bool isTop, Object dynId)? onSetTop; + final Function(bool isTop, dynamic dynId)? onSetTop; final VoidCallback? onBlock; const DynamicPanel({ diff --git a/lib/pages/dynamics/widgets/rich_node_panel.dart b/lib/pages/dynamics/widgets/rich_node_panel.dart index 2390d7699..2b1a7f03c 100644 --- a/lib/pages/dynamics/widgets/rich_node_panel.dart +++ b/lib/pages/dynamics/widgets/rich_node_panel.dart @@ -285,7 +285,7 @@ TextSpan? richNode( return; } - DynamicsHttp.dynPic(i.rid!).then((res) { + DynamicsHttp.dynPic(i.rid).then((res) { if (res.isSuccess) { var list = res.data; if (Platform.isAndroid) { diff --git a/lib/pages/dynamics_create_reserve/controller.dart b/lib/pages/dynamics_create_reserve/controller.dart index f85de9c57..fbd79aad6 100644 --- a/lib/pages/dynamics_create_reserve/controller.dart +++ b/lib/pages/dynamics_create_reserve/controller.dart @@ -28,7 +28,7 @@ class CreateReserveController extends GetxController { } Future queryData() async { - var res = await DynamicsHttp.reserveInfo(sid: sid!); + var res = await DynamicsHttp.reserveInfo(sid: sid); if (res.isSuccess) { ReserveInfoData data = res.data; key = Utils.generateRandomString(6); diff --git a/lib/pages/dynamics_create_vote/controller.dart b/lib/pages/dynamics_create_vote/controller.dart index 2911a6a2c..aef0a09d9 100644 --- a/lib/pages/dynamics_create_vote/controller.dart +++ b/lib/pages/dynamics_create_vote/controller.dart @@ -58,7 +58,7 @@ class CreateVoteController extends GetxController { } Future queryData() async { - var res = await DynamicsHttp.voteInfo(voteId!); + var res = await DynamicsHttp.voteInfo(voteId); if (res.isSuccess) { key = Utils.generateRandomString(6); final VoteInfo data = res.data; diff --git a/lib/pages/dynamics_tab/controller.dart b/lib/pages/dynamics_tab/controller.dart index 4153382a1..8b1bf53f7 100644 --- a/lib/pages/dynamics_tab/controller.dart +++ b/lib/pages/dynamics_tab/controller.dart @@ -49,7 +49,7 @@ class DynamicsTabController tempBannedList: dynamicsController.tempBannedList, ); - Future onRemove(int index, Object dynamicId) async { + Future onRemove(int index, dynamic dynamicId) async { var res = await MsgHttp.removeDynamic(dynIdStr: dynamicId); if (res['status']) { loadingState diff --git a/lib/pages/episode_panel/view.dart b/lib/pages/episode_panel/view.dart index e22f5bad3..27a59038b 100644 --- a/lib/pages/episode_panel/view.dart +++ b/lib/pages/episode_panel/view.dart @@ -513,7 +513,7 @@ class _EpisodePanelState extends CommonCollapseSlidePageState { onPressed: () async { var result = await FavHttp.seasonFav( isFav: response, - seasonId: widget.seasonId!, + seasonId: widget.seasonId, ); if (result['status']) { SmartDialog.showToast('${response ? '取消' : ''}订阅成功'); diff --git a/lib/pages/fav/article/controller.dart b/lib/pages/fav/article/controller.dart index d4916ce54..0c9d253a9 100644 --- a/lib/pages/fav/article/controller.dart +++ b/lib/pages/fav/article/controller.dart @@ -25,7 +25,7 @@ class FavArticleController Future> customGetData() => FavHttp.favArticle(page: page); - Future onRemove(int index, String id) async { + Future onRemove(int index, String? id) async { final res = await FavHttp.communityAction(opusId: id, action: 4); if (res['status']) { loadingState diff --git a/lib/pages/fav/article/view.dart b/lib/pages/fav/article/view.dart index 6a8f811e4..c7497d36d 100644 --- a/lib/pages/fav/article/view.dart +++ b/lib/pages/fav/article/view.dart @@ -66,7 +66,7 @@ class _FavArticlePageState extends State context: context, title: '确定取消收藏?', onConfirm: () => - _favArticleController.onRemove(index, item.opusId!), + _favArticleController.onRemove(index, item.opusId), ), ); }, diff --git a/lib/pages/fav/cheese/controller.dart b/lib/pages/fav/cheese/controller.dart index b88cb2afc..87c2e4f07 100644 --- a/lib/pages/fav/cheese/controller.dart +++ b/lib/pages/fav/cheese/controller.dart @@ -26,7 +26,7 @@ class FavCheeseController Future> customGetData() => FavHttp.favPugv(mid: mid, page: page); - Future onRemove(int index, int sid) async { + Future onRemove(int index, int? sid) async { var res = await FavHttp.delFavPugv(sid); if (res['status']) { loadingState diff --git a/lib/pages/fav/cheese/view.dart b/lib/pages/fav/cheese/view.dart index 1bd044368..590a02304 100644 --- a/lib/pages/fav/cheese/view.dart +++ b/lib/pages/fav/cheese/view.dart @@ -68,7 +68,7 @@ class _FavCheesePageState extends State context: context, title: '确定取消收藏该课堂?', onConfirm: () => - _controller.onRemove(index, item.seasonId!), + _controller.onRemove(index, item.seasonId), ), ); }, diff --git a/lib/pages/fav/topic/controller.dart b/lib/pages/fav/topic/controller.dart index 954abd65e..b864eb92e 100644 --- a/lib/pages/fav/topic/controller.dart +++ b/lib/pages/fav/topic/controller.dart @@ -38,7 +38,7 @@ class FavTopicController Future> customGetData() => FavHttp.favTopic(page: page); - Future onRemove(int index, int id) async { + Future onRemove(int index, int? id) async { var res = await FavHttp.delFavTopic(id); if (res['status']) { loadingState diff --git a/lib/pages/fav/topic/view.dart b/lib/pages/fav/topic/view.dart index c4cfcded4..e5555928d 100644 --- a/lib/pages/fav/topic/view.dart +++ b/lib/pages/fav/topic/view.dart @@ -93,7 +93,7 @@ class _FavTopicPageState extends State context: context, title: '确定取消收藏?', onConfirm: () { - _controller.onRemove(index, item.id!); + _controller.onRemove(index, item.id); }, ), borderRadius: const BorderRadius.all( diff --git a/lib/pages/follow/child/child_controller.dart b/lib/pages/follow/child/child_controller.dart index dc0b31cba..a07328c6d 100644 --- a/lib/pages/follow/child/child_controller.dart +++ b/lib/pages/follow/child/child_controller.dart @@ -48,7 +48,7 @@ class FollowChildController @override Future> customGetData() { if (tagid != null) { - return MemberHttp.followUpGroup(mid: mid, tagid: tagid!, pn: page); + return MemberHttp.followUpGroup(mid: mid, tagid: tagid, pn: page); } return FollowHttp.followings( diff --git a/lib/pages/follow/controller.dart b/lib/pages/follow/controller.dart index 7857db213..728b7d34e 100644 --- a/lib/pages/follow/controller.dart +++ b/lib/pages/follow/controller.dart @@ -70,7 +70,7 @@ class FollowController extends GetxController with GetTickerProviderStateMixin { } Future onUpdateTag(MemberTagItemModel item, String tagName) async { - final res = await MemberHttp.updateFollowTag(item.tagid!, tagName); + final res = await MemberHttp.updateFollowTag(item.tagid, tagName); if (res['status']) { item.name = tagName; tabs.refresh(); @@ -80,7 +80,7 @@ class FollowController extends GetxController with GetTickerProviderStateMixin { } } - Future onDelTag(int tagid) async { + Future onDelTag(int? tagid) async { final res = await MemberHttp.delFollowTag(tagid); if (res['status']) { followState.value = LoadingState.loading(); diff --git a/lib/pages/follow/view.dart b/lib/pages/follow/view.dart index 6db480677..ec7e738a6 100644 --- a/lib/pages/follow/view.dart +++ b/lib/pages/follow/view.dart @@ -202,7 +202,7 @@ class _FollowPageState extends State { context: context, title: '删除分组', content: '删除后,该分组下的用户依旧保留?', - onConfirm: () => _followController.onDelTag(item.tagid!), + onConfirm: () => _followController.onDelTag(item.tagid), ); }, dense: true, diff --git a/lib/pages/live/controller.dart b/lib/pages/live/controller.dart index 965711ca9..bd456a425 100644 --- a/lib/pages/live/controller.dart +++ b/lib/pages/live/controller.dart @@ -76,8 +76,8 @@ class LiveController extends CommonListController { return LiveHttp.liveSecondList( pn: page, isLogin: accountService.isLogin.value, - areaId: areaId!, - parentAreaId: parentAreaId!, + areaId: areaId, + parentAreaId: parentAreaId, sortType: sortType, ); } diff --git a/lib/pages/live_dm_block/controller.dart b/lib/pages/live_dm_block/controller.dart index bbece7372..0d47a0ce2 100644 --- a/lib/pages/live_dm_block/controller.dart +++ b/lib/pages/live_dm_block/controller.dart @@ -36,7 +36,7 @@ class LiveDmBlockController extends GetxController } Future queryData() async { - var res = await LiveHttp.getLiveInfoByUser(roomId!); + var res = await LiveHttp.getLiveInfoByUser(roomId); if (res.isSuccess) { ShieldInfo? data = res.data; ShieldRules? shieldRules = data?.shieldRules; @@ -115,7 +115,7 @@ class LiveDmBlockController extends GetxController } else { var res = await LiveHttp.liveShieldUser( uid: value, - roomid: roomId!, + roomid: roomId, type: 1, ); if (res['status']) { @@ -132,11 +132,11 @@ class LiveDmBlockController extends GetxController } } - Future onRemove(int index, Object item) async { + Future onRemove(int index, dynamic item) async { if (item is ShieldUserList) { var res = await LiveHttp.liveShieldUser( - uid: item.uid!, - roomid: roomId!, + uid: item.uid, + roomid: roomId, type: 0, ); if (res['status']) { @@ -145,7 +145,7 @@ class LiveDmBlockController extends GetxController SmartDialog.showToast(res['msg']); } } else { - var res = await LiveHttp.delShieldKeyword(keyword: item as String); + var res = await LiveHttp.delShieldKeyword(keyword: item); if (res['status']) { keywordList.removeAt(index); } else { diff --git a/lib/pages/member_dynamics/controller.dart b/lib/pages/member_dynamics/controller.dart index 70dd55f91..84da80837 100644 --- a/lib/pages/member_dynamics/controller.dart +++ b/lib/pages/member_dynamics/controller.dart @@ -60,7 +60,7 @@ class MemberDynamicsController } } - Future onSetTop(bool isTop, Object dynamicId) async { + Future onSetTop(bool isTop, dynamic dynamicId) async { var res = isTop ? await DynamicsHttp.rmTop(dynamicId: dynamicId) : await DynamicsHttp.setTop(dynamicId: dynamicId); diff --git a/lib/pages/member_search/child/controller.dart b/lib/pages/member_search/child/controller.dart index 3b8394a08..9b26c849c 100644 --- a/lib/pages/member_search/child/controller.dart +++ b/lib/pages/member_search/child/controller.dart @@ -59,13 +59,13 @@ class MemberSearchChildController extends CommonListController { Future customGetData() { return switch (searchType) { MemberSearchType.archive => MemberHttp.searchArchive( - mid: controller.mid!, + mid: controller.mid, pn: page, keyword: controller.editingController.text, order: 'pubdate', ), MemberSearchType.dynamic => MemberHttp.dynSearch( - mid: controller.mid!, + mid: controller.mid, pn: page, offset: offset ?? '', keyword: controller.editingController.text, diff --git a/lib/pages/msg_feed_top/at_me/controller.dart b/lib/pages/msg_feed_top/at_me/controller.dart index c5c7ea6ec..b417b3630 100644 --- a/lib/pages/msg_feed_top/at_me/controller.dart +++ b/lib/pages/msg_feed_top/at_me/controller.dart @@ -36,7 +36,7 @@ class AtMeController extends CommonListController { Future> customGetData() => MsgHttp.msgFeedAtMe(cursor: cursor, cursorTime: cursorTime); - Future onRemove(Object id, int index) async { + Future onRemove(dynamic id, int index) async { try { var res = await MsgHttp.delMsgfeed(2, id); if (res['status']) { diff --git a/lib/pages/msg_feed_top/at_me/view.dart b/lib/pages/msg_feed_top/at_me/view.dart index 3a224ab1d..e5e63362f 100644 --- a/lib/pages/msg_feed_top/at_me/view.dart +++ b/lib/pages/msg_feed_top/at_me/view.dart @@ -104,8 +104,7 @@ class _AtMePageState extends State { onLongPress: () => showConfirmDialog( context: context, title: '确定删除该通知?', - onConfirm: () => - _atMeController.onRemove(item.id!, index), + onConfirm: () => _atMeController.onRemove(item.id, index), ), leading: GestureDetector( onTap: () => Get.toNamed('/member?mid=${item.user?.mid}'), diff --git a/lib/pages/msg_feed_top/like_detail/controller.dart b/lib/pages/msg_feed_top/like_detail/controller.dart index 0beb42d30..b1f414981 100644 --- a/lib/pages/msg_feed_top/like_detail/controller.dart +++ b/lib/pages/msg_feed_top/like_detail/controller.dart @@ -31,7 +31,7 @@ class LikeDetailController @override Future> customGetData() => MsgHttp.msgLikeDetail( - cardId: cardId!, + cardId: cardId, pn: page, ); } diff --git a/lib/pages/msg_feed_top/like_me/controller.dart b/lib/pages/msg_feed_top/like_me/controller.dart index 76042278e..6c428dfeb 100644 --- a/lib/pages/msg_feed_top/like_me/controller.dart +++ b/lib/pages/msg_feed_top/like_me/controller.dart @@ -63,7 +63,7 @@ class LikeMeController Future> customGetData() => MsgHttp.msgFeedLikeMe(cursor: cursor, cursorTime: cursorTime); - Future onRemove(Object id, int index, bool isLatest) async { + Future onRemove(dynamic id, int index, bool isLatest) async { try { var res = await MsgHttp.delMsgfeed(0, id); if (res['status']) { @@ -84,10 +84,7 @@ class LikeMeController Future onSetNotice(MsgLikeItem item, bool isNotice) async { int noticeState = isNotice ? 1 : 0; - var res = await MsgHttp.msgSetNotice( - id: item.id!, - noticeState: noticeState, - ); + var res = await MsgHttp.msgSetNotice(id: item.id, noticeState: noticeState); if (res['status']) { item.noticeState = noticeState; loadingState.refresh(); diff --git a/lib/pages/msg_feed_top/like_me/view.dart b/lib/pages/msg_feed_top/like_me/view.dart index f1d2acb7f..ba0ee9a77 100644 --- a/lib/pages/msg_feed_top/like_me/view.dart +++ b/lib/pages/msg_feed_top/like_me/view.dart @@ -160,7 +160,7 @@ class _LikeMePageState extends State { Widget _buildItem( ThemeData theme, MsgLikeItem item, - ValueChanged onRemove, + ValueChanged onRemove, ) { return ListTile( onTap: () { @@ -199,7 +199,7 @@ class _LikeMePageState extends State { context: context, title: '删除', content: '该条通知删除后,当有新点赞时会重新出现在列表,是否继续?', - onConfirm: () => onRemove(item.id!), + onConfirm: () => onRemove(item.id), ); }, dense: true, diff --git a/lib/pages/msg_feed_top/reply_me/controller.dart b/lib/pages/msg_feed_top/reply_me/controller.dart index 554690a76..1b452e633 100644 --- a/lib/pages/msg_feed_top/reply_me/controller.dart +++ b/lib/pages/msg_feed_top/reply_me/controller.dart @@ -37,7 +37,7 @@ class ReplyMeController Future> customGetData() => MsgHttp.msgFeedReplyMe(cursor: cursor, cursorTime: cursorTime); - Future onRemove(Object id, int index) async { + Future onRemove(dynamic id, int index) async { try { var res = await MsgHttp.delMsgfeed(1, id); if (res['status']) { diff --git a/lib/pages/msg_feed_top/reply_me/view.dart b/lib/pages/msg_feed_top/reply_me/view.dart index 884ea8eb5..dc618b6c8 100644 --- a/lib/pages/msg_feed_top/reply_me/view.dart +++ b/lib/pages/msg_feed_top/reply_me/view.dart @@ -110,7 +110,7 @@ class _ReplyMePageState extends State { context: context, title: '确定删除该通知?', onConfirm: () => - _replyMeController.onRemove(item.id!, index), + _replyMeController.onRemove(item.id, index), ), leading: GestureDetector( onTap: () => Get.toNamed('/member?mid=${item.user?.mid}'), diff --git a/lib/pages/msg_feed_top/sys_msg/controller.dart b/lib/pages/msg_feed_top/sys_msg/controller.dart index 6f8e0524b..1d50e5983 100644 --- a/lib/pages/msg_feed_top/sys_msg/controller.dart +++ b/lib/pages/msg_feed_top/sys_msg/controller.dart @@ -34,7 +34,7 @@ class SysMsgController return super.onRefresh(); } - Future onRemove(Object id, int index) async { + Future onRemove(dynamic id, int index) async { try { var res = await MsgHttp.delSysMsg(id); if (res['status']) { diff --git a/lib/pages/msg_feed_top/sys_msg/view.dart b/lib/pages/msg_feed_top/sys_msg/view.dart index 05835b685..71669eef4 100644 --- a/lib/pages/msg_feed_top/sys_msg/view.dart +++ b/lib/pages/msg_feed_top/sys_msg/view.dart @@ -83,7 +83,7 @@ class _SysMsgPageState extends State { context: context, title: '确定删除该通知?', onConfirm: () => - _sysMsgController.onRemove(item.id!, index), + _sysMsgController.onRemove(item.id, index), ), title: Text( "${item.title}", diff --git a/lib/pages/pgc_review/child/controller.dart b/lib/pages/pgc_review/child/controller.dart index cca6a7071..b49204c51 100644 --- a/lib/pages/pgc_review/child/controller.dart +++ b/lib/pages/pgc_review/child/controller.dart @@ -101,7 +101,7 @@ class PgcReviewController } } - Future onDel(int index, int reviewId) async { + Future onDel(int index, int? reviewId) async { var res = await PgcHttp.pgcReviewDel( mediaId: mediaId, reviewId: reviewId, diff --git a/lib/pages/pgc_review/child/view.dart b/lib/pages/pgc_review/child/view.dart index edafc76ac..053ce55f1 100644 --- a/lib/pages/pgc_review/child/view.dart +++ b/lib/pages/pgc_review/child/view.dart @@ -170,7 +170,7 @@ class _PgcReviewChildPageState extends State context: context, title: '删除短评,同时删除评分?', onConfirm: () => - _controller.onDel(index, item.reviewId!), + _controller.onDel(index, item.reviewId), ); }, ), diff --git a/lib/pages/rank/zone/controller.dart b/lib/pages/rank/zone/controller.dart index 4a52b21b2..1a5ceae0d 100644 --- a/lib/pages/rank/zone/controller.dart +++ b/lib/pages/rank/zone/controller.dart @@ -15,7 +15,7 @@ class ZoneController extends CommonListController { } @override - Future> customGetData() { + Future customGetData() { if (rid != null) { return VideoHttp.getRankVideoList(rid!); } diff --git a/lib/pages/rcmd/controller.dart b/lib/pages/rcmd/controller.dart index 8650d0131..54c777cc2 100644 --- a/lib/pages/rcmd/controller.dart +++ b/lib/pages/rcmd/controller.dart @@ -1,15 +1,9 @@ import 'package:PiliPlus/http/loading_state.dart'; import 'package:PiliPlus/http/video.dart'; -import 'package:PiliPlus/models/model_rec_video_item.dart'; import 'package:PiliPlus/pages/common/common_list_controller.dart'; import 'package:PiliPlus/utils/storage_pref.dart'; -class RcmdController - extends - CommonListController< - List, - BaseRecVideoItemModel - > { +class RcmdController extends CommonListController { late bool enableSaveLastData = Pref.enableSaveLastData; final bool appRcmd = Pref.appRcmd; @@ -24,16 +18,16 @@ class RcmdController } @override - Future>> customGetData() { + Future customGetData() { return appRcmd ? VideoHttp.rcmdVideoListApp(freshIdx: page) : VideoHttp.rcmdVideoList(freshIdx: page, ps: 20); } @override - void handleListResponse(List dataList) { + void handleListResponse(List dataList) { if (enableSaveLastData && page == 0 && loadingState.value.isSuccess) { - final currentList = loadingState.value.data; + List? currentList = loadingState.value.data; if (currentList?.isNotEmpty == true) { if (savedRcmdTip) { lastRefreshAt = dataList.length; diff --git a/lib/pages/rcmd/view.dart b/lib/pages/rcmd/view.dart index 9c24318c2..c371e5a0b 100644 --- a/lib/pages/rcmd/view.dart +++ b/lib/pages/rcmd/view.dart @@ -4,7 +4,6 @@ import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart'; import 'package:PiliPlus/common/widgets/refresh_indicator.dart'; import 'package:PiliPlus/common/widgets/video_card/video_card_v.dart'; import 'package:PiliPlus/http/loading_state.dart'; -import 'package:PiliPlus/models/model_rec_video_item.dart'; import 'package:PiliPlus/pages/common/common_page.dart'; import 'package:PiliPlus/pages/rcmd/controller.dart'; import 'package:PiliPlus/utils/grid.dart'; @@ -60,7 +59,7 @@ class _RcmdPageState extends CommonPageState mainAxisExtent: MediaQuery.textScalerOf(context).scale(90), ); - Widget _buildBody(LoadingState?> loadingState) { + Widget _buildBody(LoadingState?> loadingState) { return switch (loadingState) { Loading() => _buildSkeleton, Success(:var response) => diff --git a/lib/pages/save_panel/view.dart b/lib/pages/save_panel/view.dart index aad43359f..d2baee123 100644 --- a/lib/pages/save_panel/view.dart +++ b/lib/pages/save_panel/view.dart @@ -15,7 +15,6 @@ import 'package:PiliPlus/utils/context_ext.dart'; import 'package:PiliPlus/utils/date_util.dart'; import 'package:PiliPlus/utils/image_util.dart'; import 'package:PiliPlus/utils/utils.dart'; -import 'package:fixnum/fixnum.dart'; import 'package:flutter/foundation.dart' show kDebugMode; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; @@ -34,13 +33,13 @@ class SavePanel extends StatefulWidget { super.key, }); - final Int64? upMid; - final Object item; + final dynamic upMid; + final dynamic item; @override State createState() => _SavePanelState(); - static void toSavePanel({Int64? upMid, required Object item}) { + static void toSavePanel({dynamic upMid, dynamic item}) { Get.generalDialog( barrierLabel: '', barrierDismissible: true, diff --git a/lib/pages/setting/pages/color_select.dart b/lib/pages/setting/pages/color_select.dart index fa177444d..a278b926d 100644 --- a/lib/pages/setting/pages/color_select.dart +++ b/lib/pages/setting/pages/color_select.dart @@ -167,7 +167,7 @@ class _ColorSelectPageState extends State { value: 0, title: const Text('动态取色'), groupValue: ctr.type.value, - onChanged: (val) { + onChanged: (dynamic val) { ctr ..type.value = 0 ..setting.put(SettingBoxKey.dynamicColor, true); @@ -180,7 +180,7 @@ class _ColorSelectPageState extends State { value: 1, title: const Text('指定颜色'), groupValue: ctr.type.value, - onChanged: (val) { + onChanged: (dynamic val) { ctr ..type.value = 1 ..setting.put(SettingBoxKey.dynamicColor, false); diff --git a/lib/pages/setting/widgets/select_dialog.dart b/lib/pages/setting/widgets/select_dialog.dart index 770a8576e..ba292fe6f 100644 --- a/lib/pages/setting/widgets/select_dialog.dart +++ b/lib/pages/setting/widgets/select_dialog.dart @@ -177,7 +177,7 @@ class _CdnSelectDialogState extends State { _cdnResList[index].value = '${speed}MB/s'; } - void _handleSpeedTestError(Object error, int index) { + void _handleSpeedTestError(dynamic error, int index) { final item = _cdnResList[index]; if (item.value != null) return; diff --git a/lib/pages/video/controller.dart b/lib/pages/video/controller.dart index e6abbb2ca..026150621 100644 --- a/lib/pages/video/controller.dart +++ b/lib/pages/video/controller.dart @@ -826,7 +826,7 @@ class VideoDetailController extends GetxController } } - void onAddItem(Object item) { + void onAddItem(dynamic item) { if (listData.contains(item)) return; listData.insert(0, item); listKey.currentState?.insertItem(0); @@ -1446,7 +1446,7 @@ class VideoDetailController extends GetxController '/x/stein/edgeinfo_v2', queryParameters: { 'bvid': bvid, - 'graph_version': ?graphVersion, + 'graph_version': graphVersion, 'edge_id': ?edgeId, }, ); diff --git a/lib/pages/video/introduction/pgc/controller.dart b/lib/pages/video/introduction/pgc/controller.dart index 6f57f0fa2..e0f4cf2f0 100644 --- a/lib/pages/video/introduction/pgc/controller.dart +++ b/lib/pages/video/introduction/pgc/controller.dart @@ -78,7 +78,7 @@ class PgcIntroController extends CommonIntroController { // 获取点赞/投币/收藏状态 Future queryPgcLikeCoinFav() async { - var result = await VideoHttp.pgcLikeCoinFav(epId: epId!); + var result = await VideoHttp.pgcLikeCoinFav(epId: epId); if (result['status']) { PgcLCF data = result['data']; final hasLike = data.like == 1; @@ -424,7 +424,7 @@ class PgcIntroController extends CommonIntroController { SmartDialog.showToast('已三连'); return; } - var result = await VideoHttp.pgcTriple(epId: epId!, seasonId: seasonId); + var result = await VideoHttp.pgcTriple(epId: epId, seasonId: seasonId); if (result['status']) { PgcTriple data = result['data']; late final stat = pgcItem.stat!; @@ -494,8 +494,8 @@ class PgcIntroController extends CommonIntroController { Future onFavPugv(bool isFav) async { final res = isFav - ? await FavHttp.delFavPugv(seasonId!) - : await FavHttp.addFavPugv(seasonId!); + ? await FavHttp.delFavPugv(seasonId) + : await FavHttp.addFavPugv(seasonId); if (res['status']) { this.isFav.value = !isFav; SmartDialog.showToast('${isFav ? '取消' : ''}收藏成功'); diff --git a/lib/pages/video/member/view.dart b/lib/pages/video/member/view.dart index a8a2b81d6..b3b1eca38 100644 --- a/lib/pages/video/member/view.dart +++ b/lib/pages/video/member/view.dart @@ -366,7 +366,7 @@ class _HorizontalMemberPageState extends State Widget _buildChildInfo({ required ThemeData theme, required String title, - required Object num, + required dynamic num, required VoidCallback onTap, }) { return GestureDetector( diff --git a/lib/pages/video/view.dart b/lib/pages/video/view.dart index 02016ed06..fbd55870f 100644 --- a/lib/pages/video/view.dart +++ b/lib/pages/video/view.dart @@ -2132,8 +2132,8 @@ class _VideoDetailPageVState extends State } void onReversePlay({ - required Object bvid, - required Object aid, + required dynamic bvid, + required dynamic aid, required bool isSeason, }) { if (isSeason && videoDetailController.isPlayAll) { diff --git a/lib/pages/whisper/widgets/item.dart b/lib/pages/whisper/widgets/item.dart index 2f3a3c4bd..abcce5568 100644 --- a/lib/pages/whisper/widgets/item.dart +++ b/lib/pages/whisper/widgets/item.dart @@ -26,7 +26,7 @@ class WhisperSessionItem extends StatelessWidget { final Session item; final Function(bool isTop, SessionId id) onSetTop; final Function(bool isMuted, Int64 talkerUid) onSetMute; - final ValueChanged onRemove; + final ValueChanged onRemove; @override Widget build(BuildContext context) { diff --git a/lib/pages/whisper_detail/widget/chat_item.dart b/lib/pages/whisper_detail/widget/chat_item.dart index 1baaeee35..d6d8fddb3 100644 --- a/lib/pages/whisper_detail/widget/chat_item.dart +++ b/lib/pages/whisper_detail/widget/chat_item.dart @@ -61,7 +61,7 @@ class ChatItem extends StatelessWidget { late final Color textColor = isOwner ? theme.colorScheme.onSecondaryContainer : theme.colorScheme.onSurfaceVariant; - late final Map content = jsonDecode(item.content); + late final dynamic content = jsonDecode(item.content); return isRevoke ? const SizedBox.shrink() @@ -162,7 +162,7 @@ class ChatItem extends StatelessWidget { Widget messageContent({ required BuildContext context, required ThemeData theme, - required Map content, + required dynamic content, required Color textColor, }) { try { @@ -196,10 +196,7 @@ class ChatItem extends StatelessWidget { } } - Widget msgTypeCommonShareCard_14( - Map content, - Color textColor, - ) { + Widget msgTypeCommonShareCard_14(dynamic content, Color textColor) { if (content['source'] == '直播') { return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -245,7 +242,7 @@ class ChatItem extends StatelessWidget { } } - Widget msgTypeArticleCard_12(Map content, Color textColor) { + Widget msgTypeArticleCard_12(dynamic content, Color textColor) { return GestureDetector( onTap: () => Get.toNamed( '/articlePage', @@ -475,7 +472,7 @@ class ChatItem extends StatelessWidget { ); } - Widget msgTypeShareV2_7(Map content, Color textColor) { + Widget msgTypeShareV2_7(dynamic content, Color textColor) { String? type; GestureTapCallback onTap; switch (content['source']) { @@ -590,7 +587,7 @@ class ChatItem extends StatelessWidget { ); } - Widget msgTypePic_2(Map content) { + Widget msgTypePic_2(content) { final url = content['url']; return GestureDetector( onTap: () => PageUtils.imageView(imgList: [SourceModel(url: url)]), @@ -622,7 +619,7 @@ class ChatItem extends StatelessWidget { Widget msgTypeText_1( ThemeData theme, { - required Map content, + required dynamic content, required Color textColor, }) { final style = TextStyle(color: textColor, letterSpacing: 0.6, height: 1.5); @@ -767,7 +764,7 @@ class ChatItem extends StatelessWidget { ); } - Widget msgTypePictureCard_13(Map content) { + Widget msgTypePictureCard_13(dynamic content) { final url = content['jump_url']; return Center( child: ConstrainedBox( diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index c4327e469..c7a6d9ac6 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -1430,12 +1430,12 @@ class PlPlayerController { int progress, { HeartBeatType type = HeartBeatType.playing, bool isManual = false, - Object? aid, - Object? bvid, - Object? cid, - Object? epid, - Object? seasonId, - Object? pgcType, + dynamic aid, + dynamic bvid, + dynamic cid, + dynamic epid, + dynamic seasonId, + dynamic pgcType, VideoType? videoType, }) async { if (isLive) { @@ -1460,7 +1460,7 @@ class PlPlayerController { await VideoHttp.heartBeat( aid: aid ?? _aid, bvid: bvid ?? _bvid, - cid: cid ?? _cid!, + cid: cid ?? _cid, progress: isComplete ? -1 : progress, epid: epid ?? _epid, seasonId: seasonId ?? _seasonId, @@ -1475,7 +1475,7 @@ class PlPlayerController { await VideoHttp.heartBeat( aid: aid ?? _aid, bvid: bvid ?? _bvid, - cid: cid ?? _cid!, + cid: cid ?? _cid, progress: progress, epid: epid ?? _epid, seasonId: seasonId ?? _seasonId, @@ -1633,8 +1633,8 @@ class PlPlayerController { '/x/player/videoshot', queryParameters: { // 'aid': IdUtils.bv2av(_bvid), - 'bvid': _bvid!, - 'cid': _cid!, + 'bvid': _bvid, + 'cid': _cid, 'index': 1, }, options: Options( diff --git a/lib/services/audio_handler.dart b/lib/services/audio_handler.dart index 81eb8957a..7e4455c77 100644 --- a/lib/services/audio_handler.dart +++ b/lib/services/audio_handler.dart @@ -115,7 +115,7 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler { } void onVideoDetailChange( - Object data, + dynamic data, int cid, String herotag, { String? artist, @@ -127,6 +127,7 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler { // debugPrint(StackTrace.current); // } if (!PlPlayerController.instanceExists()) return; + if (data == null) return; late final id = '$cid$herotag'; MediaItem? mediaItem; diff --git a/lib/utils/accounts/account_manager/account_mgr.dart b/lib/utils/accounts/account_manager/account_mgr.dart index 715eed01e..8c3977ab9 100644 --- a/lib/utils/accounts/account_manager/account_mgr.dart +++ b/lib/utils/accounts/account_manager/account_mgr.dart @@ -133,9 +133,11 @@ class AccountManager extends Interceptor { // if (kDebugMode) debugPrint('is app: ${options.path}'); // bytes是grpc响应 if (options.responseType != ResponseType.bytes) { - final dataPtr = (options.method == 'POST' && options.data is Map - ? (options.data as Map).cast() - : options.queryParameters); + final dataPtr = + (options.method == 'POST' && options.data is Map + ? options.data as Map + : options.queryParameters) + .cast(); if (dataPtr.isNotEmpty) { if (!account.accessKey.isNullOrEmpty) { dataPtr['access_key'] = account.accessKey!; diff --git a/lib/utils/page_utils.dart b/lib/utils/page_utils.dart index e9ffcd67d..06e44e530 100644 --- a/lib/utils/page_utils.dart +++ b/lib/utils/page_utils.dart @@ -294,11 +294,7 @@ class PageUtils { ); } - static Future pushDynFromId({ - String? id, - Object? rid, - bool off = false, - }) async { + static Future pushDynFromId({id, rid, bool off = false}) async { SmartDialog.showLoading(); var res = await DynamicsHttp.dynamicDetail( id: id, @@ -312,7 +308,7 @@ class PageUtils { toDupNamed( '/articlePage', parameters: { - 'id': id!, + 'id': id, 'type': 'opus', }, off: off, @@ -784,7 +780,7 @@ class PageUtils { static EpisodeItem findEpisode( List episodes, { - Object? epId, + dynamic epId, bool isPgc = true, }) { // epId episode -> progress episode -> first episode @@ -799,8 +795,8 @@ class PageUtils { } static Future viewPgc({ - Object? seasonId, - Object? epId, + dynamic seasonId, + dynamic epId, String? progress, }) async { try { @@ -888,8 +884,8 @@ class PageUtils { } static Future viewPugv({ - Object? seasonId, - Object? epId, + dynamic seasonId, + dynamic epId, int? aid, }) async { try { diff --git a/lib/utils/reply_utils.dart b/lib/utils/reply_utils.dart index 75aa003c0..6b7b8b175 100644 --- a/lib/utils/reply_utils.dart +++ b/lib/utils/reply_utils.dart @@ -54,11 +54,11 @@ class ReplyUtils { required int type, required int id, required String message, - required int root, - Object? parent, - Object? ctime, + dynamic root, + dynamic parent, + dynamic ctime, List? pictures, - Object? mid, + dynamic mid, bool isManual = false, required bool biliSendCommAntifraud, required sourceId, @@ -144,6 +144,7 @@ class ReplyUtils { type: type, sort: ReplySortType.time.index, page: 1, + enableFilter: false, antiGoodsReply: false, ); diff --git a/lib/utils/request_utils.dart b/lib/utils/request_utils.dart index c211a1fee..1f92a3312 100644 --- a/lib/utils/request_utils.dart +++ b/lib/utils/request_utils.dart @@ -105,11 +105,14 @@ class RequestUtils { static Future actionRelationMod({ required BuildContext context, - required int mid, + required dynamic mid, required bool isFollow, required ValueChanged? callback, Map? followStatus, }) async { + if (mid == null) { + return; + } feedBack(); if (!isFollow) { var res = await VideoHttp.relationMod( @@ -280,21 +283,23 @@ class RequestUtils { // } // } - static Future insertCreatedDyn(Object id) async { + static Future insertCreatedDyn(dynamic id) async { try { - await Future.delayed(const Duration(milliseconds: 200)); - var res = await DynamicsHttp.dynamicDetail(id: id); - if (res['status']) { - final ctr = Get.find(tag: 'all'); - if (ctr.loadingState.value.isSuccess) { - List? list = ctr.loadingState.value.data; - if (list != null) { - list.insert(0, res['data']); - ctr.loadingState.refresh(); - return; + if (id != null) { + await Future.delayed(const Duration(milliseconds: 200)); + var res = await DynamicsHttp.dynamicDetail(id: id); + if (res['status']) { + final ctr = Get.find(tag: 'all'); + if (ctr.loadingState.value.isSuccess) { + List? list = ctr.loadingState.value.data; + if (list != null) { + list.insert(0, res['data']); + ctr.loadingState.refresh(); + return; + } } + ctr.loadingState.value = Success([res['data']]); } - ctr.loadingState.value = Success([res['data']]); } } catch (e) { if (kDebugMode) debugPrint('create dyn $e'); @@ -302,7 +307,7 @@ class RequestUtils { } static Future checkCreatedDyn({ - Object? id, + dynamic id, String? dynText, bool isManual = false, }) async { @@ -381,8 +386,8 @@ class RequestUtils { required BuildContext context, required bool isCopy, required MultiSelectController ctr, - required Object? mediaId, - required Object mid, + required dynamic mediaId, + required dynamic mid, }) { FavHttp.allFavFolders(mid).then((res) { if (context.mounted && res.dataOrNull?.list?.isNotEmpty == true) { @@ -434,7 +439,7 @@ class RequestUtils { isCopy: isCopy, isFav: ctr is! LaterController, srcMediaId: mediaId, - tarMediaId: checkedId!, + tarMediaId: checkedId, resources: removeList .map( (item) => ctr is LaterController diff --git a/lib/utils/update.dart b/lib/utils/update.dart index 6365464d5..d73071d11 100644 --- a/lib/utils/update.dart +++ b/lib/utils/update.dart @@ -111,7 +111,7 @@ class Update { } // 下载适用于当前系统的安装包 - static Future onDownload(Map data) async { + static Future onDownload(data) async { SmartDialog.dismiss(); try { void download(plat) { diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index c02ec5592..c8123cfa5 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -100,7 +100,7 @@ class Utils { } } - static String makeHeroTag(Object? v) { + static String makeHeroTag(v) { return v.toString() + random.nextInt(9999).toString(); } diff --git a/lib/utils/wbi_sign.dart b/lib/utils/wbi_sign.dart index d082092b8..89010d8eb 100644 --- a/lib/utils/wbi_sign.dart +++ b/lib/utils/wbi_sign.dart @@ -58,7 +58,7 @@ class WbiSign { } // 为请求参数进行 wbi 签名 - static void encWbi(Map params, String mixinKey) { + static void encWbi(Map params, String mixinKey) { params['wts'] = DateTime.now().millisecondsSinceEpoch ~/ 1000; // 按照 key 重排参数 final List keys = params.keys.toList()..sort(); @@ -104,8 +104,8 @@ class WbiSign { } } - static Future> makSign( - Map params, + static Future> makSign( + Map params, ) async { // params 为需要加密的请求参数 final String mixinKey = await lock.synchronized(getWbiKeys);