pBoxDecoration function

BoxDecoration pBoxDecoration({
  1. Color? color,
  2. BorderRadius? borderRadius,
  3. double? radius,
  4. double borderWidth = 1,
  5. String? image,
  6. bool isAsset = true,
  7. BoxFit? fit,
  8. DecorationImage? decorationImage,
  9. BoxBorder? border,
  10. bool hasBorder = false,
  11. Color? borderColor,
  12. List<BoxShadow>? boxShadow,
  13. Color shadowColor = Clr.colorWhite,
  14. double shadowRadius = 0,
  15. Offset shadowOffset = const Offset(0.0, 0.0),
  16. Gradient? gradient,
  17. BorderStyle borderStyle = BorderStyle.solid,
  18. BoxShape? shape,
})

Implementation

BoxDecoration pBoxDecoration(
    {Color? color,
    BorderRadius? borderRadius,
    double? radius,
    double borderWidth = 1,
    String? image,
    bool isAsset = true,
    BoxFit? fit,
    DecorationImage? decorationImage,
    BoxBorder? border,
    bool hasBorder = false,
    Color? borderColor,
    List<BoxShadow>? boxShadow,
    Color shadowColor = Clr.colorWhite,
    double shadowRadius = 0,
    Offset shadowOffset = const Offset(0.0, 0.0),
    Gradient? gradient,
    BorderStyle borderStyle = BorderStyle.solid,
    BoxShape? shape}) {
  return BoxDecoration(
      borderRadius: shape == null
          ? borderRadius ??
              BorderRadius.all(Radius.circular(radius ?? Siz.defaultRadius))
          : null,
      border: border ??
          (hasBorder
              ? Border.all(
                  color: borderColor ?? Clr.colorTransparent,
                  width: borderWidth,
                  style: borderStyle)
              : null),
      color: color,
      shape: shape ?? BoxShape.rectangle,
      image: decorationImage ??
          (image != null
              ? isAsset
                  ? DecorationImage(
                      image: AssetImage(image),
                      fit: fit,
                    )
                  : DecorationImage(
                      image: NetworkImage(
                        image,
                      ),
                      fit: fit,
                    )
              : null),
      boxShadow: boxShadow ??
          [
            BoxShadow(
                color: shadowColor,
                blurRadius: shadowRadius,
                offset: shadowOffset),
          ],
      gradient: gradient);
}