mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-21 01:26:59 +08:00
* opt: unused layout * mod: semantics * opt: DanmakuMsg type * opt: avoid cast * opt: unnecessary_lambdas * opt: use isEven * opt: logger * opt: invalid common page * tweak * opt: unify DynController
40 lines
1020 B
Dart
40 lines
1020 B
Dart
import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart';
|
|
import 'package:PiliPlus/http/loading_state.dart';
|
|
import 'package:PiliPlus/http/match.dart';
|
|
import 'package:PiliPlus/models_new/match/match_info/contest.dart';
|
|
import 'package:PiliPlus/pages/common/dyn/common_dyn_controller.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
class MatchInfoController extends CommonDynController {
|
|
@override
|
|
final int oid = int.parse(Get.parameters['cid']!);
|
|
@override
|
|
final int replyType = 27;
|
|
|
|
@override
|
|
dynamic get sourceId => oid.toString();
|
|
|
|
final Rx<LoadingState<MatchContest?>> infoState =
|
|
LoadingState<MatchContest?>.loading().obs;
|
|
|
|
@override
|
|
void onInit() {
|
|
offsetDy = 2;
|
|
super.onInit();
|
|
getMatchInfo();
|
|
}
|
|
|
|
Future<void> getMatchInfo() async {
|
|
var res = await MatchHttp.matchInfo(oid);
|
|
if (res.isSuccess) {
|
|
queryData();
|
|
}
|
|
infoState.value = res;
|
|
}
|
|
|
|
@override
|
|
List<ReplyInfo>? getDataList(MainListReply response) {
|
|
return response.replies;
|
|
}
|
|
}
|