refactor: 重构前端 UI 组件与后端 AgentScope schemas

This commit is contained in:
qzl
2026-03-12 18:26:10 +08:00
parent 78c2488144
commit f201babb48
16 changed files with 1341 additions and 617 deletions
@@ -3,6 +3,9 @@ import 'package:go_router/go_router.dart';
import '../../../../core/theme/design_tokens.dart';
import '../../../../shared/widgets/page_header.dart' as widgets;
import '../../../../shared/widgets/app_input.dart';
import '../../../../shared/widgets/link_button.dart';
import '../../../../shared/widgets/toast/toast.dart';
import '../../../../shared/widgets/toast/toast_type.dart';
class AddContactScreen extends StatefulWidget {
final String? contactId;
@@ -62,17 +65,24 @@ class _AddContactScreenState extends State<AddContactScreen> {
}
Widget _buildConfirmButton() {
return GestureDetector(
onTap: _handleConfirm,
child: Container(
width: 36,
height: 36,
decoration: BoxDecoration(
color: AppColors.surfaceInfo,
borderRadius: BorderRadius.circular(18),
border: Border.all(color: AppColors.borderQuaternary),
return SizedBox(
width: AppSpacing.xxl * 2,
height: AppSpacing.xxl * 2,
child: TextButton(
onPressed: _handleConfirm,
style: TextButton.styleFrom(
padding: const EdgeInsets.all(AppSpacing.none),
backgroundColor: AppColors.surfaceInfo,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppRadius.full),
side: const BorderSide(color: AppColors.borderQuaternary),
),
),
child: const Icon(
Icons.check,
size: AppSpacing.lg,
color: AppColors.blue600,
),
child: const Icon(Icons.check, size: 16, color: AppColors.blue600),
),
);
}
@@ -83,7 +93,7 @@ class _AddContactScreenState extends State<AddContactScreen> {
width: 72,
height: 72,
decoration: BoxDecoration(
color: const Color(0xFFF3F6FC),
color: AppColors.surfaceInfoLight,
borderRadius: BorderRadius.circular(36),
border: Border.all(color: Colors.transparent),
),
@@ -102,7 +112,7 @@ class _AddContactScreenState extends State<AddContactScreen> {
decoration: BoxDecoration(
color: AppColors.white,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: const Color(0xFFE3EAF6)),
border: Border.all(color: AppColors.messageCardBorder),
),
child: Column(
children: [
@@ -127,19 +137,12 @@ class _AddContactScreenState extends State<AddContactScreen> {
}
Widget _buildDeleteRow() {
return GestureDetector(
onTap: _handleDelete,
child: Container(
padding: const EdgeInsets.only(bottom: 8),
alignment: Alignment.center,
child: const Text(
'删除联系人',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: AppColors.red600,
),
),
return Padding(
padding: const EdgeInsets.only(bottom: AppSpacing.sm),
child: LinkButton(
text: '删除联系人',
onTap: _handleDelete,
foregroundColor: AppColors.red600,
),
);
}
@@ -149,9 +152,7 @@ class _AddContactScreenState extends State<AddContactScreen> {
final email = _emailController.text.trim();
if (name.isEmpty || email.isEmpty) {
ScaffoldMessenger.of(
context,
).showSnackBar(const SnackBar(content: Text('请填写昵称和邮箱')));
Toast.show(context, '请填写昵称和邮箱', type: ToastType.warning);
return;
}