GlassButton.custom constructor
const
GlassButton.custom({
- required Widget? child,
- required VoidCallback onTap,
- Key? key,
- String label = '',
- double width = 56,
- double height = 56,
- LiquidShape shape = const LiquidOval(),
- LiquidGlassSettings? settings,
- bool useOwnLayer = false,
- GlassQuality quality = GlassQuality.standard,
- double interactionScale = 1.05,
- double stretch = 0.5,
- double resistance = 0.08,
- HitTestBehavior stretchHitTestBehavior = HitTestBehavior.opaque,
- Color glowColor = Colors.white24,
- double glowRadius = 1.0,
- HitTestBehavior glowHitTestBehavior = HitTestBehavior.opaque,
- bool enabled = true,
- GlassButtonStyle style = GlassButtonStyle.filled,
Creates a glass button with custom content.
This allows you to use any widget as the button's content instead of just an icon. Useful for text buttons, composite content, etc.
Example:
GlassButton.custom(
onTap: () {},
width: 120,
height: 48,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(CupertinoIcons.play, size: 16),
SizedBox(width: 8),
Text('Play'),
],
),
)
Implementation
const GlassButton.custom({
required this.child,
required this.onTap,
super.key,
this.label = '',
this.width = 56,
this.height = 56,
this.shape = const LiquidOval(),
this.settings,
this.useOwnLayer = false,
this.quality = GlassQuality.standard,
// LiquidStretch properties
this.interactionScale = 1.05,
this.stretch = 0.5,
this.resistance = 0.08,
this.stretchHitTestBehavior = HitTestBehavior.opaque,
// GlassGlow properties
this.glowColor = Colors.white24,
this.glowRadius = 1.0,
this.glowHitTestBehavior = HitTestBehavior.opaque,
this.enabled = true,
this.style = GlassButtonStyle.filled,
}) : icon = null,
iconSize = 24.0,
iconColor = Colors.white;