feat: 添加视觉设计语言系统并重构认证页面UI
- 新增 visual_design_language.md 设计规范文档 - 新增 auth 设计 tokens (authBackground, authCard, authInput, feedback 系列等) - 重构登录/注册/验证码/重置密码页面为新设计系统 - 新增 AuthHeroHeader, AuthSurfaceCard, AuthSection, AuthField, PasswordField 组件 - 重构 AppBanner 和 Toast 支持多类型配置 (info/success/warning/error) - 后端 AgentScope: 重整 schemas/prompts/tools 作用域, 新增协议文档 - 更新 AGENTS.md 集成视觉设计语言约束
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart' hide BackButton;
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
@@ -139,13 +137,8 @@ class _MessageInviteListScreenState extends State<MessageInviteListScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic>? _parseCalendarContent(String? content) {
|
||||
if (content == null) return null;
|
||||
try {
|
||||
return jsonDecode(content) as Map<String, dynamic>;
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
Map<String, dynamic>? _parseCalendarContent(Map<String, dynamic>? content) {
|
||||
return content;
|
||||
}
|
||||
|
||||
Future<(String calendarTitle, String senderName)?> _getCalendarInviteInfo(
|
||||
@@ -250,7 +243,7 @@ class _MessageInviteListScreenState extends State<MessageInviteListScreen> {
|
||||
if (friendRequest == null) return;
|
||||
|
||||
final title = '${friendRequest.sender.username} 请求添加您为好友';
|
||||
final description = message.content;
|
||||
final description = message.content?['message'] as String?;
|
||||
final statusText = isReadOnly
|
||||
? (friendRequest.status == 'accepted'
|
||||
? '已接受'
|
||||
@@ -579,13 +572,8 @@ class _MessageCard extends StatelessWidget {
|
||||
return '${friendRequest!.sender.username} 请求添加您为好友';
|
||||
}
|
||||
if (message.messageType == InboxMessageType.calendar) {
|
||||
try {
|
||||
final data =
|
||||
jsonDecode(message.content ?? '{}') as Map<String, dynamic>;
|
||||
return data['title'] as String? ?? '日历邀请';
|
||||
} catch (_) {
|
||||
return '日历邀请';
|
||||
}
|
||||
final data = message.content;
|
||||
return data?['title'] as String? ?? '日历邀请';
|
||||
}
|
||||
return '系统消息';
|
||||
}
|
||||
@@ -594,11 +582,7 @@ class _MessageCard extends StatelessWidget {
|
||||
if (message.messageType == InboxMessageType.calendar) {
|
||||
Map<String, dynamic>? data;
|
||||
if (message.content != null) {
|
||||
try {
|
||||
data = jsonDecode(message.content!) as Map<String, dynamic>;
|
||||
} catch (_) {
|
||||
data = null;
|
||||
}
|
||||
data = message.content;
|
||||
}
|
||||
if (data == null) return '点击查看详情';
|
||||
|
||||
@@ -617,6 +601,6 @@ class _MessageCard extends StatelessWidget {
|
||||
}
|
||||
return '点击查看详情';
|
||||
}
|
||||
return message.content ?? '点击查看详情';
|
||||
return message.content?['message'] as String? ?? '点击查看详情';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../core/theme/design_tokens.dart';
|
||||
@@ -19,13 +17,8 @@ class CalendarInviteCard extends StatelessWidget {
|
||||
});
|
||||
|
||||
String? get eventTitle {
|
||||
if (message.content == null) return null;
|
||||
try {
|
||||
final data = jsonDecode(message.content!) as Map<String, dynamic>;
|
||||
return data['title'] as String?;
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
final data = message.content;
|
||||
return data?['title'] as String?;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -101,13 +94,8 @@ class CalendarUpdateCard extends StatelessWidget {
|
||||
const CalendarUpdateCard({super.key, required this.message, this.onTap});
|
||||
|
||||
String? get eventTitle {
|
||||
if (message.content == null) return null;
|
||||
try {
|
||||
final data = jsonDecode(message.content!) as Map<String, dynamic>;
|
||||
return data['title'] as String?;
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
final data = message.content;
|
||||
return data?['title'] as String?;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -190,13 +178,8 @@ class CalendarDeleteCard extends StatelessWidget {
|
||||
const CalendarDeleteCard({super.key, required this.message});
|
||||
|
||||
String? get eventTitle {
|
||||
if (message.content == null) return null;
|
||||
try {
|
||||
final data = jsonDecode(message.content!) as Map<String, dynamic>;
|
||||
return data['title'] as String?;
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
final data = message.content;
|
||||
return data?['title'] as String?;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user