GlassButton constructor

const GlassButton({
  1. required IconData? icon,
  2. required VoidCallback onTap,
  3. Key? key,
  4. String label = '',
  5. double width = 56,
  6. double height = 56,
  7. double iconSize = 24.0,
  8. Color iconColor = Colors.white,
  9. LiquidShape shape = const LiquidOval(),
  10. LiquidGlassSettings? settings,
  11. bool useOwnLayer = false,
  12. GlassQuality quality = GlassQuality.standard,
  13. double interactionScale = 1.05,
  14. double stretch = 0.5,
  15. double resistance = 0.08,
  16. HitTestBehavior stretchHitTestBehavior = HitTestBehavior.opaque,
  17. Color glowColor = Colors.white24,
  18. double glowRadius = 1.0,
  19. HitTestBehavior glowHitTestBehavior = HitTestBehavior.opaque,
  20. bool enabled = true,
  21. GlassButtonStyle style = GlassButtonStyle.filled,
})

Creates a glass button with an icon.

Implementation

const GlassButton({
  required this.icon,
  required this.onTap,
  super.key,
  this.label = '',
  this.width = 56,
  this.height = 56,
  this.iconSize = 24.0,
  this.iconColor = Colors.white,
  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,
}) : child = null;