Jolie 4 months ago
parent
commit
dd2569e1ed
6 changed files with 708 additions and 139 deletions
  1. BIN
      assets/images/room_user_add.png
  2. 1
      lib/generated/assets.dart
  3. 16
      lib/widget/live/live_gift_popup.dart
  4. 148
      lib/widget/live/live_room_active_speaker.dart
  5. 302
      lib/widget/live/live_room_anchor_showcase.dart
  6. 380
      lib/widget/live/live_room_guest_list_dialog.dart

BIN
assets/images/room_user_add.png

Before After
Width: 200  |  Height: 200  |  Size: 689 B

1
lib/generated/assets.dart

@ -152,6 +152,7 @@ class Assets {
static const String imagesRocket1 = 'assets/images/rocket1.svga';
static const String imagesRocket2 = 'assets/images/rocket2.svga';
static const String imagesRocket3 = 'assets/images/rocket3.svga';
static const String imagesRoomUserAdd = 'assets/images/room_user_add.png';
static const String imagesRoomVideo = 'assets/images/room_video.png';
static const String imagesRose = 'assets/images/rose.png';
static const String imagesRoseBanner = 'assets/images/rose_banner.png';

16
lib/widget/live/live_gift_popup.dart

@ -17,12 +17,16 @@ class LiveGiftPopup extends StatefulWidget {
required this.giftNum,
required this.giftList,
required this.changeActive,
this.showHeader = true,
this.targetUserId,
});
final ValueNotifier<int?> activeGift;
final ValueNotifier<int> giftNum;
final List<dynamic> giftList; // List<Map> List<GiftProductModel>
final void Function(int) changeActive;
final bool showHeader; //
final String? targetUserId; // ID
@override
State<LiveGiftPopup> createState() => _LiveGiftPopupState();
@ -35,6 +39,10 @@ class _LiveGiftPopupState extends State<LiveGiftPopup> {
@override
void initState() {
super.initState();
// ID
if (widget.targetUserId != null) {
_selectedUserId = widget.targetUserId;
}
//
if (widget.giftList.isNotEmpty && widget.activeGift.value == null) {
widget.activeGift.value = 0;
@ -65,9 +73,11 @@ class _LiveGiftPopupState extends State<LiveGiftPopup> {
return;
}
//
// showHeader为falsetargetUserId
if (_selectedUserId == null || _selectedUserId!.isEmpty) {
SmartDialog.showToast('请先选择接收礼物的用户');
if (widget.showHeader) {
SmartDialog.showToast('请先选择接收礼物的用户');
}
return;
}
@ -110,7 +120,7 @@ class _LiveGiftPopupState extends State<LiveGiftPopup> {
height: 363.w,
child: Column(
children: [
_buildHeader(),
if (widget.showHeader) _buildHeader(),
Expanded(
child: Container(
decoration: BoxDecoration(

148
lib/widget/live/live_room_active_speaker.dart

@ -1,54 +1,126 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:dating_touchme_app/controller/discover/room_controller.dart';
import 'package:dating_touchme_app/controller/global.dart';
import 'package:dating_touchme_app/generated/assets.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
class LiveRoomActiveSpeaker extends StatelessWidget {
const LiveRoomActiveSpeaker({super.key});
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Stack(
clipBehavior: Clip.none,
children: [
Container(
width: 34.w,
height: 34.w,
margin: EdgeInsets.only(left: 13.w),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(34.w)),
child: Image.asset(
Assets.imagesUserAvatar,
width: 34.w,
height: 34.w,
// RoomController Obx
final roomController = Get.isRegistered<RoomController>()
? Get.find<RoomController>()
: null;
if (roomController == null) {
return const SizedBox.shrink();
}
//
final currentUserId = GlobalData().userId ?? GlobalData().userData?.id;
final currentUserPhoto = GlobalData().userData?.profilePhoto ?? '';
return Obx(() {
// 访
final rtcChannelDetail = roomController.rtcChannelDetail.value;
final isLive = roomController.isLive.value;
//
bool isOnSeat = false;
if (currentUserId != null) {
// 1 maleInfo femaleInfo maleAudience/femaleAudience
if (rtcChannelDetail != null) {
final maleInfo = rtcChannelDetail.maleInfo;
final femaleInfo = rtcChannelDetail.femaleInfo;
isOnSeat =
(maleInfo != null &&
(maleInfo.userId == currentUserId ||
maleInfo.miId == currentUserId)) ||
(femaleInfo != null &&
(femaleInfo.userId == currentUserId ||
femaleInfo.miId == currentUserId));
}
// 2 isLive true audience
// maleInfo/femaleInfo isLive
if (!isOnSeat && isLive) {
isOnSeat = true;
}
}
//
final micIcon = isOnSeat ? Assets.imagesMicOpen : Assets.imagesMicClose;
return Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Stack(
clipBehavior: Clip.none,
children: [
Container(
width: 34.w,
height: 34.w,
margin: EdgeInsets.only(left: 13.w),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(34.w)),
child: currentUserPhoto.isNotEmpty
? CachedNetworkImage(
imageUrl: currentUserPhoto,
width: 34.w,
height: 34.w,
fit: BoxFit.cover,
placeholder: (context, url) => Container(
width: 34.w,
height: 34.w,
color: Colors.grey[300],
child: Center(
child: SizedBox(
width: 16.w,
height: 16.w,
child: CircularProgressIndicator(
strokeWidth: 2,
color: Colors.grey[600],
),
),
),
),
errorWidget: (context, url, error) => Image.asset(
Assets.imagesUserAvatar,
width: 34.w,
height: 34.w,
),
)
: Image.asset(
Assets.imagesUserAvatar,
width: 34.w,
height: 34.w,
),
),
),
),
Positioned(
bottom: -3.w,
left: 20.w,
child: Container(
width: 20.w,
height: 20.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(4.w)),
color: const Color.fromRGBO(0, 0, 0, .65),
),
child: Center(
child: Image.asset(
Assets.imagesMicClose,
width: 10.w,
height: 11.w,
Positioned(
bottom: -3.w,
left: 20.w,
child: Container(
width: 20.w,
height: 20.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(4.w)),
color: const Color.fromRGBO(0, 0, 0, .65),
),
child: Center(
child: Image.asset(micIcon, width: 10.w, height: 11.w),
),
),
),
),
],
),
],
);
],
),
],
);
});
}
}

302
lib/widget/live/live_room_anchor_showcase.dart

@ -1,10 +1,14 @@
import 'package:agora_rtc_engine/agora_rtc_engine.dart';
import 'package:dating_touchme_app/controller/discover/room_controller.dart';
import 'package:dating_touchme_app/extension/ex_widget.dart';
import 'package:dating_touchme_app/generated/assets.dart';
import 'package:dating_touchme_app/model/rtc/rtc_channel_detail.dart';
import 'package:dating_touchme_app/rtc/rtc_manager.dart';
import 'package:dating_touchme_app/widget/live/live_gift_popup.dart';
import 'package:dating_touchme_app/widget/live/live_room_guest_list_dialog.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
class LiveRoomAnchorShowcase extends StatefulWidget {
@ -66,11 +70,20 @@ class _LiveRoomAnchorShowcaseState extends State<LiveRoomAnchorShowcase> {
color: const Color.fromRGBO(0, 0, 0, .3),
),
child: Center(
child: Image.asset(
Assets.imagesGiftIcon,
width: 19.w,
height: 19.w,
),
child:
Image.asset(
Assets.imagesGiftIcon,
width: 19.w,
height: 19.w,
).onTap(() {
final anchorInfo = _roomController
.rtcChannelDetail
.value
?.anchorInfo;
if (anchorInfo != null) {
_showGiftPopupForUser(anchorInfo);
}
}),
),
),
),
@ -127,7 +140,8 @@ class _LiveRoomAnchorShowcaseState extends State<LiveRoomAnchorShowcase> {
Widget _buildAnchorVideo(bool joined, int? remoteUid) {
final engine = _rtcManager.engine;
if (_roomController.rtcChannelDetail.value?.anchorInfo == null || engine == null) {
if (_roomController.rtcChannelDetail.value?.anchorInfo == null ||
engine == null) {
return _buildWaitingPlaceholder();
}
return ClipRRect(
@ -143,16 +157,17 @@ class _LiveRoomAnchorShowcaseState extends State<LiveRoomAnchorShowcase> {
),
)
: AgoraVideoView(
controller: VideoViewController.remote(
rtcEngine: engine,
canvas: VideoCanvas(
uid: _roomController.rtcChannelDetail.value?.anchorInfo?.uid,
),
connection: RtcConnection(
channelId: _rtcManager.currentChannelId!,
),
),
),
controller: VideoViewController.remote(
rtcEngine: engine,
canvas: VideoCanvas(
uid:
_roomController.rtcChannelDetail.value?.anchorInfo?.uid,
),
connection: RtcConnection(
channelId: _rtcManager.currentChannelId!,
),
),
),
),
);
}
@ -170,9 +185,9 @@ class _LiveRoomAnchorShowcaseState extends State<LiveRoomAnchorShowcase> {
Column(
children: [
Image.asset(Assets.imagesWaitting),
Text('暂时离开', style: TextStyle(color: Colors.white,))
Text('暂时离开', style: TextStyle(color: Colors.white)),
],
)
),
],
),
);
@ -197,100 +212,191 @@ class _LiveRoomAnchorShowcaseState extends State<LiveRoomAnchorShowcase> {
child: SizedBox(
width: 177.w,
height: 175.w,
child: userInfo != null && userInfo.uid != null && joined && engine != null ? Stack(
children: [
Positioned(
top: 5.w,
right: 5.w,
child: Container(
width: 20.w,
height: 20.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.w)),
),
child: Center(
child: Image.asset(
Assets.imagesGiftIcon,
width: 19.w,
height: 19.w,
),
),
),
),
Positioned(
bottom: 5.w,
right: 5.w,
child: Container(
width: 47.w,
height: 20.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.w)),
color: Colors.white,
),
child: Center(
child: Text(
"加好友",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(117, 98, 249, 1),
),
),
),
),
),
Positioned(
left: 5.w,
bottom: 5.w,
child: Row(
child:
userInfo != null &&
userInfo.uid != null &&
joined &&
engine != null
? Stack(
children: [
Container(
width: 20.w,
height: 20.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(4.w)),
color: const Color.fromRGBO(0, 0, 0, .65),
Positioned(
top: 5.w,
right: 5.w,
child: Container(
width: 20.w,
height: 20.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(20.w),
),
),
child: Center(
child:
Image.asset(
Assets.imagesGiftIcon,
width: 19.w,
height: 19.w,
).onTap(() {
_showGiftPopupForUser(userInfo);
}),
),
),
child: Center(
child: Image.asset(
userInfo.isMicrophoneOn
? Assets.imagesMicOpen
: Assets.imagesMicClose,
width: 10.w,
height: 11.w,
),
Positioned(
bottom: 5.w,
right: 5.w,
child: Container(
width: 47.w,
height: 20.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(20.w),
),
color: Colors.white,
),
child: Center(
child: Text(
"加好友",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(117, 98, 249, 1),
),
),
),
),
),
SizedBox(width: 5.w),
Text(
userInfo.nickName,
style: TextStyle(
fontSize: 11.w,
color: Colors.white,
fontWeight: FontWeight.w500,
Positioned(
left: 5.w,
bottom: 5.w,
child: Row(
children: [
Container(
width: 20.w,
height: 20.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.w),
),
color: const Color.fromRGBO(0, 0, 0, .65),
),
child: Center(
child: Image.asset(
userInfo.isMicrophoneOn
? Assets.imagesMicOpen
: Assets.imagesMicClose,
width: 10.w,
height: 11.w,
),
),
),
SizedBox(width: 5.w),
Text(
userInfo.nickName,
style: TextStyle(
fontSize: 11.w,
color: Colors.white,
fontWeight: FontWeight.w500,
),
),
],
),
),
AgoraVideoView(
controller: isCurrentUser
? VideoViewController(
rtcEngine: engine,
canvas: const VideoCanvas(uid: 0),
)
: VideoViewController.remote(
rtcEngine: engine,
canvas: VideoCanvas(uid: userInfo.uid!),
connection: RtcConnection(
channelId: _rtcManager.currentChannelId ?? '',
),
),
),
],
),
),
AgoraVideoView(
controller: isCurrentUser
? VideoViewController(
rtcEngine: engine,
canvas: const VideoCanvas(uid: 0),
)
: VideoViewController.remote(
rtcEngine: engine,
canvas: VideoCanvas(uid: userInfo.uid!),
connection: RtcConnection(
channelId: _rtcManager.currentChannelId ?? '',
: _roomController.currentRole == CurrentRole.broadcaster
? Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(isLeft ? 10.w : 0.w),
topRight: Radius.circular(!isLeft ? 10.w : 0.w),
bottomLeft: Radius.circular(isLeft ? 10.w : 0.w),
bottomRight: Radius.circular(!isLeft ? 10.w : 0.w),
),
color: const Color(0xff15143C),
),
child: Center(
child: Image.asset(Assets.imagesRoomUserAdd, width: 50.w),
),
).onTap(() {
_showGuestListDialog(context, isLeft);
})
: Image.asset(
isLeft ? Assets.imagesMaleEmpty : Assets.imagesFemaleEmpty,
),
)
],
) : Image.asset(isLeft ? Assets.imagesMaleEmpty : Assets.imagesFemaleEmpty),
),
),
],
);
}
void _showGuestListDialog(BuildContext context, bool isMaleSeat) {
SmartDialog.show(
alignment: Alignment.bottomCenter,
maskColor: Colors.black.withOpacity(0.5),
builder: (context) {
return LiveRoomGuestListDialog(
initialTab: isMaleSeat ? 1 : 0, // 0: , 1:
);
},
);
}
void _showGiftPopupForUser(RtcSeatUserInfo? userInfo) {
if (userInfo == null) {
return;
}
// ID使userId使miId
final targetUserId = userInfo.userId.isNotEmpty
? userInfo.userId
: userInfo.miId.isNotEmpty
? userInfo.miId
: null;
if (targetUserId == null) {
SmartDialog.showToast('用户ID不存在');
return;
}
// ValueNotifier
final activeGift = ValueNotifier<int?>(null);
final giftNum = ValueNotifier<int>(1);
SmartDialog.show(
alignment: Alignment.bottomCenter,
maskColor: Colors.black.withOpacity(0.5),
builder: (context) {
return Obx(() {
//
final giftProducts = _roomController.giftProducts;
final giftList = giftProducts.toList();
return LiveGiftPopup(
activeGift: activeGift,
giftNum: giftNum,
giftList: giftList,
changeActive: (index) {
activeGift.value = index;
},
showHeader: false, //
targetUserId: targetUserId, // ID
);
});
},
);
}
}

