added spacing when overlay has footer overflow (#1087)

This commit is contained in:
ggurdin 2024-11-21 10:53:49 -05:00 committed by GitHub
parent d0196fe0f7
commit 1c65aa393e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 6 deletions

View file

@ -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,

View file

@ -380,7 +380,7 @@ class MessageOverlayController extends State<MessageSelectionOverlay>
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<MessageSelectionOverlay>
}
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,

View file

@ -34,7 +34,7 @@ class OverlayFooter extends StatelessWidget {
borderRadius: const BorderRadius.all(
Radius.circular(AppConfig.borderRadius),
),
child: ChatInputRow(controller),
child: ChatInputRow(controller, isOverlay: true),
),
],
),