mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
37 lines
927 B
Dart
37 lines
927 B
Dart
import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
|
show MainListReply, ReplyInfo;
|
|
import 'package:PiliPlus/grpc/reply.dart';
|
|
import 'package:PiliPlus/http/loading_state.dart';
|
|
import 'package:PiliPlus/pages/common/reply_controller.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
class MainReplyController extends ReplyController<MainListReply> {
|
|
late final int oid;
|
|
late final int replyType;
|
|
|
|
@override
|
|
int get sourceId => oid;
|
|
|
|
@override
|
|
void onInit() {
|
|
super.onInit();
|
|
final args = Get.arguments;
|
|
oid = args['oid'];
|
|
replyType = args['replyType'];
|
|
|
|
queryData();
|
|
}
|
|
|
|
@override
|
|
Future<LoadingState<MainListReply>> customGetData() => ReplyGrpc.mainList(
|
|
type: replyType,
|
|
oid: oid,
|
|
mode: mode.value,
|
|
cursorNext: cursorNext,
|
|
offset: paginationReply?.nextOffset,
|
|
);
|
|
|
|
@override
|
|
List<ReplyInfo>? getDataList(MainListReply response) => response.replies;
|
|
}
|