Revert "opt: non null (#1091)"

This reverts commit 3c34e43827.
This commit is contained in:
bggRGjQaUbCoE
2025-08-23 22:05:35 +08:00
parent b77403f03f
commit ee819bb260
75 changed files with 362 additions and 400 deletions

View File

@@ -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<LoadingState<LiveSecondData>> 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<LoadingState<List<AreaItem>?>> 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<LoadingState<ShieldInfo?>> 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,
}),