buildCicleImagWidget static method
dynamic
buildCicleImagWidget(})
Implementation
static buildCicleImagWidget(
String? imgPath,
{
Key? key,
String placeholder :"none",
double? width,
double? height,
BoxFit fit: BoxFit.cover,
EdgeInsetsGeometry? margin,
EdgeInsetsGeometry? padding,
Color? backgroundColor,
bool isCircle:true,
double roundRadius:5
}){
print('buildCicleWidget-->imgPath=$imgPath');
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:(!(imgPath??'').startsWith('http'))?
ClipOval(
child: ImageUtils.loadAssetImage(
placeholder,
width: PxUtils.setSize(width??0),
height: PxUtils.setSize(height??0),
fit: BoxFit.fill
),
):
ClipOval(
child: ImageUtils.loadNetworkImage(
imgPath,
placeholder: placeholder,
width: PxUtils.setSize(width??0),
height: PxUtils.setSize(height??0),
key: key,
fit: BoxFit.fill
),
),
):Container(
margin:margin,
padding: padding,
width: PxUtils.setSize(width??0),
height: PxUtils.setSize(height??0),
child:(!(imgPath??'').startsWith('http'))?
ClipRRect(
borderRadius: BorderRadius.circular(roundRadius),
child: ImageUtils.loadAssetImage(
placeholder,
width: PxUtils.setSize(width??0),
height: PxUtils.setSize(height??0),
fit: BoxFit.fill
),
):
ClipRRect(
borderRadius: BorderRadius.circular(roundRadius),
child: ImageUtils.loadNetworkImage(
imgPath,
placeholder: placeholder,
width: PxUtils.setSize(width??0),
height: PxUtils.setSize(height??0),
key: key,
fit: BoxFit.fill
),
),
)
;
}