|
|
@ -56,10 +56,8 @@ class _UserAvatarState extends State<NeonUserAvatar> { |
|
|
|
final brightness = Theme.of(context).brightness; |
|
|
|
final brightness = Theme.of(context).brightness; |
|
|
|
size = constraints.constrain(Size.square(widget.size ?? largeIconSize)).shortestSide; |
|
|
|
size = constraints.constrain(Size.square(widget.size ?? largeIconSize)).shortestSide; |
|
|
|
final pixelSize = (size * MediaQuery.of(context).devicePixelRatio).toInt(); |
|
|
|
final pixelSize = (size * MediaQuery.of(context).devicePixelRatio).toInt(); |
|
|
|
return Stack( |
|
|
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
final avatar = CircleAvatar( |
|
|
|
children: [ |
|
|
|
|
|
|
|
CircleAvatar( |
|
|
|
|
|
|
|
radius: size / 2, |
|
|
|
radius: size / 2, |
|
|
|
backgroundColor: widget.backgroundColor, |
|
|
|
backgroundColor: widget.backgroundColor, |
|
|
|
child: ClipOval( |
|
|
|
child: ClipOval( |
|
|
@ -82,14 +80,21 @@ class _UserAvatarState extends State<NeonUserAvatar> { |
|
|
|
}, |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
if (widget.showStatus) ...[ |
|
|
|
|
|
|
|
|
|
|
|
if (!widget.showStatus) { |
|
|
|
|
|
|
|
return avatar; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Stack( |
|
|
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
avatar, |
|
|
|
ResultBuilder<UserStatusPublicInterface?>( |
|
|
|
ResultBuilder<UserStatusPublicInterface?>( |
|
|
|
stream: _userStatusBloc.statuses.mapNotNull((final statuses) => statuses[widget.username]), |
|
|
|
stream: _userStatusBloc.statuses.mapNotNull((final statuses) => statuses[widget.username]), |
|
|
|
builder: _userStatusIconBuilder, |
|
|
|
builder: _userStatusIconBuilder, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
); |
|
|
|
); |
|
|
|