fromRxUser static method
Creates an AvatarWidget from the specified reactive user
.
Implementation
static Widget fromRxUser(
RxUser? user, {
Key? key,
AvatarRadius? radius,
double opacity = 1,
bool badge = true,
BoxShape shape = BoxShape.circle,
}) {
if (user == null) {
return AvatarWidget.fromUser(
user?.user.value,
key: key,
radius: radius,
opacity: opacity,
shape: shape,
);
}
return Obx(
() => AvatarWidget(
key: key,
isOnline: badge && user.user.value.online == true,
isAway: badge && user.user.value.presence == Presence.away,
avatar: user.user.value.avatar,
title: user.title,
color: user.user.value.num.val.sum(),
radius: radius,
opacity: opacity,
shape: shape,
),
);
}