Measure retained peek chrome without constraining its hidden contents
This commit is contained in:
@@ -47,29 +47,38 @@ class ChatPaneBarReveal extends StatelessWidget {
|
||||
final reveal = presentation.barReveal;
|
||||
final peek = presentation.peek;
|
||||
// One tree in both roles, so the bar's element outlives a switch.
|
||||
return AnimatedBuilder(
|
||||
animation: reveal,
|
||||
child: IgnorePointer(
|
||||
ignoring: peek,
|
||||
child: SizeTransition(
|
||||
alignment: Alignment.topCenter,
|
||||
sizeFactor: reveal,
|
||||
child: FadeTransition(
|
||||
opacity: reveal,
|
||||
child: SlideTransition(
|
||||
position: Tween<Offset>(
|
||||
begin: const Offset(0, -slide),
|
||||
end: Offset.zero,
|
||||
).animate(reveal),
|
||||
// The bar's own picture holds while it slides; only its offset
|
||||
// and alpha change per tick.
|
||||
child: RepaintBoundary(child: bar),
|
||||
// Overlay slots cap chrome at the pane height. A resting peek can be
|
||||
// shorter than its retained composer (large text + keyboard). Give only
|
||||
// chrome its natural height before SizeTransition consumes that height;
|
||||
// the transcript itself always keeps the real pane constraints.
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
AnimatedBuilder(
|
||||
animation: reveal,
|
||||
child: IgnorePointer(
|
||||
ignoring: peek,
|
||||
child: SizeTransition(
|
||||
alignment: Alignment.topCenter,
|
||||
sizeFactor: reveal,
|
||||
child: FadeTransition(
|
||||
opacity: reveal,
|
||||
child: SlideTransition(
|
||||
position: Tween<Offset>(
|
||||
begin: const Offset(0, -slide),
|
||||
end: Offset.zero,
|
||||
).animate(reveal),
|
||||
// The bar's own picture holds while it slides; only its offset
|
||||
// and alpha change per tick.
|
||||
child: RepaintBoundary(child: bar),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
builder: (context, child) =>
|
||||
Offstage(offstage: peek && reveal.value <= 0, child: child),
|
||||
),
|
||||
),
|
||||
builder: (context, child) =>
|
||||
Offstage(offstage: peek && reveal.value <= 0, child: child),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user