Files
pipelines/app/lib/ui/adaptive/top_glass_strip.dart
T
alan 9551eceaed Complete Material-only APIs and fixtures
Remove obsolete control-family flags and icon metadata across all callers, dead alternate themes and host helpers, obsolete test setup, and the unused icon-font dependency. Preserve native Material Back transitions. Make navigation fixtures independent of update plugins and answer auxiliary shell snapshots so the complete application suite can run deterministically.
2026-11-11 21:55:39 +00:00

61 lines
1.9 KiB
Dart

import 'package:flutter/widgets.dart';
import 'glass_pill.dart';
import 'window_margins.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 side inset
/// ([WindowMargins.sideOf]), 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.child,
this.maxWidth = double.infinity,
this.padding = const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
});
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);
final side = WindowMargins.sideOf(context);
return Padding(
padding: EdgeInsets.fromLTRB(
side + insets.left,
0,
side + insets.right,
8,
),
child: Align(
alignment: AlignmentDirectional.topStart,
heightFactor: 1,
child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: maxWidth),
child: GlassPill(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(kTopGlassStripRadius),
),
child: Padding(padding: padding, child: child),
),
),
),
);
}
}