feat: 接入起卦后端流程并完善积分扣减链路
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../l10n/app_localizations.dart';
|
||||
import '../../../../shared/theme/app_color_palette.dart';
|
||||
import '../../../../shared/theme/design_tokens.dart';
|
||||
import '../../data/models/profile_settings.dart';
|
||||
import '../widgets/settings_section_widgets.dart';
|
||||
import 'coin_center_screen.dart';
|
||||
import 'general_settings_screen.dart';
|
||||
import 'legal_center_screen.dart';
|
||||
import 'privacy_notification_settings_screen.dart';
|
||||
|
||||
class SettingsScreen extends StatefulWidget {
|
||||
const SettingsScreen({
|
||||
@@ -44,7 +42,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
final palette = Theme.of(context).extension<AppColorPalette>()!;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: colors.surfaceContainerLow,
|
||||
@@ -62,10 +59,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
AppSpacing.xl,
|
||||
),
|
||||
children: [
|
||||
ProfileHeaderCard(
|
||||
account: widget.account,
|
||||
version: _settings.version,
|
||||
),
|
||||
ProfileHeaderCard(account: widget.account),
|
||||
const SizedBox(height: AppSpacing.lg),
|
||||
WalletHeroCard(
|
||||
balance: widget.coinBalance,
|
||||
@@ -76,39 +70,16 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
SectionLabel(text: l10n.settingsSectionQuickAccess),
|
||||
SettingsGroupCard(
|
||||
children: [
|
||||
SettingsMenuTile(
|
||||
icon: Icons.toll_rounded,
|
||||
title: l10n.settingsCoinCenterTitle,
|
||||
subtitle: l10n.settingsCoinCenterSubtitle(widget.coinBalance),
|
||||
tint: palette.historyGoldText,
|
||||
background: palette.historyGoldBg,
|
||||
onTap: _openCoinCenter,
|
||||
),
|
||||
SettingsMenuTile(
|
||||
icon: Icons.tune_rounded,
|
||||
title: l10n.settingsGeneralTitle,
|
||||
subtitle: l10n.settingsGeneralSubtitle(
|
||||
displayLanguageLabel(
|
||||
l10n,
|
||||
_settings.preferences.interfaceLanguage,
|
||||
),
|
||||
),
|
||||
tint: colors.primary,
|
||||
background: colors.surfaceContainerHighest,
|
||||
onTap: _openGeneralSettings,
|
||||
),
|
||||
SettingsMenuTile(
|
||||
icon: Icons.privacy_tip_outlined,
|
||||
title: l10n.settingsPrivacyAndNotificationTitle,
|
||||
subtitle: l10n.settingsPrivacyAndNotificationSubtitle,
|
||||
tint: palette.warning,
|
||||
background: palette.warningContainer,
|
||||
onTap: _openPrivacyAndNotification,
|
||||
),
|
||||
SettingsMenuTile(
|
||||
icon: Icons.description_outlined,
|
||||
title: l10n.settingsLegalCenterTitle,
|
||||
subtitle: l10n.settingsLegalCenterSubtitle,
|
||||
tint: colors.secondary,
|
||||
background: colors.surfaceContainerHighest,
|
||||
showDivider: false,
|
||||
@@ -117,21 +88,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
],
|
||||
),
|
||||
const SizedBox(height: AppSpacing.xl),
|
||||
SectionLabel(text: l10n.settingsSectionAccount),
|
||||
SettingsGroupCard(
|
||||
children: [
|
||||
SettingsMenuTile(
|
||||
icon: Icons.logout_rounded,
|
||||
title: l10n.logout,
|
||||
subtitle: l10n.settingsLogoutSubtitle,
|
||||
tint: colors.error,
|
||||
background: colors.error.withValues(alpha: 0.08),
|
||||
showDivider: false,
|
||||
onTap: _confirmLogout,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: AppSpacing.xl),
|
||||
FilledButton(
|
||||
onPressed: _isLoggingOut ? null : _confirmLogout,
|
||||
style: FilledButton.styleFrom(
|
||||
@@ -175,14 +131,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _openPrivacyAndNotification() async {
|
||||
await Navigator.of(context).push<void>(
|
||||
MaterialPageRoute<void>(
|
||||
builder: (_) => PrivacyNotificationSettingsScreen(settings: _settings),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _openLegalCenter() async {
|
||||
await Navigator.of(context).push<void>(
|
||||
MaterialPageRoute<void>(builder: (_) => const LegalCenterScreen()),
|
||||
|
||||
Reference in New Issue
Block a user