mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-21 01:26:59 +08:00
38 lines
916 B
Dart
38 lines
916 B
Dart
import 'dart:ui' show Offset;
|
|
|
|
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
|
|
Offset get fabOffset => const Offset(0, 2);
|
|
|
|
@override
|
|
void onInit() {
|
|
super.onInit();
|
|
getMatchInfo();
|
|
}
|
|
|
|
Future<void> getMatchInfo() async {
|
|
var res = await MatchHttp.matchInfo(oid);
|
|
if (res.isSuccess) {
|
|
queryData();
|
|
}
|
|
infoState.value = res;
|
|
}
|
|
}
|