added spacing when overlay has footer overflow (#1087)
This commit is contained in:
parent
d0196fe0f7
commit
1c65aa393e
3 changed files with 15 additions and 6 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class OverlayFooter extends StatelessWidget {
|
|||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
child: ChatInputRow(controller),
|
||||
child: ChatInputRow(controller, isOverlay: true),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue