mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: reply2reply
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import 'package:PiliPalaX/http/loading_state.dart';
|
||||
import 'package:PiliPalaX/pages/common/common_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPalaX/http/reply.dart';
|
||||
import 'package:PiliPalaX/models/common/reply_type.dart';
|
||||
@@ -53,6 +52,12 @@ class VideoReplyReplyController extends CommonController {
|
||||
return true;
|
||||
}
|
||||
|
||||
@override
|
||||
Future queryData([bool isRefresh = true]) {
|
||||
if (noMore.value == '没有更多了') return Future.value();
|
||||
return super.queryData(isRefresh);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<LoadingState> customGetData() => ReplyHttp.replyReplyList(
|
||||
oid: aid!,
|
||||
|
||||
@@ -18,7 +18,6 @@ class VideoReplyReplyPanel extends StatefulWidget {
|
||||
this.rcount,
|
||||
this.oid,
|
||||
this.rpid,
|
||||
this.closePanel,
|
||||
this.firstFloor,
|
||||
this.source,
|
||||
this.replyType,
|
||||
@@ -27,7 +26,6 @@ class VideoReplyReplyPanel extends StatefulWidget {
|
||||
final dynamic rcount;
|
||||
final int? oid;
|
||||
final int? rpid;
|
||||
final Function? closePanel;
|
||||
final ReplyItemModel? firstFloor;
|
||||
final String? source;
|
||||
final ReplyType? replyType;
|
||||
@@ -44,9 +42,10 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
_videoReplyReplyController = Get.put(
|
||||
VideoReplyReplyController(
|
||||
widget.oid, widget.rpid.toString(), widget.replyType!),
|
||||
tag: widget.rpid.toString());
|
||||
VideoReplyReplyController(
|
||||
widget.oid, widget.rpid.toString(), widget.replyType!),
|
||||
tag: widget.rpid.toString(),
|
||||
);
|
||||
|
||||
// 上拉加载更多
|
||||
_videoReplyReplyController.scrollController.addListener(
|
||||
@@ -64,11 +63,10 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
);
|
||||
}
|
||||
|
||||
void replyReply(replyItem) {}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_videoReplyReplyController.scrollController.removeListener(() {});
|
||||
Get.delete<VideoReplyReplyController>(tag: widget.rpid.toString());
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -91,10 +89,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
IconButton(
|
||||
tooltip: '关闭',
|
||||
icon: const Icon(Icons.close, size: 20),
|
||||
onPressed: () {
|
||||
widget.closePanel!();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
onPressed: Get.back,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -123,7 +118,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
// _videoReplyReplyController.replyList.add(replyItem);
|
||||
},
|
||||
replyType: widget.replyType,
|
||||
replyReply: replyReply,
|
||||
replyReply: () {},
|
||||
needDivider: false,
|
||||
onReply: () {
|
||||
_onReply(widget.firstFloor);
|
||||
@@ -209,7 +204,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
// _videoReplyReplyController.replyList.add(replyItem);
|
||||
},
|
||||
replyType: widget.replyType,
|
||||
replyReply: replyReply,
|
||||
replyReply: () {},
|
||||
needDivider: false,
|
||||
onReply: () {
|
||||
_onReply(_videoReplyReplyController.root);
|
||||
|
||||
Reference in New Issue
Block a user