fix:折算设置

This commit is contained in:
jingyun
2026-06-18 18:44:23 +08:00
parent 975f115859
commit 0b4b113de8
2 changed files with 12 additions and 65 deletions
@@ -102,8 +102,6 @@ class ProfilePage extends ConsumerWidget {
title: '邀请好友,各得奖励',
subtitle: '需登录',
icon: Icons.card_giftcard_outlined,
backgroundColor: const Color(0xFFF6ECD6),
iconColor: const Color(0xFFB5862A),
onTap: () => _showInviteSheet(context),
),
const PrototypeDivider(margin: EdgeInsets.zero),
@@ -111,8 +109,6 @@ class ProfilePage extends ConsumerWidget {
title: '分享我的贵金属估值卡',
subtitle: '免登录 · 自动打码金额',
icon: Icons.share_outlined,
backgroundColor: const Color(0xFFEAF1FF),
iconColor: const Color(0xFF4F7DD1),
onTap: () =>
_showShareCardSheet(context, currentUser?.nickname),
),
@@ -129,8 +125,6 @@ class ProfilePage extends ConsumerWidget {
title: '本地导出备份',
trailing: '导出',
onTap: () => _showLocalBackupSheet(context),
backgroundColor: const Color(0xFFF3EFE7),
iconColor: const Color(0xFF8A8780),
),
const PrototypeDivider(margin: EdgeInsets.zero),
_SettingRow(
@@ -138,8 +132,6 @@ class ProfilePage extends ConsumerWidget {
title: '云备份 · 多端同步',
trailing: loggedIn ? '已登录' : '登录解锁',
onTap: () => _showCloudBackupSheet(context, loggedIn),
backgroundColor: const Color(0xFFEAF2ED),
iconColor: const Color(0xFF5E8E75),
),
const PrototypeDivider(margin: EdgeInsets.zero),
_SettingRow(
@@ -147,8 +139,6 @@ class ProfilePage extends ConsumerWidget {
title: '添加桌面小组件',
trailing: '占位',
onTap: () => _showWidgetSheet(context),
backgroundColor: const Color(0xFFF6ECD6),
iconColor: const Color(0xFFB5862A),
),
],
),
@@ -163,8 +153,6 @@ class ProfilePage extends ConsumerWidget {
title: '纯度系数管理',
trailing: '${settings.purityPresets.length}',
onTap: () => _showPuritySheet(context, settings),
backgroundColor: const Color(0xFFF4EAF8),
iconColor: const Color(0xFF8A5CBF),
),
const PrototypeDivider(margin: EdgeInsets.zero),
_SettingRow(
@@ -173,8 +161,6 @@ class ProfilePage extends ConsumerWidget {
trailing:
'${(settings.recycleDiscounts.values.first * 100).toStringAsFixed(0)}%',
onTap: () => _showRecycleSheet(context, settings),
backgroundColor: const Color(0xFFF8EFE0),
iconColor: const Color(0xFFB07A32),
),
const PrototypeDivider(margin: EdgeInsets.zero),
_SettingRow(
@@ -192,8 +178,6 @@ class ProfilePage extends ConsumerWidget {
.setPriceColorMode(nextMode);
_toast(context, '已切换为「${nextMode.label}');
},
backgroundColor: const Color(0xFFE9F3F1),
iconColor: const Color(0xFF4E8B7B),
),
const PrototypeDivider(margin: EdgeInsets.zero),
_SettingRow(
@@ -201,8 +185,6 @@ class ProfilePage extends ConsumerWidget {
title: '显示币种',
trailing: '¥ CNY',
onTap: () => _toast(context, '当前仅支持 ¥ CNY'),
backgroundColor: const Color(0xFFF1EFE9),
iconColor: const Color(0xFF7F7A73),
),
],
),
@@ -217,8 +199,6 @@ class ProfilePage extends ConsumerWidget {
title: '设置',
trailing: null,
onTap: () => context.push(AppRoutes.settings),
backgroundColor: const Color(0xFFF1EFE9),
iconColor: const Color(0xFF7F7A73),
),
const PrototypeDivider(margin: EdgeInsets.zero),
_SettingRow(
@@ -231,8 +211,6 @@ class ProfilePage extends ConsumerWidget {
),
mode: LaunchMode.inAppBrowserView,
),
backgroundColor: const Color(0xFFF1EFE9),
iconColor: const Color(0xFF7F7A73),
),
const PrototypeDivider(margin: EdgeInsets.zero),
_SettingRow(
@@ -240,8 +218,6 @@ class ProfilePage extends ConsumerWidget {
title: '免责声明 · 数据来源',
trailing: null,
onTap: () => _showDisclaimer(context),
backgroundColor: const Color(0xFFF7F0E2),
iconColor: const Color(0xFFB07A32),
),
const PrototypeDivider(margin: EdgeInsets.zero),
_SettingRow(
@@ -249,8 +225,6 @@ class ProfilePage extends ConsumerWidget {
title: '意见反馈 · 关于金值',
trailing: null,
onTap: () => _showAbout(context),
backgroundColor: const Color(0xFFEAF1FF),
iconColor: const Color(0xFF4F7DD1),
),
],
),
@@ -332,16 +306,12 @@ class _MenuRow extends StatelessWidget {
required this.title,
required this.subtitle,
required this.icon,
required this.backgroundColor,
required this.iconColor,
required this.onTap,
});
final String title;
final String subtitle;
final IconData icon;
final Color backgroundColor;
final Color iconColor;
final VoidCallback onTap;
@override
@@ -353,15 +323,7 @@ class _MenuRow extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
child: Row(
children: [
Container(
width: 34,
height: 34,
decoration: BoxDecoration(
color: backgroundColor,
borderRadius: BorderRadius.circular(10),
),
child: Icon(icon, size: 18, color: iconColor),
),
Icon(icon, size: 20, color: const Color(0xFF8A8780)),
const SizedBox(width: 12),
Expanded(
child: Column(
@@ -395,8 +357,6 @@ class _SettingRow extends StatelessWidget {
required this.icon,
required this.title,
required this.onTap,
required this.backgroundColor,
required this.iconColor,
this.trailing,
});
@@ -404,8 +364,6 @@ class _SettingRow extends StatelessWidget {
final String title;
final String? trailing;
final VoidCallback onTap;
final Color backgroundColor;
final Color iconColor;
@override
Widget build(BuildContext context) {
@@ -416,15 +374,7 @@ class _SettingRow extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
child: Row(
children: [
Container(
width: 34,
height: 34,
decoration: BoxDecoration(
color: backgroundColor,
borderRadius: BorderRadius.circular(10),
),
child: Icon(icon, size: 18, color: iconColor),
),
Icon(icon, size: 20, color: const Color(0xFF8A8780)),
const SizedBox(width: 12),
Expanded(
child: Text(
@@ -337,13 +337,15 @@ class SettingsPage extends HookConsumerWidget {
_ChoiceButton(
label: PriceColorMode.redUpGreenDown.label,
selected: current == PriceColorMode.redUpGreenDown,
onTap: () => Navigator.of(ctx).pop(PriceColorMode.redUpGreenDown),
onTap: () =>
Navigator.of(ctx).pop(PriceColorMode.redUpGreenDown),
),
const SizedBox(height: 12),
_ChoiceButton(
label: PriceColorMode.greenUpRedDown.label,
selected: current == PriceColorMode.greenUpRedDown,
onTap: () => Navigator.of(ctx).pop(PriceColorMode.greenUpRedDown),
onTap: () =>
Navigator.of(ctx).pop(PriceColorMode.greenUpRedDown),
),
],
),
@@ -351,9 +353,9 @@ class SettingsPage extends HookConsumerWidget {
),
);
if (selected != null && context.mounted) {
ref.read(profileSettingsControllerProvider.notifier).setPriceColorMode(
selected,
);
ref
.read(profileSettingsControllerProvider.notifier)
.setPriceColorMode(selected);
}
}
@@ -779,7 +781,7 @@ class _ThemeSegmentCard extends StatelessWidget {
Widget build(BuildContext context) {
final cs = ShadTheme.of(context).colorScheme;
final options = <(ThemeMode, String, IconData)>[
(ThemeMode.system, '跟随系统', Icons.brightness_auto_outlined),
(ThemeMode.system, '系统主题', Icons.brightness_auto_outlined),
(ThemeMode.light, '浅色', Icons.light_mode_outlined),
(ThemeMode.dark, '深色', Icons.dark_mode_outlined),
];
@@ -1081,9 +1083,7 @@ class _ChoiceButton extends StatelessWidget {
decoration: BoxDecoration(
color: selected ? cs.primary : cs.secondary,
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: selected ? cs.primary : cs.border,
),
border: Border.all(color: selected ? cs.primary : cs.border),
),
child: Text(
label,
@@ -1182,10 +1182,7 @@ class _ValueRow extends StatelessWidget {
style: TextStyle(fontSize: 15, color: cs.foreground),
),
),
Text(
value,
style: TextStyle(fontSize: 13, color: cs.mutedForeground),
),
Text(value, style: TextStyle(fontSize: 13, color: cs.mutedForeground)),
],
);
}