380
lib/widget/live/live_room_guest_list_dialog.dart

@ -0,0 +1,380 @@
import 'dart:convert';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:dating_touchme_app/im/im_manager.dart';
import 'package:dating_touchme_app/network/network_service.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
///
class LiveRoomGuestListDialog extends StatefulWidget {
final int initialTab; // 0: , 1:
const LiveRoomGuestListDialog({super.key, required this.initialTab});
@override
State<LiveRoomGuestListDialog> createState() =>
_LiveRoomGuestListDialogState();
}
class _LiveRoomGuestListDialogState extends State<LiveRoomGuestListDialog> {
late int _selectedTab; // 0: , 1:
List<Map<String, dynamic>> _guestList = [];
bool _isLoading = true;
@override
void initState() {
super.initState();
_selectedTab = widget.initialTab;
_loadContacts();
}
Future<void> _loadContacts() async {
setState(() {
_isLoading = true;
});
try {
//
final conversations = await IMManager.instance.getConversations();
if (conversations.isEmpty) {
setState(() {
_guestList = [];
_isLoading = false;
});
return;
}
final networkService = NetworkService();
final List<Map<String, dynamic>> guestList = [];
//
for (final conversation in conversations) {
try {
final userId = conversation.id;
if (userId.isEmpty) continue;
//
final contactsMap = await IMManager.instance.getContacts(userId);
final emUserInfo = contactsMap[userId];
//
final response = await networkService.userApi.getBaseUserInfo(userId);
if (response.data.isSuccess && response.data.data != null) {
final userBaseData = response.data.data!;
//
int? genderCode;
int? age;
String? cityName;
int? vipLevel;
if (emUserInfo?.ext != null) {
try {
final extJson = json.decode(emUserInfo!.ext!);
if (extJson is Map<String, dynamic>) {
genderCode = extJson['genderCode'] is int
? extJson['genderCode'] as int
: int.tryParse(extJson['genderCode']?.toString() ?? '0');
age = extJson['age'] is int
? extJson['age'] as int
: int.tryParse(extJson['age']?.toString() ?? '');
cityName = extJson['cityName']?.toString();
vipLevel = extJson['vipLevel'] is int
? extJson['vipLevel'] as int
: int.tryParse(extJson['vipLevel']?.toString() ?? '');
}
} catch (e) {
print('解析扩展信息失败: $e');
}
}
guestList.add({
'userId': userId,
'avatar': emUserInfo?.avatarUrl ?? '',
'name': emUserInfo?.nickName ?? userBaseData.nickName,
'age': age,
'location': cityName ?? '',
'vipLevel': vipLevel,
'genderCode': genderCode ?? 0, // 0-, 1-
'hasMaleGuest': false, // TODO:
'hasFemaleGuest': false, // TODO:
});
}
} catch (e) {
print('获取用户信息失败: ${conversation.id}, $e');
}
}
setState(() {
_guestList = guestList;
_isLoading = false;
});
} catch (e) {
print('获取联系人列表失败: $e');
setState(() {
_guestList = [];
_isLoading = false;
});
}
}
@override
Widget build(BuildContext context) {
return Container(
height: MediaQuery.of(context).size.height * 0.7,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.vertical(top: Radius.circular(20.w)),
),
child: Column(
children: [
//
Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(width: 60.w),
_buildTabButton('女嘉宾', 0),
SizedBox(width: 40.w),
_buildTabButton('男嘉宾', 1),
SizedBox(width: 60.w),
],
),
),
Divider(height: 1, color: Colors.grey[200]),
//
Expanded(child: _buildGuestList()),
],
),
);
}
Widget _buildTabButton(String title, int index) {
final isSelected = _selectedTab == index;
return GestureDetector(
onTap: () {
setState(() {
_selectedTab = index;
});
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 10.w),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: isSelected
? const Color.fromRGBO(117, 98, 249, 1)
: Colors.transparent,
width: 1.5,
),
),
),
child: Text(
title,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16.w,
fontWeight: isSelected ? FontWeight.w600 : FontWeight.normal,
color: isSelected
? const Color.fromRGBO(117, 98, 249, 1)
: Colors.grey[600],
),
),
),
);
}
Widget _buildGuestList() {
if (_isLoading) {
return Center(child: CircularProgressIndicator());
}
//
// genderCode: 0-, 1-
final filteredList = _guestList.where((guest) {
final genderCode = guest['genderCode'] as int? ?? 0;
if (_selectedTab == 0) {
// genderCode == 1
return genderCode == 1;
} else {
// genderCode == 0
return genderCode == 0;
}
}).toList();
if (filteredList.isEmpty) {
return Center(
child: Text(
'暂无${_selectedTab == 0 ? "" : ""}嘉宾',
style: TextStyle(fontSize: 14.w, color: Colors.grey[500]),
),
);
}
return ListView.builder(
padding: EdgeInsets.symmetric(horizontal: 15.w, vertical: 10.w),
itemCount: filteredList.length,
itemBuilder: (context, index) {
return _buildGuestItem(filteredList[index]);
},
);
}
Widget _buildGuestItem(Map<String, dynamic> guest) {
//
final hasGuest = _selectedTab == 0
? (guest['hasMaleGuest'] as bool? ?? false)
: (guest['hasFemaleGuest'] as bool? ?? false);
final vipLevel = guest['vipLevel'] as int?;
return Container(
margin: EdgeInsets.only(bottom: 15.w),
child: Row(
children: [
//
ClipRRect(
borderRadius: BorderRadius.circular(20.w),
child: CachedNetworkImage(
imageUrl: guest['avatar'] as String? ?? '',
width: 40.w,
height: 40.w,
fit: BoxFit.cover,
placeholder: (context, url) => Container(
width: 40.w,
height: 40.w,
color: Colors.grey[300],
child: Center(
child: CircularProgressIndicator(
strokeWidth: 2,
color: Colors.grey[600],
),
),
),
errorWidget: (context, url, error) => Container(
width: 40.w,
height: 40.w,
color: Colors.grey[300],
child: Icon(Icons.person, size: 24.w),
),
),
),
SizedBox(width: 12.w),
//
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
guest['name'] as String? ?? '',
style: TextStyle(
fontSize: 15.w,
fontWeight: FontWeight.w500,
color: Colors.black87,
),
),
if (vipLevel != null && vipLevel > 0) ...[
SizedBox(width: 6.w),
Container(
padding: EdgeInsets.symmetric(
horizontal: 6.w,
vertical: 2.w,
),
decoration: BoxDecoration(
color: const Color(0xFFFF6B35),
borderRadius: BorderRadius.circular(10.w),
),
child: Text(
'VIP $vipLevel',
style: TextStyle(
fontSize: 10.w,
color: Colors.white,
fontWeight: FontWeight.w500,
),
),
),
],
],
),
SizedBox(height: 4.w),
Text(
_buildUserInfoText(guest['age'], guest['location']),
style: TextStyle(fontSize: 12.w, color: Colors.grey[600]),
),
],
),
),
//
_buildActionButton(hasGuest),
],
),
);
}
Widget _buildActionButton(bool hasGuest) {
if (hasGuest) {
return Container(
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 6.w),
decoration: BoxDecoration(
color: Colors.grey[200],
borderRadius: BorderRadius.circular(15.w),
),
child: Text(
'已有${_selectedTab == 0 ? "" : ""}嘉宾',
style: TextStyle(fontSize: 12.w, color: Colors.grey[600]),
),
);
} else {
return GestureDetector(
onTap: () {
// TODO:
SmartDialog.showToast('邀请${_selectedTab == 0 ? "" : ""}嘉宾');
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 6.w),
decoration: BoxDecoration(
gradient: const LinearGradient(
colors: [
Color.fromRGBO(117, 98, 249, 1),
Color.fromRGBO(131, 89, 255, 1),
],
),
borderRadius: BorderRadius.circular(15.w),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.videocam, size: 14.w, color: Colors.white),
SizedBox(width: 4.w),
Text(
'邀请',
style: TextStyle(
fontSize: 12.w,
color: Colors.white,
fontWeight: FontWeight.w500,
),
),
],
),
),
);
}
}
String _buildUserInfoText(int? age, String? location) {
final parts = <String>[];
if (age != null) {
parts.add('${age}');
}
if (location != null && location.isNotEmpty) {
parts.add(location);
}
return parts.isEmpty ? '' : parts.join('·');
}
}
Loading…
Cancel
Save