LGButton.custom constructor

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

Creates a glass button with custom content.

Allows you to use any widget as the button's content instead of just an icon. Useful for text buttons, composite content, or custom designs.

Implementation

const LGButton.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 = LGQuality.standard,
  this.interactionScale = 1.05,
  this.stretch = 0.5,
  this.resistance = 0.08,
  this.stretchHitTestBehavior = HitTestBehavior.opaque,
  this.glowColor = Colors.white24,
  this.glowRadius = 1.0,
  this.glowHitTestBehavior = HitTestBehavior.opaque,
  this.enabled = true,
  this.style = LGButtonStyle.filled,
})  : icon = null,
      iconSize = 24.0,
      iconColor = Colors.white;