kheasydevAppButton function

Widget kheasydevAppButton({
  1. dynamic onTap()?,
  2. required String text,
  3. bool unfillColors = false,
  4. bool disableColors = false,
  5. EdgeInsets? padding,
  6. EdgeInsets? margin,
  7. double? textSize,
  8. Color? primaryColor,
  9. Color? textColor,
})

Implementation

Widget kheasydevAppButton({
  Function()? onTap,
  required String text,
  bool unfillColors = false,
  bool disableColors = false,
  EdgeInsets? padding,
  EdgeInsets? margin,
  double? textSize,
  Color? primaryColor,
  Color? textColor,
}) {
  return GestureDetector(
    onTap: onTap,
    child: Container(
      padding: padding ?? const EdgeInsets.all(12.0),
      margin: margin ?? const EdgeInsets.symmetric(horizontal: 12),
      decoration: BoxDecoration(
        color: !disableColors
            ? !unfillColors
                ? primaryColor ?? Colors.black
                : Colors.white
            : Colors.grey[200],
        borderRadius: BorderRadius.circular(30),
        border: !unfillColors || disableColors
            ? null
            : Border.all(color: primaryColor ?? Colors.black),
      ),
      child: Center(
        child: Text(
          text,
          style: TextStyle(
            color: !disableColors
                ? !unfillColors
                    ? Colors.white
                    : primaryColor ?? Colors.black
                : Colors.black,
            fontWeight: FontWeight.bold,
            fontSize: textSize ?? 20,
          ),
        ),
      ),
    ),
  );
}