GlassButton constructor

const GlassButton({
  1. required Widget? 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,
  9. LiquidShape shape = const LiquidOval(),
  10. LiquidGlassSettings? settings,
  11. bool useOwnLayer = false,
  12. GlassQuality? quality,
  13. FocusNode? focusNode,
  14. bool autofocus = false,
  15. double interactionScale = 1.05,
  16. double stretch = 0.5,
  17. double resistance = 0.01,
  18. HitTestBehavior stretchHitTestBehavior = HitTestBehavior.opaque,
  19. Color? glowColor,
  20. double glowRadius = 1.0,
  21. double? glowBlurRadius,
  22. double? glowSpreadRadius,
  23. double? glowOpacity,
  24. HitTestBehavior glowHitTestBehavior = HitTestBehavior.opaque,
  25. bool enabled = true,
  26. GlassButtonStyle style = GlassButtonStyle.filled,
  27. bool persistPressOnDrag = true,
  28. bool anchorStretch = true,
  29. AnchorStretchSettings anchorStretchSettings = const AnchorStretchSettings(),
  30. AlignmentGeometry alignment = Alignment.center,
  31. double ambientBaseLight = 0.08,
  32. bool platformViewBackdrop = false,
  33. bool canRequestFocus = true,
  34. bool excludeFromSemantics = false,
  35. bool isStationary = false,
})

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,
  this.shape = const LiquidOval(),
  this.settings,
  this.useOwnLayer = false,
  this.quality,
  this.focusNode,
  this.autofocus = false,
  // LiquidStretch properties
  this.interactionScale = 1.05,
  this.stretch = 0.5,
  this.resistance = 0.01,
  this.stretchHitTestBehavior = HitTestBehavior.opaque,
  // GlassGlow properties
  this.glowColor,
  this.glowRadius = 1.0,
  this.glowBlurRadius,
  this.glowSpreadRadius,
  this.glowOpacity,
  this.glowHitTestBehavior = HitTestBehavior.opaque,
  this.enabled = true,
  this.style = GlassButtonStyle.filled,
  this.persistPressOnDrag = true,
  this.anchorStretch = true,
  this.anchorStretchSettings = const AnchorStretchSettings(),
  this.alignment = Alignment.center,
  this.ambientBaseLight = 0.08,
  this.platformViewBackdrop = false,
  this.canRequestFocus = true,
  this.excludeFromSemantics = false,
  this.isStationary = false,
}) : child = null;