Browse Source

refactor(agent_view): 使用响应式单位替换固定数值以适配不同屏幕尺寸

weicu
lxm 1 year ago
parent
commit
4a824f9fa1
  1. 237
      lib/modules/agent/views/agent_view.dart

237
lib/modules/agent/views/agent_view.dart

@ -61,40 +61,40 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
leading: IconButton( leading: IconButton(
icon: Icon(Icons.arrow_back_ios, icon: Icon(Icons.arrow_back_ios,
color: isDarkMode ? Colors.white : Colors.black87, size: 20), color: isDarkMode ? Colors.white : Colors.black87, size: 20.sp),
onPressed: () => Get.back(), onPressed: () => Get.back(),
), ),
titleSpacing: 0, titleSpacing: 0,
title: Row( title: Row(
children: [ children: [
Container( Container(
width: 40, width: 40.w,
height: 40, height: 40.w,
decoration: BoxDecoration( decoration: BoxDecoration(
color: primaryColor, color: primaryColor,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20.w),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withOpacity(0.1), color: Colors.black.withOpacity(0.1),
blurRadius: 3, blurRadius: 3.w,
offset: const Offset(0, 1), offset: const Offset(0, 1),
), ),
], ],
), ),
child: const Icon( child: Icon(
Icons.smart_toy_outlined, Icons.smart_toy_outlined,
color: Colors.white, color: Colors.white,
size: 22, size: 22.sp,
), ),
), ),
const SizedBox(width: 12), SizedBox(width: 12.w),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'XiaoYan'.tr, 'XiaoYan'.tr,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black87, color: isDarkMode ? Colors.white : Colors.black87,
), ),
@ -102,18 +102,18 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
Row( Row(
children: [ children: [
Container( Container(
width: 6, width: 6.w,
height: 6, height: 6.w,
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: Colors.green, color: Colors.green,
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
), ),
const SizedBox(width: 4), SizedBox(width: 4.w),
Text( Text(
'online'.tr, 'online'.tr,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12.sp,
color: Colors.green, color: Colors.green,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
@ -131,6 +131,7 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
controller.isTtsEnabled.value controller.isTtsEnabled.value
? Icons.volume_up ? Icons.volume_up
: Icons.volume_off, : Icons.volume_off,
size: 24.sp,
color: controller.isTtsEnabled.value color: controller.isTtsEnabled.value
? primaryColor ? primaryColor
: isDarkMode : isDarkMode
@ -142,9 +143,9 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
// 更多选项 // 更多选项
Container( Container(
width: 34, width: 34.w,
height: 34, height: 34.w,
margin: const EdgeInsets.only(right: 8), margin: EdgeInsets.only(right: 8.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: color:
isDarkMode ? Colors.white.withOpacity(0.1) : Colors.grey[100], isDarkMode ? Colors.white.withOpacity(0.1) : Colors.grey[100],
@ -153,25 +154,28 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
if (!isDarkMode) if (!isDarkMode)
BoxShadow( BoxShadow(
color: Colors.black.withOpacity(0.05), color: Colors.black.withOpacity(0.05),
blurRadius: 2, blurRadius: 2.w,
spreadRadius: 0.5, spreadRadius: 0.5.w,
), ),
], ],
), ),
child: PopupMenuButton( child: PopupMenuButton(
icon: Icon(Icons.more_vert, icon: Icon(Icons.more_vert,
color: isDarkMode ? Colors.white : Colors.black87, size: 20), color: isDarkMode ? Colors.white : Colors.black87,
size: 20.sp),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12.w),
), ),
color: isDarkMode ? Colors.grey[800] : Colors.white, color: isDarkMode ? Colors.grey[800] : Colors.white,
itemBuilder: (context) => [ itemBuilder: (context) => [
PopupMenuItem( PopupMenuItem(
child: Row( child: Row(
children: [ children: [
Icon(Icons.delete_outline, color: primaryColor, size: 20), Icon(Icons.delete_outline,
const SizedBox(width: 8), color: primaryColor, size: 20.sp),
Text('clearChatHistory'.tr, style: TextStyle(fontSize: 14)), SizedBox(width: 8.w),
Text('clearChatHistory'.tr,
style: TextStyle(fontSize: 14.sp)),
], ],
), ),
onTap: () => Future.delayed( onTap: () => Future.delayed(
@ -198,8 +202,8 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
controller: controller.scrollController, controller: controller.scrollController,
shrinkWrap: true, shrinkWrap: true,
reverse: true, reverse: true,
padding: const EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 16, horizontal: 16), vertical: 16.h, horizontal: 16.w),
itemCount: controller.messages.length + itemCount: controller.messages.length +
(controller.hasMoreMessages.value ? 1 : 0), (controller.hasMoreMessages.value ? 1 : 0),
itemBuilder: (context, index) { itemBuilder: (context, index) {
@ -212,7 +216,7 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
final message = controller final message = controller
.messages[controller.messages.length - 1 - index]; .messages[controller.messages.length - 1 - index];
return Padding( return Padding(
padding: const EdgeInsets.only(bottom: 8), padding: EdgeInsets.only(bottom: 8.h),
child: GestureDetector( child: GestureDetector(
onLongPressStart: onLongPressStart:
(LongPressStartDetails details) { (LongPressStartDetails details) {
@ -237,21 +241,20 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
// 输入区域 // 输入区域
Container( Container(
padding: padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.h),
const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: backgroundColor, color: backgroundColor,
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withOpacity(0.06), color: Colors.black.withOpacity(0.06),
blurRadius: 8, blurRadius: 8.w,
offset: const Offset(0, -1), offset: const Offset(0, -1),
), ),
], ],
border: Border( border: Border(
top: BorderSide( top: BorderSide(
color: Colors.grey.withOpacity(0.15), color: Colors.grey.withOpacity(0.15),
width: 1, width: 1.w,
), ),
), ),
), ),
@ -269,29 +272,29 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
Stack( Stack(
children: [ children: [
ClipRRect( ClipRRect(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12.w),
child: Image.file( child: Image.file(
File(controller.selectedImagePath.value!), File(controller.selectedImagePath.value!),
height: 150, height: 150.h,
width: double.infinity, width: double.infinity,
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
Positioned( Positioned(
top: 8, top: 8.h,
right: 8, right: 8.w,
child: GestureDetector( child: GestureDetector(
onTap: () => controller.clearImageInput(), onTap: () => controller.clearImageInput(),
child: Container( child: Container(
padding: const EdgeInsets.all(4), padding: EdgeInsets.all(4.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.black.withOpacity(0.6), color: Colors.black.withOpacity(0.6),
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
child: const Icon( child: Icon(
Icons.close, Icons.close,
color: Colors.white, color: Colors.white,
size: 16, size: 16.sp,
), ),
), ),
), ),
@ -300,34 +303,34 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
), ),
// 预设提示选项 // 预设提示选项
const SizedBox(height: 12), SizedBox(height: 12.h),
SingleChildScrollView( SingleChildScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
child: Row( child: Row(
children: [ children: [
_buildPromptChip( _buildPromptChip(
context: context, context: context,
label: 'summarizeImageContent'.tr,//总结图片内容 label: 'summarizeImageContent'.tr, //总结图片内容
onTap: () => controller.summarizeImage(), onTap: () => controller.summarizeImage(),
), ),
const SizedBox(width: 8), SizedBox(width: 8.w),
_buildPromptChip( _buildPromptChip(
context: context, context: context,
label: 'extractImageText'.tr,//抽取图像文字 label: 'extractImageText'.tr, //抽取图像文字
onTap: () => onTap: () =>
controller.extractTextFromImage(), controller.extractTextFromImage(),
), ),
const SizedBox(width: 8), SizedBox(width: 8.w),
_buildPromptChip( _buildPromptChip(
context: context, context: context,
label: 'translateImageText'.tr,//翻译图像文字 label: 'translateImageText'.tr, //翻译图像文字
onTap: () => onTap: () =>
controller.translateImageText(), controller.translateImageText(),
), ),
], ],
), ),
), ),
const SizedBox(height: 12), SizedBox(height: 12.h),
], ],
); );
} else { } else {
@ -353,8 +356,8 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
controller.toggleInputMode(); controller.toggleInputMode();
}, },
child: Container( child: Container(
width: 44, width: 44.w,
height: 44, height: 44.w,
decoration: BoxDecoration( decoration: BoxDecoration(
color: isDarkMode color: isDarkMode
? Colors.grey[800] ? Colors.grey[800]
@ -368,13 +371,13 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
color: isDarkMode color: isDarkMode
? Colors.grey[300] ? Colors.grey[300]
: Colors.grey[700], : Colors.grey[700],
size: 22, size: 22.sp,
), ),
), ),
); );
}), }),
const SizedBox(width: 8), SizedBox(width: 8.w),
// 文本输入框或语音波形图 // 文本输入框或语音波形图
Expanded( Expanded(
@ -385,23 +388,23 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
if (controller.isTextInputMode.value) { if (controller.isTextInputMode.value) {
// 文本输入模式 - 限制最大高度并只向上扩展 // 文本输入模式 - 限制最大高度并只向上扩展
return Container( return Container(
constraints: const BoxConstraints( constraints: BoxConstraints(
minHeight: 44, // 最小高度 minHeight: 44.h,
maxHeight: 120, // 最大高度限制,防止挤压按钮 maxHeight: 120.h,
), ),
padding: const EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 16), horizontal: 16.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: isDarkMode color: isDarkMode
? Colors.grey[800] ? Colors.grey[800]
: Colors.grey[200], : Colors.grey[200],
borderRadius: BorderRadius.circular(22), borderRadius:
BorderRadius.circular(22.w),
border: Border.all( border: Border.all(
color: isDarkMode color: isDarkMode
? Colors.grey[ ? Colors.grey[800]!
800]! // 修改: 从 Colors.grey[700] 改为 Colors.grey[800]
: Colors.grey.withOpacity(0.1), : Colors.grey.withOpacity(0.1),
width: 1.0, width: 1.w,
), ),
), ),
child: Row( child: Row(
@ -435,7 +438,7 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
} }
}, },
style: TextStyle( style: TextStyle(
fontSize: 15, fontSize: 15.sp,
color: isDarkMode color: isDarkMode
? Colors.white ? Colors.white
: Colors.grey[800], : Colors.grey[800],
@ -448,7 +451,7 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
.tr, // 输入消息... .tr, // 输入消息...
hintStyle: TextStyle( hintStyle: TextStyle(
color: Colors.grey[500], color: Colors.grey[500],
fontSize: 15, fontSize: 15.sp,
), ),
filled: false, filled: false,
border: InputBorder.none, border: InputBorder.none,
@ -458,14 +461,15 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
color: isDarkMode color: isDarkMode
? Colors.grey[800]! ? Colors.grey[800]!
: Colors.grey[200]!, : Colors.grey[200]!,
width: 1.0, width: 1.w,
), ),
), ),
contentPadding: contentPadding:
EdgeInsets.symmetric( EdgeInsets.symmetric(
vertical: isImageActive vertical:
? 12 isImageActive
: 8), // 调整垂直内边距 ? 12.h
: 8.h),
), ),
onSubmitted: (_) => onSubmitted: (_) =>
controller.sendMessage(), controller.sendMessage(),
@ -525,9 +529,9 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
controller.isListening.value; controller.isListening.value;
return Container( return Container(
height: 50, height: 50.h,
padding: const EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 16), horizontal: 16.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: isPushToTalkActive color: isPushToTalkActive
? (isDarkMode ? (isDarkMode
@ -537,7 +541,7 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
? Colors.grey[800] ? Colors.grey[800]
: Colors.grey[200]), : Colors.grey[200]),
borderRadius: borderRadius:
BorderRadius.circular(22), BorderRadius.circular(22.w),
border: Border.all( border: Border.all(
color: isPushToTalkActive color: isPushToTalkActive
? Colors.blue ? Colors.blue
@ -546,8 +550,8 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
: Colors.grey : Colors.grey
.withOpacity(0.1)), .withOpacity(0.1)),
width: isPushToTalkActive width: isPushToTalkActive
? 2.0 ? 2.w
: 1.0, : 1.w,
), ),
), ),
child: Row( child: Row(
@ -572,7 +576,7 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
isPushToTalkActive isPushToTalkActive
? Icons.mic ? Icons.mic
: Icons.mic_none, : Icons.mic_none,
size: 16, size: 16.sp,
color: isPushToTalkActive color: isPushToTalkActive
? Colors.blue ? Colors.blue
: Colors.grey[500], : Colors.grey[500],
@ -607,7 +611,7 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
}), }),
), ),
const SizedBox(width: 8), SizedBox(width: 8.w),
// 动态按钮区域:展开按钮 + 发送按钮 或 图片选择按钮 // 动态按钮区域:展开按钮 + 发送按钮 或 图片选择按钮
Obx(() { Obx(() {
@ -627,7 +631,7 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
if (shouldShowExpand && hasText) if (shouldShowExpand && hasText)
Padding( Padding(
padding: padding:
const EdgeInsets.only(bottom: 40), EdgeInsets.only(bottom: 40.h),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
// 打开底部弹出编辑模式 // 打开底部弹出编辑模式
@ -646,21 +650,21 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
}); });
}, },
child: Container( child: Container(
width: 32, width: 32.w,
height: 32, height: 32.w,
decoration: BoxDecoration( decoration: BoxDecoration(
color: isDarkMode color: isDarkMode
? Colors.grey[700] ? Colors.grey[700]
: Colors.grey[300], : Colors.grey[300],
borderRadius: borderRadius:
BorderRadius.circular(16), BorderRadius.circular(16.w),
), ),
child: Icon( child: Icon(
Icons.expand_less, Icons.expand_less,
color: isDarkMode color: isDarkMode
? Colors.grey[300] ? Colors.grey[300]
: Colors.grey[700], : Colors.grey[700],
size: 20, size: 20.sp,
), ),
), ),
), ),
@ -669,17 +673,17 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
GestureDetector( GestureDetector(
onTap: () => controller.sendMessage(), onTap: () => controller.sendMessage(),
child: Container( child: Container(
width: 44, width: 44.w,
height: 44, height: 44.w,
decoration: BoxDecoration( decoration: BoxDecoration(
color: primaryColor, color: primaryColor,
borderRadius: borderRadius:
BorderRadius.circular(22), BorderRadius.circular(22.w),
), ),
child: const Icon( child: Icon(
Icons.send, Icons.send,
color: Colors.white, color: Colors.white,
size: 22, size: 22.sp,
), ),
), ),
), ),
@ -695,21 +699,21 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
controller.togglePlusOptions(); controller.togglePlusOptions();
}, },
child: Container( child: Container(
width: 44, width: 44.w,
height: 44, height: 44.w,
decoration: BoxDecoration( decoration: BoxDecoration(
color: isDarkMode color: isDarkMode
? Colors.grey[800] ? Colors.grey[800]
: Colors.grey[200], : Colors.grey[200],
borderRadius: borderRadius:
BorderRadius.circular(22), BorderRadius.circular(22.w),
), ),
child: Icon( child: Icon(
isExpanded ? Icons.close : Icons.add, isExpanded ? Icons.close : Icons.add,
color: isDarkMode color: isDarkMode
? Colors.grey[300] ? Colors.grey[300]
: Colors.grey[700], : Colors.grey[700],
size: 22, size: 22.sp,
), ),
), ),
); );
@ -731,8 +735,8 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
child: isExpanded child: isExpanded
? Container( ? Container(
margin: EdgeInsets.only(top: 8.h), margin: EdgeInsets.only(top: 8.h),
padding: EdgeInsets.symmetric( padding:
horizontal: 16.w), // 添加左右边距 EdgeInsets.symmetric(horizontal: 16.w),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment mainAxisAlignment: MainAxisAlignment
.spaceEvenly, // 改为均匀分布 .spaceEvenly, // 改为均匀分布
@ -813,25 +817,24 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
required String label, required String label,
required VoidCallback onTap, required VoidCallback onTap,
}) { }) {
final theme = Theme.of(context); final primaryColor = Theme.of(context).primaryColor;
final primaryColor = theme.primaryColor;
return GestureDetector( return GestureDetector(
onTap: onTap, onTap: onTap,
child: Container( child: Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 8.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: primaryColor.withOpacity(0.08), color: primaryColor.withOpacity(0.08),
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16.w),
border: Border.all( border: Border.all(
color: primaryColor.withOpacity(0.2), color: primaryColor.withOpacity(0.2),
width: 1, width: 1.w,
), ),
), ),
child: Text( child: Text(
label, label,
style: TextStyle( style: TextStyle(
fontSize: 13, fontSize: 13.sp,
color: primaryColor, color: primaryColor,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
@ -865,10 +868,10 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
height: 50.w, // 调整为44.w以适应布局 height: 50.w, // 调整为44.w以适应布局
decoration: BoxDecoration( decoration: BoxDecoration(
color: isDarkMode ? Colors.grey[800] : Colors.grey[100], color: isDarkMode ? Colors.grey[800] : Colors.grey[100],
borderRadius: BorderRadius.circular(12.r), // 调整为10.r borderRadius: BorderRadius.circular(12.w),
border: Border.all( border: Border.all(
color: isDarkMode ? Colors.grey[700]! : Colors.grey[300]!, color: isDarkMode ? Colors.grey[700]! : Colors.grey[300]!,
width: 1, width: 1.w,
), ),
), ),
child: Icon( child: Icon(
@ -1085,8 +1088,8 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
BoxShadow( BoxShadow(
color: (isActive ? Colors.red : Colors.green) color: (isActive ? Colors.red : Colors.green)
.withOpacity(0.3), .withOpacity(0.3),
blurRadius: 12.r, blurRadius: 12.w,
spreadRadius: 2.r, spreadRadius: 2.w,
), ),
], ],
), ),
@ -1148,23 +1151,23 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
if (controller.isLoadingMore.value) { if (controller.isLoadingMore.value) {
// 正在加载状态 // 正在加载状态
return Container( return Container(
padding: const EdgeInsets.symmetric(vertical: 16), padding: EdgeInsets.symmetric(vertical: 16.h),
child: Center( child: Center(
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const SizedBox( SizedBox(
width: 16, width: 16.w,
height: 16, height: 16.h,
child: CircularProgressIndicator( child: CircularProgressIndicator(
strokeWidth: 2, strokeWidth: 2.w,
), ),
), ),
const SizedBox(width: 8), SizedBox(width: 8.w),
Text( Text(
'loadMoreMessages'.tr, // 加载更多消息... 'loadMoreMessages'.tr,
style: const TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14.sp,
color: Colors.grey, color: Colors.grey,
), ),
), ),
@ -1175,23 +1178,23 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
} else if (controller.isLoadingMoreError.value) { } else if (controller.isLoadingMoreError.value) {
// 加载失败状态 // 加载失败状态
return Container( return Container(
padding: const EdgeInsets.symmetric(vertical: 16), padding: EdgeInsets.symmetric(vertical: 16.h),
child: Center( child: Center(
child: GestureDetector( child: GestureDetector(
onTap: () => controller.loadMoreMessages(), onTap: () => controller.loadMoreMessages(),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Icon( Icon(
Icons.refresh, Icons.refresh,
size: 16, size: 16.sp,
color: Colors.grey, color: Colors.grey,
), ),
const SizedBox(width: 8), SizedBox(width: 8.w),
Text( Text(
'loadFailedClickRetry'.tr, // 加载失败,点击重试 'loadFailedClickRetry'.tr,
style: const TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14.sp,
color: Colors.grey, color: Colors.grey,
), ),
), ),
@ -1203,12 +1206,12 @@ class _AgentViewState extends State<AgentView> with WidgetsBindingObserver {
} else { } else {
// 默认状态(有更多消息但未加载) // 默认状态(有更多消息但未加载)
return Container( return Container(
padding: const EdgeInsets.symmetric(vertical: 8), padding: EdgeInsets.symmetric(vertical: 8.h),
child: Center( child: Center(
child: Text( child: Text(
'swipeUpForMore'.tr, // 向上滑动查看更多 'swipeUpForMore'.tr,
style: const TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12.sp,
color: Colors.grey, color: Colors.grey,
), ),
), ),

Loading…
Cancel
Save