From 1c65aa393e97e6a06898885bd5f8d65c935eddcb Mon Sep 17 00:00:00 2001 From: ggurdin <46800240+ggurdin@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:53:49 -0500 Subject: [PATCH] added spacing when overlay has footer overflow (#1087) --- lib/pages/chat/chat_input_row.dart | 13 +++++++++++-- .../widgets/chat/message_selection_overlay.dart | 6 +++--- lib/pangea/widgets/chat/overlay_footer.dart | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/pages/chat/chat_input_row.dart b/lib/pages/chat/chat_input_row.dart index 6cac87b92..3ed4ce8a0 100644 --- a/lib/pages/chat/chat_input_row.dart +++ b/lib/pages/chat/chat_input_row.dart @@ -18,8 +18,15 @@ import 'input_bar.dart'; class ChatInputRow extends StatelessWidget { final ChatController controller; + // #Pangea + final bool isOverlay; + // Pangea# - const ChatInputRow(this.controller, {super.key}); + const ChatInputRow( + this.controller, { + this.isOverlay = false, + super.key, + }); @override Widget build(BuildContext context) { @@ -60,7 +67,9 @@ class ChatInputRow extends StatelessWidget { CompositedTransformTarget( link: controller.choreographer.inputLayerLinkAndKey.link, child: Row( - key: controller.choreographer.inputLayerLinkAndKey.key, + key: isOverlay + ? null + : controller.choreographer.inputLayerLinkAndKey.key, // crossAxisAlignment: CrossAxisAlignment.end, // mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/pangea/widgets/chat/message_selection_overlay.dart b/lib/pangea/widgets/chat/message_selection_overlay.dart index 46813aa4b..a66bcae0d 100644 --- a/lib/pangea/widgets/chat/message_selection_overlay.dart +++ b/lib/pangea/widgets/chat/message_selection_overlay.dart @@ -380,7 +380,7 @@ class MessageOverlayController extends State final bool hasHeaderOverflow = _messageOffset!.dy < (AppConfig.toolbarMaxHeight + _headerHeight); - final bool hasFooterOverflow = _footerHeight > currentBottomOffset; + final bool hasFooterOverflow = (_footerHeight + 5) > currentBottomOffset; if (!hasHeaderOverflow && !hasFooterOverflow) return; @@ -407,8 +407,8 @@ class MessageOverlayController extends State } scrollOffset = animationEndOffset - currentBottomOffset; } else if (hasFooterOverflow) { - scrollOffset = _footerHeight - currentBottomOffset; - animationEndOffset = _footerHeight; + scrollOffset = (_footerHeight + 5) - currentBottomOffset; + animationEndOffset = (_footerHeight + 5); } // If, after ajusting the overlay position, the message still overflows the footer, diff --git a/lib/pangea/widgets/chat/overlay_footer.dart b/lib/pangea/widgets/chat/overlay_footer.dart index bdb6e5d74..98d8d696f 100644 --- a/lib/pangea/widgets/chat/overlay_footer.dart +++ b/lib/pangea/widgets/chat/overlay_footer.dart @@ -34,7 +34,7 @@ class OverlayFooter extends StatelessWidget { borderRadius: const BorderRadius.all( Radius.circular(AppConfig.borderRadius), ), - child: ChatInputRow(controller), + child: ChatInputRow(controller, isOverlay: true), ), ], ),