getProfilePhoto method
Implementation
Widget getProfilePhoto(
{required double width,
required double height,
required String profilePhoto}) {
return profilePhoto != "" && profilePhoto != "null"
? ClipRRect(
borderRadius: BorderRadius.circular(8),
child: CachedNetworkImage(
imageUrl: profilePhoto,
fit: BoxFit.fill,
width: width,
height: height,
placeholder: (context, url) => const CircularProgressIndicator(),
errorWidget: (context, url, error) => Image.asset(
'assets/images/ic_avatar.png',
),
),
)
: Image.asset(
'assets/images/ic_avatar.png',
);
}