This commit is contained in:
sion
2026-04-07 01:05:05 +08:00
parent edad10ff06
commit 5ca1274607
83 changed files with 1561 additions and 1241 deletions

View File

@@ -49,13 +49,13 @@ class _LoginPageState extends State<LoginPage> {
key: formKey,
child: Column(
children: [
// 部品牌
// 部品牌
_buildBrandSection(),
const SizedBox(height: AppSpacing.xxl),
// 表单区
// 表單區
_buildFormSection(),
const SizedBox(height: AppSpacing.xl),
// 底部注册链
// 底部註冊鏈
_buildRegisterRow(),
],
),
@@ -66,13 +66,13 @@ class _LoginPageState extends State<LoginPage> {
}
// ============================================
// 品牌域 - Logo + 品牌名 + 标语
// 品牌域 - Logo + 品牌名 + 標語
// ============================================
Widget _buildBrandSection() {
return Column(
children: [
// Logo 形:渐变 #1F2937 → #374151含 "M"
// Logo 形:漸變 #1F2937 → #374151含 "M"
Container(
width: _logoCircleSize,
height: _logoCircleSize,
@@ -105,9 +105,9 @@ class _LoginPageState extends State<LoginPage> {
textAlign: TextAlign.center,
),
const SizedBox(height: AppSpacing.md),
// 标语
// 標語
Text(
'虚拟货币模拟交易平',
'虛擬貨幣模擬交易平',
style: AppTextStyles.bodyLarge(context).copyWith(
color: context.colors.onSurfaceVariant,
),
@@ -118,7 +118,7 @@ class _LoginPageState extends State<LoginPage> {
}
// ============================================
// 表单区域 - 用名 + 密 + 登录按钮
// 表單區域 - 用名 + 密 + 登錄按鈕
// ============================================
Widget _buildFormSection() {
@@ -139,7 +139,7 @@ class _LoginPageState extends State<LoginPage> {
height: _inputHeight,
child: ShadInputFormField(
id: 'username',
placeholder: const Text('请输入用'),
placeholder: const Text('請輸入用'),
leading: Padding(
padding: const EdgeInsets.only(right: AppSpacing.sm),
child: Icon(LucideIcons.user, size: 18, color: context.appColors.onSurfaceMuted),
@@ -166,7 +166,7 @@ class _LoginPageState extends State<LoginPage> {
height: _inputHeight,
child: ShadInputFormField(
id: 'password',
placeholder: const Text('请输入密'),
placeholder: const Text('請輸入密'),
obscureText: _obscurePassword,
leading: Padding(
padding: const EdgeInsets.only(right: AppSpacing.sm),
@@ -196,7 +196,7 @@ class _LoginPageState extends State<LoginPage> {
}
Widget _buildLoginButton() {
// 设计稿: accent-primary = light:#1F2937 / dark:#D4AF37
// 設計稿: accent-primary = light:#1F2937 / dark:#D4AF37
final buttonColor = context.appColors.accentPrimary;
final textColor = context.colors.onPrimary;
@@ -222,7 +222,7 @@ class _LoginPageState extends State<LoginPage> {
),
)
: Text(
'',
'',
style: AppTextStyles.headlineLarge(context).copyWith(
fontWeight: FontWeight.w700,
color: textColor,
@@ -235,7 +235,7 @@ class _LoginPageState extends State<LoginPage> {
}
// ============================================
// 底部注册链
// 底部註冊鏈
// ============================================
Widget _buildRegisterRow() {
@@ -249,7 +249,7 @@ class _LoginPageState extends State<LoginPage> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'还没有账户',
'還沒有賬戶',
style: AppTextStyles.bodyLarge(context).copyWith(
color: secondaryTextColor,
),
@@ -258,7 +258,7 @@ class _LoginPageState extends State<LoginPage> {
GestureDetector(
onTap: _navigateToRegister,
child: Text(
'立即注册',
'立即註冊',
style: AppTextStyles.bodyLarge(context).copyWith(
fontWeight: FontWeight.w600,
color: goldColor,
@@ -276,20 +276,20 @@ class _LoginPageState extends State<LoginPage> {
String? _validateUsername(String? value) {
if (value == null || value.isEmpty) {
return '请输入用';
return '請輸入用';
}
if (value.length < 3) {
return '名至少 3 字符';
return '名至少 3 字符';
}
return null;
}
String? _validatePassword(String? value) {
if (value == null || value.isEmpty) {
return '请输入密';
return '請輸入密';
}
if (value.length < 6) {
return '至少 6 字符';
return '至少 6 字符';
}
return null;
}
@@ -312,7 +312,7 @@ class _LoginPageState extends State<LoginPage> {
if (response.success) {
_navigateToMainPage();
} else {
_showErrorDialog(response.message ?? '名或密码错误');
_showErrorDialog(response.message ?? '名或密碼錯誤');
}
}
@@ -334,11 +334,11 @@ class _LoginPageState extends State<LoginPage> {
showShadDialog(
context: context,
builder: (context) => ShadDialog.alert(
title: const Text('录失败'),
title: const Text('錄失敗'),
description: Text(message),
actions: [
ShadButton(
child: const Text(''),
child: const Text(''),
onPressed: () => Navigator.of(context).pop(),
),
],