e34fa1050e
- SegmentedBar.titleWidget (and ShellBar/ShellBarSpec titleWidget, backgroundColor): a bar's main pill can be an input in place of the title; Search uses it so the field fills the bar with Kind and info, capped at the result column width so field and results share edges on wide windows. - Templates page/frame drop the top SafeArea again (BelowTopBar gate, TopBarNotices banners); Cupertino uses the grouped background. - Settings on Cupertino in the shell publishes the grouped background so the bar scrim matches the page (no white band or seam). - TopGlassStrip: the run detail header (status, actions, decision, notices) and the Schedules search/filter toolbar float as glass under the bar; tabs and lists scroll behind both. - Stage page: stage title and Visit/Run subtitle in the bar, facts lead the Summary scroll, sections scroll behind the bar under floating tabs. - Tests for content-behind-bar on each page and the title-widget bar mode; notes/chrome-gaps-fixes.md.
57 lines
1.8 KiB
Dart
57 lines
1.8 KiB
Dart
import 'package:flutter/widgets.dart';
|
|
|
|
import 'glass_pill.dart';
|
|
|
|
/// The corner radius of a [TopGlassStrip].
|
|
const double kTopGlassStripRadius = 22;
|
|
|
|
/// A page's own controls as one frosted piece floating just under its top
|
|
/// bar (a run's status and actions, a list's search and filter), so content
|
|
/// scrolls behind it as it does behind the bar.
|
|
///
|
|
/// Float it with `FloatingBarOverlay(edge: FloatingBarEdge.top)`: the strip
|
|
/// sits below the bar and the content's top padding grows by the strip's
|
|
/// height, so at rest nothing is hidden. It starts at the bar's 12px side
|
|
/// inset, is as wide as its content up to [maxWidth] (and the area), and is
|
|
/// only as tall as its content; the space beside it passes taps through.
|
|
class TopGlassStrip extends StatelessWidget {
|
|
const TopGlassStrip({
|
|
super.key,
|
|
required this.cupertino,
|
|
required this.child,
|
|
this.maxWidth = double.infinity,
|
|
this.padding = const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
|
});
|
|
|
|
final bool cupertino;
|
|
final Widget child;
|
|
|
|
/// The widest the strip grows on a wide window.
|
|
final double maxWidth;
|
|
|
|
/// Space between the strip's edge and [child].
|
|
final EdgeInsetsGeometry padding;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final insets = MediaQuery.paddingOf(context);
|
|
return Padding(
|
|
padding: EdgeInsets.fromLTRB(12 + insets.left, 0, 12 + insets.right, 8),
|
|
child: Align(
|
|
alignment: AlignmentDirectional.topStart,
|
|
heightFactor: 1,
|
|
child: ConstrainedBox(
|
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
|
child: GlassPill(
|
|
cupertino: cupertino,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(kTopGlassStripRadius),
|
|
),
|
|
child: Padding(padding: padding, child: child),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|