GlassButtonGroup class

A container that groups multiple buttons in a single glass pill.

Two usage modes

Use GlassButtonGroup.icons with GlassButtonGroupItem data objects. Each item is rendered as a minimal icon with tap handling — no animation controllers or glass shaders per item. The group provides the glass surface.

GlassButtonGroup.icons(
  items: [
    GlassButtonGroupItem(icon: Icon(CupertinoIcons.text_alignleft), onTap: () {}),
    GlassButtonGroupItem(icon: Icon(CupertinoIcons.trash), onTap: () {}),
    GlassButtonGroupItem(icon: Icon(CupertinoIcons.add), onTap: () {}),
  ],
)

2. Full widget children

Use the default constructor with GlassButton children for full control over each button's style, stretch, and glow.

GlassButtonGroup(
  children: [
    GlassButton(icon: Icon(CupertinoIcons.bold), style: GlassButtonStyle.transparent, onTap: () {}),
    GlassButton(icon: Icon(CupertinoIcons.italic), style: GlassButtonStyle.transparent, onTap: () {}),
  ],
)
Inheritance

Constructors

GlassButtonGroup({required List<Widget> children, Key? key, Axis direction = Axis.horizontal, LiquidGlassSettings? settings, GlassQuality? quality, double borderRadius = 16.0, Color? borderColor, bool useOwnLayer = false, bool showDividers = true, double iconSize = 22.0, EdgeInsetsGeometry itemPadding = const EdgeInsets.all(12), bool platformViewBackdrop = false})
Creates a group of glass buttons from widget children.
const
GlassButtonGroup.icons({required List<GlassButtonGroupItem> items, Key? key, Axis direction = Axis.horizontal, LiquidGlassSettings? settings, GlassQuality? quality, double borderRadius = 22.0, Color? borderColor, bool useOwnLayer = false, bool showDividers = false, double iconSize = 22.0, EdgeInsetsGeometry itemPadding = const EdgeInsets.all(12), bool platformViewBackdrop = false})
Creates a group of glass buttons from lightweight GlassButtonGroupItems.
const

Properties

borderColor → Color?
Color of the dividers between buttons.
final
borderRadius → double
Border radius of the group container.
final
children → List<Widget>
The buttons to display in the group (widget children mode).
final
direction → Axis
Direction to arrange buttons (horizontal or vertical).
final
hashCode → int
The hash code for this object.
no setterinherited
iconSize → double
The icon size used for items in GlassButtonGroup.icons mode.
final
itemPadding → EdgeInsetsGeometry
Padding around each item in GlassButtonGroup.icons mode.
final
items → List<GlassButtonGroupItem>?
Lightweight item data for icon-based groups.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
platformViewBackdrop → bool
Forces the BackdropFilter fallback render path so premium glass renders cleanly over an iOS PlatformView.
final
quality → GlassQuality?
Quality of glass effect.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
settings → LiquidGlassSettings?
Custom glass settings.
final
showDividers → bool
Whether to show dividers between buttons.
final
useOwnLayer → bool
Whether to create its own glass layer.
final

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

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