GlassBarItem class sealed

A single item in a pinned navigation-bar cluster.

Mirrors UIKit's UIBarButtonItem: items are declared as data, and the system owns their placement. There is deliberately no way to offset or reposition a cluster — iOS 26 provides no such API either, and the only lever it does provide (splitting the shared background) is modelled by GlassBarItem.spacer.

That constraint is what makes custom content simple: a custom widget is an item, so the cluster measures and lays itself out around it. A screen never has to tell the bar to make room.

GlassAppBar.pinned(
  title: const Text('Repository'),
  actions: [
    GlassBarItem.icon(icon: const Icon(CupertinoIcons.add), id: 'add', onTap: _add),
    GlassBarItem.custom(child: UnreadPill(count: 3), onTap: _openInbox),
  ],
)
Implementers

Constructors

GlassBarItem.custom({required Widget child, VoidCallback? onTap, Object? id, String? label, bool enabled, GlassBarItemBackground background, Color? tintColor, GlassBarItemAxisBehavior axisBehavior})
An arbitrary widget inside the pinned cluster.
const
factory
GlassBarItem.icon({required Widget icon, required VoidCallback onTap, Object? id, String? label, bool enabled, GlassBarItemBackground background, Color? tintColor, GlassBarItemAxisBehavior axisBehavior})
An icon button inside the pinned cluster.
const
factory
GlassBarItem.menu({required Widget icon, required List<Widget> menuItems, GlassMenuAlignment? menuAlignment, double menuWidth, double? menuHeight, Object? id, String? label, GlassBarItemBackground background, Color? tintColor, GlassBarItemAxisBehavior axisBehavior})
An icon that opens a GlassMenu pull-down, mirroring UIBarButtonItem.menu — the standard iOS 26 overflow button.
const
factory
GlassBarItem.sheet({required Widget icon, required void onPresent(GlassMorphAnchor? anchor), Object? id, String? label, bool enabled, GlassBarItemBackground background, Color? tintColor, GlassBarItemAxisBehavior axisBehavior})
An icon whose tap presents a GlassModalSheet that morphs out of the capsule, mirroring the iOS 26 bar button that grows into a sheet.
const
factory
GlassBarItem.spacer()
Splits the shared glass background, mirroring SwiftUI's ToolbarSpacer(.fixed) and UIKit's UIBarButtonItem.fixedSpace.
const
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited