getImageProvider method

ImageProvider<Object> getImageProvider()

Implementation

ImageProvider getImageProvider() {
  ImageProvider defaultAvatar() {
    if (type == 1) {
      return Image.asset(
              TencentUtils.checkString(selfInfoViewModel
                      .globalConfig?.defaultAvatarAssetPath) ??
                  'images/default_c2c_head.png',
              fit: BoxFit.cover,
              package:
                  selfInfoViewModel.globalConfig?.defaultAvatarAssetPath !=
                          null
                      ? null
                      : 'tencent_cloud_chat_uikit')
          .image;
    } else {
      return Image.asset(
              TencentUtils.checkString(selfInfoViewModel
                      .globalConfig?.defaultAvatarAssetPath) ??
                  'images/default_group_head.png',
              fit: BoxFit.cover,
              package:
                  selfInfoViewModel.globalConfig?.defaultAvatarAssetPath !=
                          null
                      ? null
                      : 'tencent_cloud_chat_uikit')
          .image;
    }
  }

  if (faceUrl != "") {
    if (isFromLocalAsset) {
      return Image.asset(faceUrl).image;
    }
    return CachedNetworkImageProvider(
      faceUrl,
    );
  } else {
    return defaultAvatar();
  }
}