getCachedAvatar static method
cache avatar for the chat
Implementation
static CachedNetworkImage getCachedAvatar(String avatarUrl) {
return CachedNetworkImage(
imageUrl: avatarUrl,
imageBuilder: (context, imageProvider) => CircleAvatar(
backgroundImage: imageProvider,
),
placeholder: (context, url) => const CircularProgressIndicator(),
errorWidget: (context, url, error) => const Icon(Icons.error),
);
}