mod: 楼中楼回复

This commit is contained in:
guozhigq
2023-04-28 23:05:29 +08:00
parent b85c89e805
commit e971fbc876
7 changed files with 136 additions and 12 deletions

View File

@ -7,7 +7,15 @@ import 'controller.dart';
import 'widgets/reply_item.dart';
class VideoReplyPanel extends StatefulWidget {
const VideoReplyPanel({super.key});
int oid;
int rpid;
String level;
VideoReplyPanel({
this.oid = 0,
this.rpid = 0,
this.level = '',
super.key,
});
@override
State<VideoReplyPanel> createState() => _VideoReplyPanelState();
@ -15,8 +23,8 @@ class VideoReplyPanel extends StatefulWidget {
class _VideoReplyPanelState extends State<VideoReplyPanel>
with AutomaticKeepAliveClientMixin {
final VideoReplyController _videoReplyController =
Get.put(VideoReplyController(), tag: Get.arguments['heroTag']);
late VideoReplyController _videoReplyController;
// List<ReplyItemModel>? replyList;
Future? _futureBuilderFuture;
// 添加页面缓存
@ -26,6 +34,16 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
@override
void initState() {
super.initState();
if (widget.level == '2') {
_videoReplyController = Get.put(
VideoReplyController(
widget.oid.toString(), widget.rpid.toString(), '2'),
tag: widget.rpid.toString());
} else {
_videoReplyController = Get.put(
VideoReplyController(Get.parameters['aid']!, '', '1'),
tag: Get.arguments['heroTag']);
}
_futureBuilderFuture = _videoReplyController.queryReplyList();
_videoReplyController.scrollController.addListener(