profileNetworkImage static method
dynamic
profileNetworkImage({
- dynamic height = 50.0,
- dynamic width = 50.0,
- dynamic isShowBorder = false,
- dynamic borderWidth = 1.5,
- dynamic showBoxShadow = false,
- dynamic borderRadius = 40.0,
- dynamic backgroundColor,
- dynamic placeHolder = ImageResource.profilePlaceHolder,
- dynamic imageUrl = "",
Implementation
static profileNetworkImage({
height = 50.0,
width = 50.0,
isShowBorder = false,
borderWidth = 1.5,
showBoxShadow = false,
borderRadius = 40.0,
backgroundColor,
placeHolder = ImageResource.profilePlaceHolder,
imageUrl = "",
}) {
return Container(
height: height,
width: width,
decoration: BoxDecoration(
color: backgroundColor ?? Colors.black12,
shape: BoxShape.circle,
border: Border.all(
color: isShowBorder ? Colors.white : Colors.transparent,
width: borderWidth),
boxShadow: showBoxShadow
? [
BoxShadow(
color: const Color(0xff000000).withOpacity(0.10),
blurRadius: 10.0,
spreadRadius: 1.0,
)
]
: []),
child: ClipRRect(
borderRadius: BorderRadius.circular(borderRadius),
child: CachedNetworkImage(
fadeInDuration: const Duration(milliseconds: 250),
imageUrl: imageUrl == "" || imageUrl == null ? "" : imageUrl,
errorWidget: (context, url, error) => Opacity(
opacity: 0.9,
child: ClipRRect(
borderRadius: BorderRadius.circular(30.0),
child: Image.asset(
placeHolder,
height: height,
width: width,
package: "aplus_chat",
),
),
),
fit: BoxFit.cover,
placeholder: ((context, String s) => Image.asset(
placeHolder,
height: height,
width: width,
package: "aplus_chat",
)),
),
),
);
}