buildCicleWidget static method

dynamic buildCicleWidget({
  1. Key? key,
  2. double? width,
  3. double? height,
  4. EdgeInsetsGeometry? margin,
  5. EdgeInsetsGeometry? padding,
  6. Color? backgroundColor,
  7. bool isCircle = true,
  8. double roundRadius = 5,
  9. Widget? child,
})

Implementation

static buildCicleWidget(
    {
      Key? key,
      double? width,
      double? height,
      EdgeInsetsGeometry? margin,
      EdgeInsetsGeometry? padding,
      Color? backgroundColor,
      bool isCircle:true,
      double roundRadius:5,
      Widget? child
    }){
  return
    isCircle?
    Container(
      margin:margin,
      padding: padding,
      width: PxUtils.setSize(width??0),
      height: PxUtils.setSize(height??0),
      decoration: BoxDecoration(
          color: backgroundColor,
          borderRadius: BorderRadius.all(Radius.circular(width??0))
      ),
      child:
      ClipOval(
        child: child,
      )
    ):Container(
      margin:margin,
      padding: padding,
      width: PxUtils.setSize(width??0),
      height: PxUtils.setSize(height??0),
      child:
      ClipRRect(
        borderRadius: BorderRadius.circular(roundRadius),
        child: child,
      )
    )
  ;
}