feat: 静态页面开发完成

This commit is contained in:
2026-05-21 14:09:46 +08:00
parent 8156e8efbf
commit 763aef6bb9
73 changed files with 6345 additions and 1370 deletions

View File

@@ -14,14 +14,27 @@ class ZhinianApp extends ConsumerWidget {
final router = ref.watch(routerProvider);
final settings = ref.watch(settingsProvider);
final platformBrightness = MediaQuery.platformBrightnessOf(context);
final isDark = switch (settings.themeMode) {
AppThemeMode.light => false,
AppThemeMode.dark => true,
AppThemeMode.system => platformBrightness == Brightness.dark,
};
AppColors.applyMode(isDark);
return MaterialApp.router(
title: '智念管理',
title: '智念商家端',
debugShowCheckedModeBanner: false,
theme: AppTheme.lightTheme,
darkTheme: AppTheme.darkTheme,
themeMode: settings.flutterThemeMode,
theme: AppTheme.theme,
routerConfig: router,
locale: settings.locale,
// Pages read AppColors.* statics directly; without a key, Router won't
// rebuild descendants on a pure theme toggle. Keying by mode forces the
// whole subtree to remount so every page picks up the new colors.
builder: (context, child) => KeyedSubtree(
key: ValueKey<bool>(isDark),
child: child ?? const SizedBox.shrink(),
),
localizationsDelegates: const [
AppLocalizations.delegate,
GlobalMaterialLocalizations.delegate,