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 集成视觉设计语言约束
80 lines
2.4 KiB
Dart
80 lines
2.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../../../core/theme/design_tokens.dart';
|
|
|
|
class AuthField extends StatelessWidget {
|
|
const AuthField({
|
|
super.key,
|
|
required this.label,
|
|
required this.hint,
|
|
required this.controller,
|
|
this.keyboardType,
|
|
this.obscureText = false,
|
|
this.suffixIcon,
|
|
this.onChanged,
|
|
});
|
|
|
|
final String label;
|
|
final String hint;
|
|
final TextEditingController controller;
|
|
final TextInputType? keyboardType;
|
|
final bool obscureText;
|
|
final Widget? suffixIcon;
|
|
final ValueChanged<String>? onChanged;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
label,
|
|
style: const TextStyle(
|
|
fontSize: 13,
|
|
fontWeight: FontWeight.w700,
|
|
color: AppColors.slate700,
|
|
),
|
|
),
|
|
SizedBox(height: AppSpacing.sm),
|
|
Semantics(
|
|
label: label,
|
|
textField: true,
|
|
child: TextField(
|
|
controller: controller,
|
|
keyboardType: keyboardType,
|
|
obscureText: obscureText,
|
|
onChanged: onChanged,
|
|
style: const TextStyle(fontSize: 16, color: AppColors.slate900),
|
|
decoration: InputDecoration(
|
|
hintText: hint,
|
|
hintStyle: const TextStyle(
|
|
fontSize: 15,
|
|
color: AppColors.slate400,
|
|
),
|
|
filled: true,
|
|
fillColor: AppColors.authInputBackground,
|
|
contentPadding: const EdgeInsets.symmetric(
|
|
horizontal: AppSpacing.lg,
|
|
vertical: AppSpacing.lg,
|
|
),
|
|
suffixIcon: suffixIcon,
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(AppRadius.lg),
|
|
borderSide: BorderSide.none,
|
|
),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(AppRadius.lg),
|
|
borderSide: const BorderSide(color: AppColors.authInputBorder),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(AppRadius.lg),
|
|
borderSide: const BorderSide(color: AppColors.authInputFocus),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|