CustomButton constructor

CustomButton({
  1. Key? key,
  2. Color? color,
  3. bool enabled = true,
  4. Gradient? customGradient,
  5. List<BoxShadow>? customBoxShadow,
  6. Color? borderColor,
  7. required String text,
  8. bool isFlexible = false,
  9. dynamic onTap()?,
  10. double horizontalPadding = 0,
  11. double horizontalMargin = 0,
  12. double? borderRadius,
  13. bool isBorder = false,
  14. double verticalMargin = 0,
  15. double verticalPadding = 8,
  16. double? width,
  17. bool showGradient = false,
  18. bool showShadow = false,
  19. double? height,
  20. Color? textColor,
  21. FontWeight? fontWeight,
  22. double? fontSize,
  23. TextAlign textAlign = TextAlign.center,
  24. String? fontFamily,
  25. bool load = false,
  26. Widget? suffix,
  27. Widget? prefix,
  28. bool isSolid = true,
})

this is the constructor of the custom button.

Implementation

CustomButton({
  super.key,
  Color? color,
  this.enabled = true,
  Gradient? customGradient,
  List<BoxShadow>? customBoxShadow,
  this.borderColor,
  required this.text,
  this.isFlexible = false,
  this.onTap,
  this.horizontalPadding = 0,
  this.horizontalMargin = 0,
  double? borderRadius,
  this.isBorder = false,
  this.verticalMargin = 0,
  this.verticalPadding = 8,
  this.width,
  this.showGradient = false,
  this.showShadow = false,
  this.height,
  this.textColor,
  this.fontWeight,
  this.fontSize,
  this.textAlign = TextAlign.center,
  this.fontFamily,
  this.load = false,
  this.suffix,
  this.prefix,
  this.isSolid = true,
}) : borderRadius = borderRadius ?? CustomStylesConfig.globalBorderRadius,

     customBoxShadow = customBoxShadow ?? CustomStylesConfig.buttonBoxShadow,
     customGradient = customGradient ?? CustomStylesConfig.buttonGradient,
     color = color ?? CustomStylesConfig.primaryColor;