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,19 +259,21 @@ mainEmpty({
fit: BoxFit.fitWidth, fit: BoxFit.fitWidth,
), ),
); );
list.add(SizedBox(height: height(10.w))); if (msg.isNotEmpty) {
list.add( list.add(SizedBox(height: height(10.w)));
Text( list.add(
msg, Text(
style: TextStyle( msg,
fontSize: sp(12), style: TextStyle(
color: textColor, fontSize: sp(12),
fontWeight: FontWeight.w400, color: textColor,
decoration: TextDecoration.none, fontWeight: FontWeight.w400,
height: 1, decoration: TextDecoration.none,
height: 1,
),
), ),
), );
); }
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,96 +44,105 @@ class _RoomOnlineUserWidgetState extends State<RoomOnlineUserWidget> {
children: [ children: [
_buildExperience(), _buildExperience(),
SizedBox(width: 15.w), SizedBox(width: 15.w),
ref.onlineUsers.isNotEmpty Expanded(
? Expanded( child: Align(
child: Row( alignment: Alignment.centerRight,
mainAxisSize: MainAxisSize.min, child:
children: [ ref.onlineUsers.isNotEmpty
Spacer(), ? _buildOnlineUsers(ref)
GestureDetector( : _buildOnlineUsersPlaceholder(),
behavior: HitTestBehavior.opaque, ),
onTap: () => _openRoomOnlinePage(ref), ),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
height: 25.w,
child: Stack(
clipBehavior: Clip.none,
children: [
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
mainAxisSize: MainAxisSize.min,
children: List.generate(
ref.onlineUsers.length,
(index) {
return Transform.translate(
offset: Offset(-3.w * index, 0),
child: Padding(
padding: EdgeInsets.only(
right: 0.w,
),
child: netImage(
url:
ref
.onlineUsers[index]
.userAvatar ??
"",
width: 23.w,
height: 23.w,
defaultImg:
SCGlobalConfig
.businessLogicStrategy
.getMePageDefaultAvatarImage(),
shape: BoxShape.circle,
border: Border.all(
color: Colors.white,
width: 1.w,
),
),
),
);
},
),
),
),
],
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 3.w,
vertical: 3.w,
),
child: Column(
children: [
Image.asset(
"sc_images/room/sc_icon_online_peple.png",
width: 12.w,
height: 12.sp,
),
text(
"${ref.onlineUsers.length}",
fontSize: 9.sp,
),
],
),
),
],
),
),
SizedBox(width: 5.w),
],
),
)
: Container(),
], ],
); );
}, },
); );
} }
Widget _buildOnlineUsers(RtcProvider ref) {
return Padding(
padding: EdgeInsets.only(right: 5.w),
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => _openRoomOnlinePage(ref),
child: SizedBox(
width: _onlineUsersShellWidth,
height: _onlineUsersShellHeight,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
width: _onlineUsersAvatarsWidth,
height: 25.w,
child: Align(
alignment: Alignment.centerRight,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
mainAxisSize: MainAxisSize.min,
children: List.generate(ref.onlineUsers.length, (index) {
return Transform.translate(
offset: Offset(-3.w * index, 0),
child: Padding(
padding: EdgeInsets.only(right: 0.w),
child: netImage(
url: ref.onlineUsers[index].userAvatar ?? "",
width: 23.w,
height: 23.w,
defaultImg:
SCGlobalConfig.businessLogicStrategy
.getMePageDefaultAvatarImage(),
shape: BoxShape.circle,
border: Border.all(
color: Colors.white,
width: 1.w,
),
),
),
);
}),
),
),
),
),
SizedBox(
width: _onlineUsersCounterWidth,
child: Container(
padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 1.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
"sc_images/room/sc_icon_online_peple.png",
width: 12.w,
height: 12.sp,
),
text(
"${ref.onlineUsers.length}",
fontSize: 9,
lineHeight: 1,
),
],
),
),
),
],
),
),
),
);
}
Widget _buildOnlineUsersPlaceholder() {
return Padding(
padding: EdgeInsets.only(right: 5.w),
child: SizedBox(
width: _onlineUsersShellWidth,
height: _onlineUsersShellHeight,
),
);
}
/// ///
_buildExperience() { _buildExperience() {
return Consumer<SocialChatRoomManager>( return Consumer<SocialChatRoomManager>(