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 集成视觉设计语言约束
53 lines
1.3 KiB
Dart
53 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../core/theme/design_tokens.dart';
|
|
|
|
class LinkButton extends StatelessWidget {
|
|
const LinkButton({
|
|
super.key,
|
|
required this.text,
|
|
required this.onTap,
|
|
this.enabled = true,
|
|
this.textAlign = TextAlign.center,
|
|
this.foregroundColor,
|
|
});
|
|
|
|
final String text;
|
|
final VoidCallback? onTap;
|
|
final bool enabled;
|
|
final TextAlign textAlign;
|
|
final Color? foregroundColor;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final color = enabled
|
|
? (foregroundColor ?? AppColors.authLinkText)
|
|
: AppColors.slate300;
|
|
|
|
return TextButton(
|
|
onPressed: enabled ? onTap : null,
|
|
style: TextButton.styleFrom(
|
|
minimumSize: const Size(0, 40),
|
|
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
|
foregroundColor: color,
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: AppSpacing.md,
|
|
vertical: AppSpacing.sm,
|
|
),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(AppRadius.full),
|
|
),
|
|
),
|
|
child: Text(
|
|
text,
|
|
style: TextStyle(
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w600,
|
|
color: color,
|
|
),
|
|
textAlign: textAlign,
|
|
),
|
|
);
|
|
}
|
|
}
|