build method
dynamic
build( - dynamic context,
- 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),
);
}