Browse Source

refactor(chat): 优化聊天页面布局结构

- 将 GestureDetector 移至 Column 外层以实现点击空白处收起键盘功能
- 调整消息列表区域的容器嵌套结构
- 重新组织组件层级以提升布局逻辑清晰度
master
Jolie 2 months ago
parent
commit
d1cb2be6cf
1 changed files with 13 additions and 13 deletions
  1. 26
      lib/pages/message/chat_page.dart

26
lib/pages/message/chat_page.dart

@ -305,18 +305,18 @@ class _ChatPageState extends State<ChatPage> {
},
),
),
body: Column(
children: [
//
Expanded(
child: Container(
color: Color(0xffF5F5F5),
child: GestureDetector(
onTap: () {
//
FocusManager.instance.primaryFocus?.unfocus();
},
behavior: HitTestBehavior.opaque,
body: GestureDetector(
onTap: () {
//
FocusManager.instance.primaryFocus?.unfocus();
},
behavior: HitTestBehavior.opaque,
child: Column(
children: [
//
Expanded(
child: Container(
color: Color(0xffF5F5F5),
child: ListView.builder(
controller: _scrollController,
reverse: false,
@ -375,7 +375,6 @@ class _ChatPageState extends State<ChatPage> {
),
),
),
),
// 使
ChatInputBar(
onSendMessage: (message) async {
@ -404,6 +403,7 @@ class _ChatPageState extends State<ChatPage> {
},
),
],
),
),
),
);

Loading…
Cancel
Save