Lay out chat content against the animated pane viewport

This commit is contained in:
2026-11-06 21:48:25 +00:00
parent 2cd8003e3a
commit 2cadebab4b
4 changed files with 48 additions and 38 deletions
@@ -51,50 +51,53 @@ class ChatMobilePaneViewport extends StatelessWidget {
super.key,
required this.peek,
required this.child,
required this.height,
required this.onActivate,
required this.label,
required this.paneId,
});
final bool peek;
final double height;
final Widget child;
final VoidCallback onActivate;
final String label;
final String paneId;
@override
Widget build(BuildContext context) => ClipRect(
child: Stack(
fit: StackFit.expand,
children: [
OverflowBox(
alignment: Alignment.topCenter,
minHeight: height,
maxHeight: peek ? math.max(height, 300) : height,
child: SizedBox(
height: peek ? math.max(height, 300) : height,
child: ExcludeFocus(
excluding: peek,
child: ExcludeSemantics(
excluding: peek,
child: IgnorePointer(ignoring: peek, child: child),
Widget build(BuildContext context) => LayoutBuilder(
builder: (context, constraints) {
final height = constraints.maxHeight;
return ClipRect(
child: Stack(
fit: StackFit.expand,
children: [
OverflowBox(
alignment: Alignment.topCenter,
minHeight: height,
maxHeight: peek ? math.max(height, 300) : height,
child: SizedBox(
height: peek ? math.max(height, 300) : height,
child: ExcludeFocus(
excluding: peek,
child: ExcludeSemantics(
excluding: peek,
child: IgnorePointer(ignoring: peek, child: child),
),
),
),
),
),
if (peek)
Semantics(
key: ValueKey('chat-peek-$paneId'),
identifier: 'chat-peek-$paneId',
container: true,
label: 'Expand $label',
button: true,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: onActivate,
),
),
],
),
if (peek)
Semantics(
key: ValueKey('chat-peek-$paneId'),
identifier: 'chat-peek-$paneId',
container: true,
label: 'Expand $label',
button: true,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: onActivate,
),
),
],
),
);
},
);
}