GlassAppBar constructor
const
GlassAppBar({
- Key? key,
- Widget? title,
- Widget? leading,
- List<
Widget> ? actions, - bool centerTitle = true,
- Color backgroundColor = const Color(0x00000000),
- double toolbarHeight = 44.0,
- EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 8),
- LiquidGlassSettings? buttonSettings,
- GlassLargeTitleController? largeTitleController,
- PreferredSizeWidget? bottom,
- bool groupBackdrop = true,
Creates a glass app bar with widget-based leading and actions.
The bar itself is a simple layout container with a backgroundColor.
Glass effects are rendered by individual child widgets (e.g. GlassButton)
inside the bar — not by the bar surface.
A bar built this way never participates in navigation pinning: its widgets live in the route and slide with the page. Use GlassAppBar.pinned for the iOS 26 behaviour where the back button and actions stay put across route transitions.
Implementation
const GlassAppBar({
super.key,
this.title,
this.leading,
this.actions,
this.centerTitle = true,
// Whitelisted: Structural transparent default, not a Material colour.
this.backgroundColor = const Color(0x00000000),
this.toolbarHeight = 44.0,
this.padding = const EdgeInsets.symmetric(horizontal: 8),
this.buttonSettings,
this.largeTitleController,
this.bottom,
this.groupBackdrop = true,
}) : pinnedActions = null,
pinnedLeading = const <GlassBarItem>[],
pinnedBackButton = true,
pinnedLeadingItemsSupplementBackButton = false,
onBack = null,
buttonSize = null;