feat: 动态主楼评论

This commit is contained in:
guozhigq
2023-09-12 18:54:56 +08:00
parent 7867af0f85
commit 838467451b
4 changed files with 281 additions and 170 deletions

View File

@ -62,6 +62,12 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
vsync: this, duration: const Duration(milliseconds: 300));
_futureBuilderFuture = _videoReplyController.queryReplyList();
fabAnimationCtr.forward();
scrollListener();
}
void scrollListener() {
scrollController = _videoReplyController.scrollController;
scrollController.addListener(
() {
@ -81,7 +87,6 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
}
},
);
fabAnimationCtr.forward();
}
void _showFab() {
@ -112,9 +117,10 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
@override
void dispose() {
super.dispose();
scrollController.removeListener(() {});
fabAnimationCtr.dispose();
scrollController.dispose();
super.dispose();
}
@override
@ -128,7 +134,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
child: Stack(
children: [
CustomScrollView(
controller: _videoReplyController.scrollController,
controller: scrollController,
key: const PageStorageKey<String>('评论'),
slivers: <Widget>[
SliverPersistentHeader(

View File

@ -744,11 +744,14 @@ InlineSpan buildContent(
recognizer: TapGestureRecognizer()
..onTap = () {
// 跳转到指定位置
Get.find<VideoDetailController>(tag: Get.arguments['heroTag'])
.plPlayerController
.seekTo(
Duration(seconds: Utils.duration(matchStr)),
);
try {
Get.find<VideoDetailController>(
tag: Get.arguments['heroTag'])
.plPlayerController
.seekTo(
Duration(seconds: Utils.duration(matchStr)),
);
} catch (_) {}
},
),
);