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),
],
),
],
),
),

View File

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

View File

@ -259,19 +259,21 @@ mainEmpty({
fit: BoxFit.fitWidth,
),
);
list.add(SizedBox(height: height(10.w)));
list.add(
Text(
msg,
style: TextStyle(
fontSize: sp(12),
color: textColor,
fontWeight: FontWeight.w400,
decoration: TextDecoration.none,
height: 1,
if (msg.isNotEmpty) {
list.add(SizedBox(height: height(10.w)));
list.add(
Text(
msg,
style: TextStyle(
fontSize: sp(12),
color: textColor,
fontWeight: FontWeight.w400,
decoration: TextDecoration.none,
height: 1,
),
),
),
);
);
}
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [

View File

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

View File

@ -20,6 +20,15 @@ class RoomOnlineUserWidget extends StatefulWidget {
}
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) {
showBottomInBottomDialog(
context,
@ -35,96 +44,105 @@ class _RoomOnlineUserWidgetState extends State<RoomOnlineUserWidget> {
children: [
_buildExperience(),
SizedBox(width: 15.w),
ref.onlineUsers.isNotEmpty
? Expanded(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Spacer(),
GestureDetector(
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(),
Expanded(
child: Align(
alignment: Alignment.centerRight,
child:
ref.onlineUsers.isNotEmpty
? _buildOnlineUsers(ref)
: _buildOnlineUsersPlaceholder(),
),
),
],
);
},
);
}
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() {
return Consumer<SocialChatRoomManager>(