From 6424f95855c4db2ab9f7f22159cac10b7f0dcfc8 Mon Sep 17 00:00:00 2001 From: Kelrap Date: Tue, 16 Jul 2024 11:25:54 -0400 Subject: [PATCH] Fix some incorrect calculations --- lib/pangea/widgets/chat/message_toolbar.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pangea/widgets/chat/message_toolbar.dart b/lib/pangea/widgets/chat/message_toolbar.dart index 7794f46cf..5f378657d 100644 --- a/lib/pangea/widgets/chat/message_toolbar.dart +++ b/lib/pangea/widgets/chat/message_toolbar.dart @@ -86,8 +86,9 @@ class ToolbarDisplayController { // If message is too close to top, make space for toolbar if (targetOffset.dy < 360) { // If chat can scroll up, do so - final scrollTo = scrollController.offset - targetOffset.dy + 360 + 118; - if (scrollTo >= 0) { + final scrollTo = scrollController.offset - targetOffset.dy + 300; + if (scrollTo >= scrollController.position.minScrollExtent && + scrollTo <= scrollController.position.maxScrollExtent) { scrollController.animateTo( scrollTo, duration: FluffyThemes.animationDuration,