Lay out chat content against the animated pane viewport
This commit is contained in:
@@ -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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -172,12 +172,6 @@ class _ChatWorkspaceState extends State<ChatWorkspace> {
|
||||
peek: mobile?.peekId == pane.id,
|
||||
label: widget.paneTitle?.call(pane) ?? pane.sessionId,
|
||||
paneId: pane.id,
|
||||
height:
|
||||
(mobile?.rects[pane.id] ??
|
||||
(collapsed
|
||||
? Offset.zero & constraints.biggest
|
||||
: geometry.panes[pane.id]!))
|
||||
.height,
|
||||
onActivate: () {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
widget.controller.activate(pane.id);
|
||||
|
||||
Reference in New Issue
Block a user