feat: 实现起卦、设置与积分系统

This commit is contained in:
qzl
2026-04-03 16:56:47 +08:00
parent 31594558eb
commit f245eec5f6
170 changed files with 20728 additions and 328 deletions
@@ -1,6 +1,9 @@
import 'package:flutter/material.dart';
import '../../../../core/auth/session_store.dart';
import '../../../divination/presentation/screens/divination_screen.dart';
import '../../../settings/data/models/profile_settings.dart';
import '../../../settings/presentation/screens/settings_screen.dart';
import '../../../../l10n/app_localizations.dart';
import '../../../../shared/theme/app_color_palette.dart';
import '../../../../shared/theme/design_tokens.dart';
@@ -13,11 +16,19 @@ class HomeScreen extends StatefulWidget {
super.key,
required this.account,
required this.sessionStore,
required this.currentLocale,
required this.profileSettings,
required this.coinBalance,
required this.onLocaleChanged,
required this.onLogout,
});
final String account;
final SessionStore sessionStore;
final Locale currentLocale;
final ProfileSettingsV1 profileSettings;
final int coinBalance;
final Future<void> Function(String languageTag) onLocaleChanged;
final Future<void> Function() onLogout;
@override
@@ -229,7 +240,11 @@ class _HomeScreenState extends State<HomeScreen> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: historyItems.map((item) {
return Padding(
padding: const EdgeInsets.only(bottom: AppSpacing.md),
padding: const EdgeInsets.only(
left: AppSpacing.md,
right: AppSpacing.md,
bottom: AppSpacing.md,
),
child: _HistoryCard(item: item),
);
}).toList(),
@@ -240,15 +255,32 @@ class _HomeScreenState extends State<HomeScreen> {
),
bottomNavigationBar: BottomNavBar(
currentTab: MainTab.home,
onTabChange: (_) {},
onTabChange: _onTabChange,
onLogoTap: _onStartDivination,
),
);
}
void _onTabChange(MainTab tab) {
if (tab == MainTab.profile) {
Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (_) => SettingsScreen(
account: widget.account,
settings: widget.profileSettings,
coinBalance: widget.coinBalance,
onInterfaceLanguageChanged: widget.onLocaleChanged,
onLogout: widget.onLogout,
),
),
);
}
}
void _onStartDivination() {
final l10n = AppLocalizations.of(context)!;
_showSnack(context, l10n.featurePending);
Navigator.of(
context,
).push(MaterialPageRoute<void>(builder: (_) => const DivinationScreen()));
}
void _showSnack(BuildContext context, String message) {