通讯录部分页面
This commit is contained in:
147
lib/views/contact/firend/profile/index_page.dart
Normal file
147
lib/views/contact/firend/profile/index_page.dart
Normal file
@@ -0,0 +1,147 @@
|
||||
import 'package:chat/configs/app_colors.dart';
|
||||
import 'package:chat/controllers/private_controller.dart';
|
||||
import 'package:chat/routes/contact_routes.dart';
|
||||
import 'package:chat/routes/conversation_routes.dart';
|
||||
import 'package:chat/routes/moments_routes.dart';
|
||||
import 'package:chat/services/tim/conversation_service.dart';
|
||||
import 'package:chat/utils/im_tools.dart';
|
||||
import 'package:chat/views/home/widgets/action_button.dart';
|
||||
import 'package:chat/views/home/widgets/action_item.dart';
|
||||
import 'package:chat/widgets/custom_avatar.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class ImFriendProfilePage extends StatelessWidget {
|
||||
const ImFriendProfilePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetX<PrivateController>(builder: (_) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: AppColors.white,
|
||||
actions: [
|
||||
Visibility(
|
||||
visible: _.currentFriend.value.isFriend,
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
Get.toNamed(
|
||||
ContactRoutes.friendProfileMore,
|
||||
);
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.more_horiz,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
color: AppColors.white,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
CustomAvatar(
|
||||
_.currentFriend.value.userProfile?.faceUrl,
|
||||
size: 54,
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
_.currentFriend.value.conversation!.showName!,
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
Text('昵称:${_.currentFriend.value.userProfile?.nickName}'),
|
||||
// Text('区块链地址:$friendId'),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(height: 0),
|
||||
ActionItem(
|
||||
'设置备注',
|
||||
extend: _.currentFriend.value.friendRemark,
|
||||
onTap: () {
|
||||
Get.toNamed(
|
||||
ContactRoutes.friendRemark,
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
ActionItem(
|
||||
'他的动态',
|
||||
onTap: () {
|
||||
Get.toNamed(
|
||||
MomentsRoutes.user,
|
||||
arguments: {
|
||||
'userId': _.currentFriend.value.userID,
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Visibility(
|
||||
visible: !_.currentFriend.value.isFriend,
|
||||
child: ActionButton(
|
||||
'添加到通讯录',
|
||||
onTap: () {
|
||||
Get.toNamed(
|
||||
ContactRoutes.friendApply,
|
||||
arguments: {
|
||||
'userID': _.currentFriend.value.userID,
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: _.currentFriend.value.isFriend,
|
||||
child: ActionButton(
|
||||
'发消息',
|
||||
color: AppColors.primary,
|
||||
onTap: () async {
|
||||
var result = await TimConversationService
|
||||
.to.conversationManager
|
||||
.getConversation(
|
||||
conversationID: 'c2c_' + _.currentFriend.value.userID,
|
||||
);
|
||||
if (result.code == 0) {
|
||||
Get.toNamed(
|
||||
ConversationRoutes.index,
|
||||
arguments: {
|
||||
'conversation': result.data,
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: _.currentFriend.value.isFriend,
|
||||
child: const Divider(height: 0),
|
||||
),
|
||||
Visibility(
|
||||
visible: _.currentFriend.value.isFriend,
|
||||
child: ActionButton(
|
||||
'音视频通话',
|
||||
color: AppColors.primary,
|
||||
onTap: () {
|
||||
ImTools.showTrtcMessage(_.currentFriend.value.userID);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user