Chat: the transcript ends at the composer's top; the colour wash starts at the bar's top edge
This commit is contained in:
@@ -95,6 +95,26 @@ class BelowTopBar extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
/// Content that must not run behind the floating bar (a [FloatingBarOverlay]'s
|
||||
/// bar, such as a composer): it ends at the bar's top edge, so the viewport
|
||||
/// shrinks as the bar grows, and its subtree no longer sees the bar's height
|
||||
/// as padding.
|
||||
class AboveFloatingBar extends StatelessWidget {
|
||||
const AboveFloatingBar({super.key, required this.child});
|
||||
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Padding(
|
||||
padding: EdgeInsets.only(bottom: MediaQuery.paddingOf(context).bottom),
|
||||
child: MediaQuery.removePadding(
|
||||
context: context,
|
||||
removeBottom: true,
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Empty space as tall as the floating bar's clearance
|
||||
/// ([MediaQuery.paddingOf] bottom), ending a scrolling column so its last item
|
||||
/// comes clear of the bar at rest.
|
||||
|
||||
@@ -54,6 +54,7 @@ class SegmentedBar extends StatefulWidget
|
||||
this.pillColor,
|
||||
this.foregroundColor,
|
||||
this.bottomPadding = 8,
|
||||
this.backdrop,
|
||||
});
|
||||
|
||||
/// Which control family to draw. Required because the bar's reserved
|
||||
@@ -116,6 +117,10 @@ class SegmentedBar extends StatefulWidget
|
||||
/// Space between the pieces and the content below.
|
||||
final double bottomPadding;
|
||||
|
||||
/// Painted over the scrim and under the pieces, filling the bar from its
|
||||
/// top edge (a page's own tint, such as a chat's colour). It takes no taps.
|
||||
final Widget? backdrop;
|
||||
|
||||
static const double _topPadding = 8;
|
||||
|
||||
/// The share of the bar the title keeps before the actions shrink.
|
||||
@@ -461,6 +466,8 @@ class _SegmentedBarState extends State<SegmentedBar> {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (widget.backdrop case final backdrop?)
|
||||
Positioned.fill(child: IgnorePointer(child: backdrop)),
|
||||
SafeArea(
|
||||
bottom: false,
|
||||
child: Padding(
|
||||
|
||||
Reference in New Issue
Block a user