feat(mobile-next): 工号登录与目录薄适配,并完成登录/会话/聊天/通讯录第一批界面
Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
Cursor
multica-agent
parent
d787c0a477
commit
60b6590409
@@ -3,24 +3,24 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:openim/core/controller/im_controller.dart';
|
||||
import 'package:openim_common/openim_common.dart';
|
||||
import 'package:rotated_corner_decoration/rotated_corner_decoration.dart';
|
||||
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
|
||||
import 'package:sprintf/sprintf.dart';
|
||||
|
||||
import '../../company/brand/app_tokens.dart';
|
||||
import '../../company/ui/state_views.dart';
|
||||
import 'conversation_logic.dart';
|
||||
|
||||
class ConversationPage extends StatelessWidget {
|
||||
final logic = Get.find<ConversationLogic>();
|
||||
final im = Get.find<IMController>();
|
||||
|
||||
ConversationPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Obx(() => Scaffold(
|
||||
backgroundColor: Styles.c_F8F9FA,
|
||||
backgroundColor: AppColors.pageBg,
|
||||
appBar: TitleBar.conversation(
|
||||
statusStr: logic.imSdkStatus,
|
||||
isFailed: logic.isFailedSdkStatus,
|
||||
@@ -31,37 +31,47 @@ class ConversationPage extends StatelessWidget {
|
||||
onCreateGroup: logic.createGroup,
|
||||
left: Expanded(
|
||||
flex: 2,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
AvatarView(
|
||||
width: 42.w,
|
||||
height: 42.h,
|
||||
text: im.userInfo.value.nickname,
|
||||
url: im.userInfo.value.faceURL,
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: const Text(
|
||||
'消息',
|
||||
style: TextStyle(
|
||||
fontSize: AppFont.title,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
10.horizontalSpace,
|
||||
if (null != im.userInfo.value.nickname)
|
||||
Flexible(
|
||||
child: im.userInfo.value.nickname!.toText
|
||||
..style = Styles.ts_0C1C33_17sp
|
||||
..maxLines = 1
|
||||
..overflow = TextOverflow.ellipsis,
|
||||
),
|
||||
10.horizontalSpace,
|
||||
if (null != logic.imSdkStatus && (!logic.reInstall || logic.isFailedSdkStatus))
|
||||
Flexible(
|
||||
child: SyncStatusView(
|
||||
isFailed: logic.isFailedSdkStatus,
|
||||
statusStr: logic.imSdkStatus!,
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
body: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(AppGap.x4, 0, AppGap.x4, AppGap.x2),
|
||||
child: Container(
|
||||
height: 36,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.searchBg,
|
||||
borderRadius: BorderRadius.circular(AppRadius.control),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: AppGap.x3),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(Icons.search, size: AppIconSize.sm, color: AppColors.textSecondary),
|
||||
SizedBox(width: AppGap.x2),
|
||||
Text('搜索', style: TextStyle(fontSize: AppFont.sub, color: AppColors.textSecondary)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: SlidableAutoCloseBehavior(
|
||||
child: logic.list.isEmpty
|
||||
? const CompanyEmptyView(
|
||||
icon: Icons.chat_bubble_outline,
|
||||
title: '暂时没有会话',
|
||||
subtitle: '去通讯录找个同事聊聊吧',
|
||||
)
|
||||
: SlidableAutoCloseBehavior(
|
||||
child: ScrollablePositionedList.builder(
|
||||
itemScrollController: logic.itemScrollController,
|
||||
itemBuilder: (_, index) => _buildConversationItemView(
|
||||
@@ -117,7 +127,7 @@ class ConversationPage extends StatelessWidget {
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
height: 68,
|
||||
height: 72,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
@@ -191,7 +201,7 @@ class ConversationPage extends StatelessWidget {
|
||||
),
|
||||
if (logic.isPinned(info))
|
||||
Container(
|
||||
height: 68.h,
|
||||
height: 72,
|
||||
margin: EdgeInsets.only(right: 6.w),
|
||||
foregroundDecoration: RotatedCornerDecoration.withColor(
|
||||
color: Styles.c_0089FF,
|
||||
|
||||
Reference in New Issue
Block a user