getCachedAvatar static method

CachedNetworkImage getCachedAvatar(
  1. String avatarUrl
)

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),
  );
}