diff --git a/lib/http/live.dart b/lib/http/live.dart index 52524f6c6..22363a700 100644 --- a/lib/http/live.dart +++ b/lib/http/live.dart @@ -72,8 +72,8 @@ abstract final class LiveHttp { } static Future> liveRoomInfo({ - roomId, - qn, + required Object roomId, + Object? qn, bool onlyAudio = false, }) async { var res = await Request().get( @@ -83,7 +83,7 @@ abstract final class LiveHttp { 'protocol': '0,1', 'format': '0,1,2', 'codec': '0,1,2', - 'qn': qn, + 'qn': ?qn, 'platform': 'web', 'ptype': 8, 'dolby': 5, @@ -99,7 +99,9 @@ abstract final class LiveHttp { } } - static Future liveRoomInfoH5({roomId, qn}) async { + static Future> liveRoomInfoH5({ + required Object roomId, + }) async { var res = await Request().get( Api.liveRoomInfoH5, queryParameters: { @@ -113,7 +115,7 @@ abstract final class LiveHttp { } } - static Future liveRoomDanmaPrefetch({roomId}) async { + static Future liveRoomDanmaPrefetch({required Object roomId}) async { var res = await Request().get( Api.liveRoomDmPrefetch, queryParameters: {'roomid': roomId}, @@ -131,7 +133,9 @@ abstract final class LiveHttp { } } - static Future liveRoomGetDanmakuToken({roomId}) async { + static Future> liveRoomGetDanmakuToken({ + required Object roomId, + }) async { var res = await Request().get( Api.liveRoomDmToken, queryParameters: await WbiSign.makSign({ @@ -479,7 +483,7 @@ abstract final class LiveHttp { } static Future> getLiveInfoByUser( - dynamic roomId, + Object roomId, ) async { var res = await Request().get( Api.getLiveInfoByUser, @@ -559,9 +563,9 @@ abstract final class LiveHttp { } } - static Future liveShieldUser({ - required dynamic uid, - required dynamic roomid, + static Future> liveShieldUser({ + required Object uid, + required Object roomid, required int type, }) async { final csrf = Accounts.main.csrf; @@ -585,9 +589,9 @@ abstract final class LiveHttp { static Future> liveLikeReport({ required int clickTime, - required dynamic roomId, - required dynamic uid, - required dynamic anchorId, + required Object roomId, + required Object uid, + Object? anchorId, }) async { var res = await Request().post( Api.liveLikeReport, @@ -595,7 +599,7 @@ abstract final 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/pages/live_dm_block/controller.dart b/lib/pages/live_dm_block/controller.dart index b73f36867..158701b33 100644 --- a/lib/pages/live_dm_block/controller.dart +++ b/lib/pages/live_dm_block/controller.dart @@ -7,7 +7,7 @@ import 'package:get/get.dart'; class LiveDmBlockController extends GetxController with GetSingleTickerProviderStateMixin { - final roomId = Get.parameters['roomId']; + final roomId = Get.parameters['roomId']!; @override void onInit() { @@ -128,7 +128,7 @@ class LiveDmBlockController extends GetxController assert(item is ShieldUserList || item is String); if (item is ShieldUserList) { var res = await LiveHttp.liveShieldUser( - uid: item.uid, + uid: item.uid!, roomid: roomId, type: 0, );