CustomButton constructor

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

Implementation

CustomButton({
  super.key,
  Color? color,
  this.enabled = true,
  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,
     color = color ?? CustomStylesConfig.primaryColor;