Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-11 17:01:33 +08:00
parent 60c25e4b65
commit 17b7eb7e0f
4 changed files with 48 additions and 65 deletions

View File

@@ -196,8 +196,7 @@ class LiveRoomController extends GetxController {
);
}
void scrollToBottom() {
if (disableAutoScroll.value) return;
void scrollToBottom([_]) {
if (scrollController.hasClients) {
scrollController.animateTo(
scrollController.position.maxScrollExtent,
@@ -231,9 +230,7 @@ class LiveRoomController extends GetxController {
},
),
);
WidgetsBinding.instance.addPostFrameCallback(
(_) => scrollToBottom(),
);
WidgetsBinding.instance.addPostFrameCallback(scrollToBottom);
} catch (_) {}
}
}
@@ -334,9 +331,9 @@ class LiveRoomController extends GetxController {
selfSend: isLogin && uid == accountService.mid,
),
);
if (!isFullScreen) {
if (!isFullScreen && !disableAutoScroll.value) {
WidgetsBinding.instance.addPostFrameCallback(
(_) => scrollToBottom(),
scrollToBottom,
);
}
}