Files
PiliPlus/lib/pages/hot/controller.dart
bggRGjQaUbCoE 59910e275e chore: code clean up
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
2024-11-10 11:06:49 +08:00

35 lines
822 B
Dart

import 'package:PiliPalaX/grpc/app/card/v1/card.pb.dart';
import 'package:PiliPalaX/http/loading_state.dart';
import 'package:PiliPalaX/pages/common/popup_controller.dart';
import 'package:PiliPalaX/http/video.dart';
class HotController extends PopupController {
int idx = 0;
@override
void onInit() {
super.onInit();
queryData();
}
@override
Future onRefresh() {
idx = 0;
return super.onRefresh();
}
// @override
// Future<LoadingState> customGetData() => VideoHttp.hotVideoList(
// pn: currentPage,
// ps: _count,
// );
@override
void handleSuccess(List currentList, List dataList) {
idx = (dataList.last as Card?)?.smallCoverV5.base.idx.toInt() ?? 0;
}
@override
Future<LoadingState> customGetData() => VideoHttp.hotVideoListGrpc(idx: idx);
}