2026-04-05 22:38:56 +08:00
|
|
|
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';
|
|
|
|
|
|
2026-04-08 01:47:51 +08:00
|
|
|
/// 菜单分组1 - 福利中心 / 实名认证 / 安全设置 / 消息通知
|
2026-04-05 22:38:56 +08:00
|
|
|
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) {
|
2026-04-08 01:47:51 +08:00
|
|
|
final colorScheme = Theme.of(context).colorScheme;
|
|
|
|
|
|
2026-04-05 22:38:56 +08:00
|
|
|
return MenuGroupContainer(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
MenuRow(
|
|
|
|
|
icon: LucideIcons.gift,
|
2026-04-08 01:47:51 +08:00
|
|
|
iconColor: colorScheme.secondary,
|
2026-04-05 22:38:56 +08:00
|
|
|
title: '福利中心',
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(builder: (_) => const WelfareCenterPage()),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
2026-04-06 00:33:35 +08:00
|
|
|
const Divider(height: 1),
|
2026-04-05 22:38:56 +08:00
|
|
|
MenuRow(
|
|
|
|
|
icon: LucideIcons.shieldCheck,
|
2026-04-08 01:47:51 +08:00
|
|
|
iconColor: colorScheme.secondary,
|
2026-04-07 01:05:05 +08:00
|
|
|
title: '實名認證',
|
2026-04-05 22:38:56 +08:00
|
|
|
trailing: KycBadge(kycStatus: kycStatus),
|
|
|
|
|
onTap: () {
|
|
|
|
|
if (kycStatus == 2) {
|
2026-04-08 01:47:51 +08:00
|
|
|
_showKycStatusDialog(context);
|
2026-04-05 22:38:56 +08:00
|
|
|
} else {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(builder: (_) => const KycPage()),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
2026-04-06 00:33:35 +08:00
|
|
|
const Divider(height: 1),
|
2026-04-05 22:38:56 +08:00
|
|
|
MenuRow(
|
|
|
|
|
icon: LucideIcons.lock,
|
2026-04-08 01:47:51 +08:00
|
|
|
iconColor: colorScheme.onSurfaceVariant,
|
2026-04-07 01:05:05 +08:00
|
|
|
title: '安全設置',
|
|
|
|
|
onTap: () => onShowComingSoon('安全設置'),
|
2026-04-05 22:38:56 +08:00
|
|
|
),
|
2026-04-06 00:33:35 +08:00
|
|
|
const Divider(height: 1),
|
2026-04-05 22:38:56 +08:00
|
|
|
MenuRow(
|
|
|
|
|
icon: LucideIcons.bell,
|
2026-04-08 01:47:51 +08:00
|
|
|
iconColor: colorScheme.onSurfaceVariant,
|
2026-04-05 22:38:56 +08:00
|
|
|
title: '消息通知',
|
|
|
|
|
trailing: const RedDotIndicator(),
|
|
|
|
|
onTap: () => onShowComingSoon('消息通知'),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-08 01:47:51 +08:00
|
|
|
void _showKycStatusDialog(BuildContext context) {
|
|
|
|
|
showDialog(
|
2026-04-05 22:38:56 +08:00
|
|
|
context: context,
|
2026-04-08 01:47:51 +08:00
|
|
|
builder: (ctx) => AlertDialog(
|
|
|
|
|
title: const Text('實名認證'),
|
|
|
|
|
content: const Text('您的實名認證已通過'),
|
2026-04-05 22:38:56 +08:00
|
|
|
actions: [
|
2026-04-08 01:47:51 +08:00
|
|
|
TextButton(
|
2026-04-05 22:38:56 +08:00
|
|
|
onPressed: () => Navigator.of(ctx).pop(),
|
2026-04-08 01:47:51 +08:00
|
|
|
child: const Text('确定'),
|
2026-04-05 22:38:56 +08:00
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|