UiButton.circle constructor

UiButton.circle({
  1. Key? key,
  2. Widget? icon,
  3. String? label,
  4. required VoidCallback? onPressed,
  5. double size = 48,
  6. Color? color,
  7. Color? foregroundColor,
  8. String? tooltip,
  9. Color? borderColor,
  10. Gradient? gradient,
})

Implementation

factory UiButton.circle({
  Key? key,
  Widget? icon,
  String? label,
  required VoidCallback? onPressed,
  double size = 48,
  Color? color,
  Color? foregroundColor,
  String? tooltip,
  Color? borderColor,
  Gradient? gradient,
}) {
  return UiButton._internal(
    key: key,
    icon: icon,
    label: label,
    onPressed: onPressed,
    tooltip: tooltip,
    type: _UiButtonType.circle,
    borderColor: borderColor,
    gradient: gradient,
    style: ElevatedButton.styleFrom(
      shape: CircleBorder(
        side: borderColor != null
            ? BorderSide(color: borderColor, width: 1.2)
            : BorderSide.none,
      ),
      minimumSize: Size(size, size),
      backgroundColor:
          gradient == null ? (color ?? primary) : Colors.transparent,
      foregroundColor: foregroundColor ?? white,
      padding: EdgeInsets.zero,
      textStyle: const TextStyle(fontWeight: FontWeight.bold),
    ),
  );
}