Files
monisuo/flutter_monisuo/lib/ui/pages/mine/mine_page.dart
sion 42563c906c fix: 修复图标和标签语义问题
## P0 - 简繁体中文混用(6个文件)
- chart_page.dart: 6处简体→繁体(暂无数据、买入、卖出、加载失败等)
- mine_page.dart: 确定 → 確定
- menu_group1.dart: 确定 → 確定
- deposit_page.dart: 单笔最低充值 → 單筆最低充值、网络 → 網絡

## P1 - 图标库不一致(1个文件)
- register_page.dart: Material Icons 统一为 Lucide Icons
  - Icons.chevron_left → LucideIcons.arrowLeft
  - Icons.check → LucideIcons.check
  - Icons.shield → LucideIcons.shieldCheck
  - Icons.lock → LucideIcons.lock
  - Icons.close → LucideIcons.x
  - Icons.camera_alt → LucideIcons.camera

## P2 - hintText 重复(2个文件)
- register_page.dart: 推廣碼(選填) → 請輸入推廣碼(選填)
- asset_dialogs.dart: 聯繫方式 → 方便客服與您聯繫

## 检查结论
 所有图标与功能语义完全匹配
 所有简繁混用问题已修复
 所有图标库统一为 Lucide Icons
2026-04-08 12:41:00 +08:00

141 lines
4.0 KiB
Dart

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../core/theme/app_theme.dart';
import '../../../core/theme/app_spacing.dart';
import '../../../providers/auth_provider.dart';
import '../auth/login_page.dart';
import 'components/avatar_circle.dart';
import 'components/logout_button.dart';
import 'components/menu_group1.dart';
import 'components/menu_group2.dart';
import 'components/profile_card.dart';
/// 我的页面
class MinePage extends StatefulWidget {
const MinePage({super.key});
@override
State<MinePage> createState() => _MinePageState();
}
class _MinePageState extends State<MinePage>
with AutomaticKeepAliveClientMixin {
@override
bool get wantKeepAlive => true;
@override
Widget build(BuildContext context) {
super.build(context);
final colorScheme = Theme.of(context).colorScheme;
return Scaffold(
backgroundColor: colorScheme.surface,
body: Consumer<AuthProvider>(
builder: (context, auth, _) {
return SingleChildScrollView(
padding: EdgeInsets.fromLTRB(
AppSpacing.md,
AppSpacing.md,
AppSpacing.md,
AppSpacing.xl + AppSpacing.md,
),
child: Column(
children: [
ProfileCard(user: auth.user),
SizedBox(height: AppSpacing.sm),
MenuGroup1(
kycStatus: auth.user?.kycStatus ?? 0,
onShowComingSoon: _showComingSoon,
),
SizedBox(height: AppSpacing.sm),
MenuGroup2(onShowAbout: _showAboutDialog),
SizedBox(height: AppSpacing.lg),
LogoutButton(onLogout: () => _handleLogout(auth)),
SizedBox(height: AppSpacing.md),
],
),
);
},
),
);
}
void _showComingSoon(String feature) {
showDialog(
context: context,
builder: (ctx) => AlertDialog(
title: const Text('功能開發中'),
content: Text('$feature功能正在開發中,敬請期待'),
actions: [
TextButton(
onPressed: () => Navigator.of(ctx).pop(),
child: const Text('知道了'),
),
],
),
);
}
void _showAboutDialog() {
showDialog(
context: context,
builder: (ctx) => AlertDialog(
title: Row(
children: [
AvatarCircle(radius: 16, fontSize: 12),
const SizedBox(width: 8),
const Text('模擬所'),
],
),
content: const Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('虛擬貨幣模擬交易平臺'),
SizedBox(height: 8),
Text('版本: 1.0.0'),
],
),
actions: [
TextButton(
onPressed: () => Navigator.of(ctx).pop(),
child: const Text('確定'),
),
],
),
);
}
void _handleLogout(AuthProvider auth) {
final colorScheme = Theme.of(context).colorScheme;
showDialog(
context: context,
builder: (ctx) => AlertDialog(
title: const Text('退出登錄'),
content: const Text('確定要退出登錄嗎?'),
actions: [
TextButton(
onPressed: () => Navigator.of(ctx).pop(),
child: Text('取消',
style: TextStyle(color: colorScheme.onSurfaceVariant)),
),
TextButton(
onPressed: () async {
Navigator.of(ctx).pop();
await auth.logout();
if (ctx.mounted) {
Navigator.of(ctx).pushAndRemoveUntil(
MaterialPageRoute(builder: (_) => const LoginPage()),
(route) => false,
);
}
},
child: Text('退出', style: TextStyle(color: colorScheme.error)),
),
],
),
);
}
}