a10a2db27a
- 新增 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 集成视觉设计语言约束
76 lines
2.1 KiB
Dart
76 lines
2.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../../core/theme/design_tokens.dart';
|
|
import '../toast/toast_type.dart';
|
|
import '../toast/toast_type_config.dart' show ToastTypeConfig;
|
|
|
|
class AppBanner extends StatelessWidget {
|
|
final String message;
|
|
final ToastType type;
|
|
final bool visible;
|
|
final String? title;
|
|
|
|
const AppBanner({
|
|
super.key,
|
|
required this.message,
|
|
this.type = ToastType.warning,
|
|
this.visible = true,
|
|
this.title,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (!visible) return const SizedBox.shrink();
|
|
|
|
final config = ToastTypeConfig.fromType(type);
|
|
|
|
return Container(
|
|
width: double.infinity,
|
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
|
|
decoration: BoxDecoration(
|
|
color: config.surfaceColor,
|
|
borderRadius: BorderRadius.circular(AppRadius.md),
|
|
border: Border.all(color: config.borderColor),
|
|
),
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Container(
|
|
width: 28,
|
|
height: 28,
|
|
decoration: BoxDecoration(
|
|
color: config.iconColor.withValues(alpha: 0.12),
|
|
borderRadius: BorderRadius.circular(AppRadius.full),
|
|
),
|
|
child: Icon(config.icon, size: 16, color: config.iconColor),
|
|
),
|
|
const SizedBox(width: 8),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
title ?? config.label,
|
|
style: TextStyle(
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.w700,
|
|
color: config.textColor,
|
|
),
|
|
),
|
|
const SizedBox(height: 2),
|
|
Text(
|
|
message,
|
|
style: TextStyle(
|
|
fontSize: 13,
|
|
height: 1.35,
|
|
color: config.textColor,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|