From d0ebedac0a83b3121c5ab1d117edc67f43607cf7 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Fri, 18 Apr 2025 21:47:18 +0800 Subject: [PATCH] fix: part: jump to curr Signed-off-by: bggRGjQaUbCoE --- lib/pages/live/controller.dart | 2 +- lib/pages/video/detail/introduction/widgets/page.dart | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/pages/live/controller.dart b/lib/pages/live/controller.dart index 8d56f01a..47800de9 100644 --- a/lib/pages/live/controller.dart +++ b/lib/pages/live/controller.dart @@ -35,7 +35,7 @@ class LiveController late RxInt liveCount = 0.obs; Future fetchLiveFollowing([bool isRefresh = true]) async { - if (isRefresh.not && followEnd) { + if (!isLogin.value || (isRefresh.not && followEnd)) { return; } if (isRefresh) { diff --git a/lib/pages/video/detail/introduction/widgets/page.dart b/lib/pages/video/detail/introduction/widgets/page.dart index 1365e35a..24ab5779 100644 --- a/lib/pages/video/detail/introduction/widgets/page.dart +++ b/lib/pages/video/detail/introduction/widgets/page.dart @@ -64,6 +64,9 @@ class _PagesPanelState extends State { } void jumpToCurr() { + if (!_scrollController.hasClients || pages.isEmpty) { + return; + } const double itemWidth = 150; // 每个列表项的宽度 final double targetOffset = (pageIndex * itemWidth - itemWidth / 2).clamp( _scrollController.position.minScrollExtent,