|
|
@ -56,34 +56,33 @@ class MessageBubble extends GetView<AgentController> { |
|
|
crossAxisAlignment: |
|
|
crossAxisAlignment: |
|
|
isUser ? CrossAxisAlignment.end : CrossAxisAlignment.start, |
|
|
isUser ? CrossAxisAlignment.end : CrossAxisAlignment.start, |
|
|
children: [ |
|
|
children: [ |
|
|
Container( |
|
|
Stack( |
|
|
padding: (hasImage && message == '[图片]') |
|
|
children: [ |
|
|
? EdgeInsets.zero |
|
|
Container( |
|
|
: const EdgeInsets.all(12), |
|
|
padding: (hasImage && message == '[图片]') |
|
|
decoration: BoxDecoration( |
|
|
? EdgeInsets.zero |
|
|
color: _getBubbleColor(context), |
|
|
: const EdgeInsets.all(12), |
|
|
borderRadius: BorderRadius.only( |
|
|
decoration: BoxDecoration( |
|
|
topLeft: isUser |
|
|
color: _getBubbleColor(context), |
|
|
? const Radius.circular(18) |
|
|
borderRadius: BorderRadius.only( |
|
|
: const Radius.circular(4), |
|
|
topLeft: isUser |
|
|
topRight: isUser |
|
|
? const Radius.circular(18) |
|
|
? const Radius.circular(4) |
|
|
: const Radius.circular(4), |
|
|
: const Radius.circular(18), |
|
|
topRight: isUser |
|
|
bottomLeft: const Radius.circular(18), |
|
|
? const Radius.circular(4) |
|
|
bottomRight: const Radius.circular(18), |
|
|
: const Radius.circular(18), |
|
|
), |
|
|
bottomLeft: const Radius.circular(18), |
|
|
boxShadow: [ |
|
|
bottomRight: const Radius.circular(18), |
|
|
BoxShadow( |
|
|
), |
|
|
color: Colors.black.withOpacity(0.05), |
|
|
boxShadow: [ |
|
|
blurRadius: 2, |
|
|
BoxShadow( |
|
|
offset: const Offset(0, 1), |
|
|
color: Colors.black.withOpacity(0.05), |
|
|
|
|
|
blurRadius: 2, |
|
|
|
|
|
offset: const Offset(0, 1), |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
), |
|
|
), |
|
|
], |
|
|
child: Padding( |
|
|
), |
|
|
|
|
|
child: Stack( |
|
|
|
|
|
children: [ |
|
|
|
|
|
// 主要消息内容 |
|
|
|
|
|
Padding( |
|
|
|
|
|
padding: (!isUser && |
|
|
padding: (!isUser && |
|
|
functionCalls != null && |
|
|
functionCalls != null && |
|
|
functionCalls!.isNotEmpty) |
|
|
functionCalls!.isNotEmpty) |
|
|
@ -91,14 +90,15 @@ class MessageBubble extends GetView<AgentController> { |
|
|
: EdgeInsets.zero, |
|
|
: EdgeInsets.zero, |
|
|
child: _buildMessageContent(context), |
|
|
child: _buildMessageContent(context), |
|
|
), |
|
|
), |
|
|
//工具调用流程显示(仅在AI消息且有functionCalls时显示) |
|
|
), |
|
|
if (!isUser && |
|
|
//工具调用流程显示(仅在AI消息且有functionCalls时显示) |
|
|
functionCalls != null && |
|
|
if (!isUser && |
|
|
functionCalls!.isNotEmpty) |
|
|
functionCalls != null && |
|
|
_buildFunctionCallsWidget(context), |
|
|
functionCalls!.isNotEmpty) |
|
|
], |
|
|
_buildFunctionCallsWidget(context), |
|
|
), |
|
|
], |
|
|
), |
|
|
), |
|
|
|
|
|
|
|
|
const SizedBox(height: 4), |
|
|
const SizedBox(height: 4), |
|
|
// 识别中的消息不显示时间 |
|
|
// 识别中的消息不显示时间 |
|
|
if (!isRecognizing) |
|
|
if (!isRecognizing) |
|
|
@ -621,12 +621,17 @@ class MessageBubble extends GetView<AgentController> { |
|
|
); |
|
|
); |
|
|
}, |
|
|
}, |
|
|
child: Container( |
|
|
child: Container( |
|
|
height: 20, // 增加固定高度,给字体更多空间 |
|
|
height: 30, // 增加固定高度,给字体更多空间 |
|
|
|
|
|
padding: EdgeInsets.all(8), |
|
|
decoration: BoxDecoration( |
|
|
decoration: BoxDecoration( |
|
|
color: Theme.of(context).brightness == Brightness.dark |
|
|
color: Theme.of(context).brightness == Brightness.dark |
|
|
? Colors.grey[800]?.withOpacity(0.8) |
|
|
? const Color.fromARGB(255, 71, 68, 68) |
|
|
|
|
|
?.withOpacity(0.8) |
|
|
: Colors.grey[100]?.withOpacity(0.9), |
|
|
: Colors.grey[100]?.withOpacity(0.9), |
|
|
borderRadius: BorderRadius.circular(6), |
|
|
borderRadius: const BorderRadius.only( |
|
|
|
|
|
topLeft: Radius.circular(6), |
|
|
|
|
|
topRight: Radius.circular(6), |
|
|
|
|
|
), |
|
|
border: Border.all( |
|
|
border: Border.all( |
|
|
color: Theme.of(context).brightness == Brightness.dark |
|
|
color: Theme.of(context).brightness == Brightness.dark |
|
|
? Colors.white.withOpacity(0.1) |
|
|
? Colors.white.withOpacity(0.1) |
|
|
@ -682,7 +687,10 @@ class MessageBubble extends GetView<AgentController> { |
|
|
color: Theme.of(context).brightness == Brightness.dark |
|
|
color: Theme.of(context).brightness == Brightness.dark |
|
|
? Colors.grey[900]?.withOpacity(0.95) // 深色模式下使用深灰色背景 |
|
|
? Colors.grey[900]?.withOpacity(0.95) // 深色模式下使用深灰色背景 |
|
|
: Colors.white.withOpacity(0.95), // 浅色模式下使用白色背景 |
|
|
: Colors.white.withOpacity(0.95), // 浅色模式下使用白色背景 |
|
|
borderRadius: BorderRadius.circular(4), // 减小圆角 |
|
|
borderRadius: const BorderRadius.only( |
|
|
|
|
|
bottomLeft: Radius.circular(6), |
|
|
|
|
|
bottomRight: Radius.circular(6), |
|
|
|
|
|
), |
|
|
border: Border.all( |
|
|
border: Border.all( |
|
|
color: Theme.of(context).brightness == Brightness.dark |
|
|
color: Theme.of(context).brightness == Brightness.dark |
|
|
? Colors.white.withOpacity(0.2) |
|
|
? Colors.white.withOpacity(0.2) |
|
|
|