CustomActionButton.iconOnly constructor

CustomActionButton.iconOnly({
  1. Key? key,
  2. VoidCallback? onPressed,
  3. required Widget icon,
  4. ButtonType baseType = ButtonType.elevated,
  5. bool disabled = false,
  6. bool isLoading = false,
  7. Widget? loadingIndicator,
  8. Color? backgroundColor,
  9. Color? foregroundColor,
  10. Color? shadowColor,
  11. Color? splashColor,
  12. Color? disabledBackgroundColor,
  13. Color? disabledBorderColor,
  14. Color? disabledForegroundColor,
  15. Color? borderColor,
  16. double borderWidth = 1.0,
  17. Gradient? backgroundGradient,
  18. Gradient? disabledBackgroundGradient,
  19. double? size = 48.0,
  20. double? iconSize,
  21. EdgeInsetsGeometry? margin,
  22. OutlinedBorder? shape,
  23. double? elevation,
  24. InteractiveInkFeatureFactory? splashFactory,
  25. MaterialTapTargetSize tapTargetSize = MaterialTapTargetSize.padded,
})

Implementation

factory CustomActionButton.iconOnly({
  Key? key,
  VoidCallback? onPressed,
  required Widget icon,
  ButtonType baseType = ButtonType.elevated,
  bool disabled = false,
  bool isLoading = false,
  Widget? loadingIndicator,
  Color? backgroundColor,
  Color? foregroundColor,
  Color? shadowColor,
  Color? splashColor,
  Color? disabledBackgroundColor,
  Color? disabledBorderColor,
  Color? disabledForegroundColor,
  Color? borderColor,
  double borderWidth = 1.0,
  Gradient? backgroundGradient,
  Gradient? disabledBackgroundGradient,
  double? size = 48.0,
  double? iconSize,
  EdgeInsetsGeometry? margin,
  OutlinedBorder? shape,
  double? elevation,
  InteractiveInkFeatureFactory? splashFactory,
  MaterialTapTargetSize tapTargetSize = MaterialTapTargetSize.padded,
}) {
  final Widget themedIcon = IconTheme.merge(
    data: IconThemeData(color: foregroundColor, size: iconSize),
    child: icon,
  );

  return CustomActionButton(
    key: key,
    buttonType: baseType,
    onPressed: onPressed,
    disabled: disabled,
    isLoading: isLoading,
    loadingIndicator: loadingIndicator,
    backgroundColor: backgroundColor,
    foregroundColor: foregroundColor,
    shadowColor: shadowColor,
    splashColor: splashColor,
    disabledBackgroundColor: disabledBackgroundColor,
    disabledBorderColor: disabledBorderColor,
    disabledForegroundColor: disabledForegroundColor,
    borderColor: borderColor,
    borderWidth: borderWidth,
    backgroundGradient: backgroundGradient,
    disabledBackgroundGradient: disabledBackgroundGradient,
    width: size,
    height: size,
    minHeight: 0.0,
    padding: EdgeInsets.zero,
    margin: margin,
    shape: shape ?? const CircleBorder(),
    elevation: elevation,
    splashFactory: splashFactory,
    tapTargetSize: tapTargetSize,
    child: themedIcon,
  );
}