feat(ui): 重构资产页面UI,移除shadcn_ui依赖并简化设计 - 删除三个过时的功能规格文档(apply-new-styles.md、bottom-nav-labels.md、theme-dynamic-colors.md) - 重构充值页面(deposit_page.dart):移除shadcn_ui依赖,简化表单验证和UI设计,使用动态主题颜色 - 重构划转页面(transfer_page.dart):移除复杂动画和shadcn_ui依赖,简化UI布局和交互逻辑 - 重构提现页面(withdraw_page.dart):移除shadcn_ui依赖,简化表单验证和网络选择器 - 重构我的页面相关组件:统一使用动态主题颜色,简化菜单项设计和KYC状态显示 - 所有页面现在使用Theme.of(context)获取动态颜色,支持明暗主题切换 - 移除硬编码的颜色引用,提高代码可维护性和主题一致性
91 lines
2.5 KiB
Dart
91 lines
2.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:lucide_icons_flutter/lucide_icons.dart';
|
|
import '../kyc_page.dart';
|
|
import '../welfare_center_page.dart';
|
|
import 'menu_group_container.dart';
|
|
import 'menu_row.dart';
|
|
import 'menu_trailing_widgets.dart';
|
|
|
|
/// 菜单分组1 - 福利中心 / 实名认证 / 安全设置 / 消息通知
|
|
class MenuGroup1 extends StatelessWidget {
|
|
final int kycStatus;
|
|
final void Function(String) onShowComingSoon;
|
|
|
|
const MenuGroup1({
|
|
super.key,
|
|
required this.kycStatus,
|
|
required this.onShowComingSoon,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final colorScheme = Theme.of(context).colorScheme;
|
|
|
|
return MenuGroupContainer(
|
|
child: Column(
|
|
children: [
|
|
MenuRow(
|
|
icon: LucideIcons.gift,
|
|
iconColor: colorScheme.secondary,
|
|
title: '福利中心',
|
|
onTap: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(builder: (_) => const WelfareCenterPage()),
|
|
);
|
|
},
|
|
),
|
|
const Divider(height: 1),
|
|
MenuRow(
|
|
icon: LucideIcons.shieldCheck,
|
|
iconColor: colorScheme.secondary,
|
|
title: '實名認證',
|
|
trailing: KycBadge(kycStatus: kycStatus),
|
|
onTap: () {
|
|
if (kycStatus == 2) {
|
|
_showKycStatusDialog(context);
|
|
} else {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(builder: (_) => const KycPage()),
|
|
);
|
|
}
|
|
},
|
|
),
|
|
const Divider(height: 1),
|
|
MenuRow(
|
|
icon: LucideIcons.lock,
|
|
iconColor: colorScheme.onSurfaceVariant,
|
|
title: '安全設置',
|
|
onTap: () => onShowComingSoon('安全設置'),
|
|
),
|
|
const Divider(height: 1),
|
|
MenuRow(
|
|
icon: LucideIcons.bell,
|
|
iconColor: colorScheme.onSurfaceVariant,
|
|
title: '消息通知',
|
|
trailing: const RedDotIndicator(),
|
|
onTap: () => onShowComingSoon('消息通知'),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
void _showKycStatusDialog(BuildContext context) {
|
|
showDialog(
|
|
context: context,
|
|
builder: (ctx) => AlertDialog(
|
|
title: const Text('實名認證'),
|
|
content: const Text('您的實名認證已通過'),
|
|
actions: [
|
|
TextButton(
|
|
onPressed: () => Navigator.of(ctx).pop(),
|
|
child: const Text('确定'),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|