This commit is contained in:
NIGGER SLAYER 2026-04-17 11:25:42 +08:00
parent 2eff091bf3
commit afc6401e68
5 changed files with 120 additions and 101 deletions

View File

@ -125,7 +125,7 @@ class _MessageActivityPageState extends State<MessageActivityPage> {
], ],
), ),
) )
: mainEmpty(), : mainEmpty(msg: ''),
), ),
), ),
), ),
@ -261,7 +261,6 @@ class _MessageItem extends StatelessWidget {
SizedBox(width: 5.w), SizedBox(width: 5.w),
], ],
), ),
], ],
), ),
), ),

View File

@ -127,7 +127,7 @@ class _MessageNotifcationPageState extends State<MessageNotifcationPage> {
], ],
), ),
) )
: mainEmpty(), : mainEmpty(msg: ''),
), ),
), ),
), ),

View File

@ -259,6 +259,7 @@ mainEmpty({
fit: BoxFit.fitWidth, fit: BoxFit.fitWidth,
), ),
); );
if (msg.isNotEmpty) {
list.add(SizedBox(height: height(10.w))); list.add(SizedBox(height: height(10.w)));
list.add( list.add(
Text( Text(
@ -272,6 +273,7 @@ mainEmpty({
), ),
), ),
); );
}
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [

View File

@ -230,8 +230,8 @@ class _MessageConversationListPageState
if (chatList.isEmpty) { if (chatList.isEmpty) {
if (isTop) return Container(); if (isTop) return Container();
return widget.isRoom return widget.isRoom
? mainEmpty() ? mainEmpty(msg: '')
: mainEmpty(image: const SizedBox.shrink()); : mainEmpty(msg: '', image: const SizedBox.shrink());
} }
return Container( return Container(
margin: margin ?? EdgeInsets.only(bottom: 56.w), margin: margin ?? EdgeInsets.only(bottom: 56.w),

View File

@ -20,6 +20,15 @@ class RoomOnlineUserWidget extends StatefulWidget {
} }
class _RoomOnlineUserWidgetState extends State<RoomOnlineUserWidget> { class _RoomOnlineUserWidgetState extends State<RoomOnlineUserWidget> {
double get _onlineUsersShellHeight => 27.w;
double get _onlineUsersAvatarsWidth => 58.w;
double get _onlineUsersCounterWidth => 18.w;
double get _onlineUsersShellWidth =>
_onlineUsersAvatarsWidth + _onlineUsersCounterWidth;
void _openRoomOnlinePage(RtcProvider ref) { void _openRoomOnlinePage(RtcProvider ref) {
showBottomInBottomDialog( showBottomInBottomDialog(
context, context,
@ -35,47 +44,53 @@ class _RoomOnlineUserWidgetState extends State<RoomOnlineUserWidget> {
children: [ children: [
_buildExperience(), _buildExperience(),
SizedBox(width: 15.w), SizedBox(width: 15.w),
Expanded(
child: Align(
alignment: Alignment.centerRight,
child:
ref.onlineUsers.isNotEmpty ref.onlineUsers.isNotEmpty
? Expanded( ? _buildOnlineUsers(ref)
child: Row( : _buildOnlineUsersPlaceholder(),
mainAxisSize: MainAxisSize.min, ),
children: [ ),
Spacer(), ],
GestureDetector( );
},
);
}
Widget _buildOnlineUsers(RtcProvider ref) {
return Padding(
padding: EdgeInsets.only(right: 5.w),
child: GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () => _openRoomOnlinePage(ref), onTap: () => _openRoomOnlinePage(ref),
child: SizedBox(
width: _onlineUsersShellWidth,
height: _onlineUsersShellHeight,
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
SizedBox( SizedBox(
width: _onlineUsersAvatarsWidth,
height: 25.w, height: 25.w,
child: Stack( child: Align(
clipBehavior: Clip.none, alignment: Alignment.centerRight,
children: [ child: SingleChildScrollView(
SingleChildScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: List.generate( children: List.generate(ref.onlineUsers.length, (index) {
ref.onlineUsers.length,
(index) {
return Transform.translate( return Transform.translate(
offset: Offset(-3.w * index, 0), offset: Offset(-3.w * index, 0),
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(right: 0.w),
right: 0.w,
),
child: netImage( child: netImage(
url: url: ref.onlineUsers[index].userAvatar ?? "",
ref
.onlineUsers[index]
.userAvatar ??
"",
width: 23.w, width: 23.w,
height: 23.w, height: 23.w,
defaultImg: defaultImg:
SCGlobalConfig SCGlobalConfig.businessLogicStrategy
.businessLogicStrategy
.getMePageDefaultAvatarImage(), .getMePageDefaultAvatarImage(),
shape: BoxShape.circle, shape: BoxShape.circle,
border: Border.all( border: Border.all(
@ -85,19 +100,17 @@ class _RoomOnlineUserWidgetState extends State<RoomOnlineUserWidget> {
), ),
), ),
); );
}, }),
), ),
), ),
), ),
],
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 3.w,
vertical: 3.w,
), ),
SizedBox(
width: _onlineUsersCounterWidth,
child: Container(
padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 1.w),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset(
"sc_images/room/sc_icon_online_peple.png", "sc_images/room/sc_icon_online_peple.png",
@ -106,22 +119,27 @@ class _RoomOnlineUserWidgetState extends State<RoomOnlineUserWidget> {
), ),
text( text(
"${ref.onlineUsers.length}", "${ref.onlineUsers.length}",
fontSize: 9.sp, fontSize: 9,
lineHeight: 1,
), ),
], ],
), ),
), ),
),
], ],
), ),
), ),
SizedBox(width: 5.w),
],
), ),
)
: Container(),
],
); );
}, }
Widget _buildOnlineUsersPlaceholder() {
return Padding(
padding: EdgeInsets.only(right: 5.w),
child: SizedBox(
width: _onlineUsersShellWidth,
height: _onlineUsersShellHeight,
),
); );
} }