feat: disable letter cache (#446)

Fixes #445
This commit is contained in:
lollipopkit🏳️‍⚧️
2024-07-03 19:55:33 +08:00
committed by GitHub
parent 4430045550
commit 6e428c91d1
18 changed files with 103 additions and 69 deletions

View File

@@ -80,37 +80,22 @@ class MyApp extends StatelessWidget {
themeMode: themeMode,
theme: light,
darkTheme: tMode < 3 ? dark : dark.toAmoled,
home: _buildAppContent(ctx),
home: Builder(
builder: (context) {
context.setLibL10n();
final appL10n = AppLocalizations.of(context);
if (appL10n != null) l10n = appL10n;
final intros = _IntroPage.builders;
if (intros.isNotEmpty) {
return _IntroPage(intros);
}
return const HomePage();
},
),
);
}
Widget _buildAppContent(BuildContext ctx) {
//if (Pros.app.isWearOS) return const WearHome();
return const _AppContent(
intro: _IntroPage(),
child: HomePage(),
);
}
}
/// It's used for init settings related to [BuildContext]
final class _AppContent extends StatelessWidget {
final Widget child;
final Widget intro;
const _AppContent({required this.child, required this.intro});
@override
Widget build(BuildContext context) {
context.setLibL10n();
final appL10n = AppLocalizations.of(context);
if (appL10n != null) l10n = appL10n;
final showIntro = Stores.setting.showIntro.fetch();
if (showIntro) return intro;
return child;
}
}
void _setup(BuildContext context) async {