- 登录:工号+密码走 account-service /api/login,自动登录、被踢下线回登录页 - 消息:会话列表(未读角标/免打扰/时间)、单聊群聊、文字/语音/图片/文件消息、失败重发、历史分页 - 通讯录:新的同事/我的群聊入口、按部门分组(好友 ex 字段)、搜索 - 通话:一对一语音通话(信令走 OpenIM 自定义消息 + LiveKit,token 走 /api/rtc_token) - 界面按确认效果图 m1/m2/m3 实现,主色 #3B87F5,四态视图齐全,无英文残留
43 lines
1.2 KiB
Dart
43 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'contacts_screen.dart';
|
|
import 'conversation_list_screen.dart';
|
|
import 'mine_screen.dart';
|
|
|
|
/// 主页:底部三 Tab —— 消息 / 通讯录 / 我的
|
|
class HomeScreen extends StatefulWidget {
|
|
const HomeScreen({super.key});
|
|
|
|
@override
|
|
State<HomeScreen> createState() => _HomeScreenState();
|
|
}
|
|
|
|
class _HomeScreenState extends State<HomeScreen> {
|
|
int _index = 0;
|
|
|
|
void switchTab(int index) => setState(() => _index = index);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: IndexedStack(
|
|
index: _index,
|
|
children: [
|
|
ConversationListScreen(onFindContacts: () => switchTab(1)),
|
|
const ContactsScreen(),
|
|
const MineScreen(),
|
|
],
|
|
),
|
|
bottomNavigationBar: BottomNavigationBar(
|
|
currentIndex: _index,
|
|
onTap: (i) => setState(() => _index = i),
|
|
items: const [
|
|
BottomNavigationBarItem(icon: Icon(Icons.chat_bubble), label: '消息'),
|
|
BottomNavigationBarItem(icon: Icon(Icons.people), label: '通讯录'),
|
|
BottomNavigationBarItem(icon: Icon(Icons.person), label: '我的'),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|