build method

  1. @override
dynamic build(
  1. dynamic context,
  2. dynamic ref
)

Implementation

@override
Widget build(BuildContext context, WidgetRef ref) {
  //Fetch room conversations details from roomId
  final isDm =
      ref.watch(chatProvider(roomId).select((c) => c.valueOrNull?.isDm()));
  if (isDm == null) {
    // means we are still in loading
    return SizedBox(
      width: avatarSize,
      height: avatarSize,
      child: loadingAvatar(),
    );
  }
  return SizedBox(
    width: avatarSize,
    height: avatarSize,
    child: isDm == true
        ? dmAvatar(ref, context)
        : groupChatAvatarUI(ref, context),
  );
}