mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: rebuild application when setting the theme or font (#3139)
This commit is contained in:
parent
ef9596f4ab
commit
125bcbc9db
@ -22,7 +22,11 @@ class InitAppWidgetTask extends LaunchTask {
|
|||||||
final widget = context.getIt<EntryPoint>().create(context.config);
|
final widget = context.getIt<EntryPoint>().create(context.config);
|
||||||
final appearanceSetting =
|
final appearanceSetting =
|
||||||
await UserSettingsBackendService().getAppearanceSetting();
|
await UserSettingsBackendService().getAppearanceSetting();
|
||||||
|
|
||||||
|
// If the passed-in context is not the same as the context of the
|
||||||
|
// application widget, the application widget will be rebuilt.
|
||||||
final app = ApplicationWidget(
|
final app = ApplicationWidget(
|
||||||
|
key: ValueKey(context),
|
||||||
appearanceSetting: appearanceSetting,
|
appearanceSetting: appearanceSetting,
|
||||||
child: widget,
|
child: widget,
|
||||||
);
|
);
|
||||||
@ -89,7 +93,6 @@ class ApplicationWidget extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
child: BlocBuilder<AppearanceSettingsCubit, AppearanceSettingsState>(
|
child: BlocBuilder<AppearanceSettingsCubit, AppearanceSettingsState>(
|
||||||
builder: (context, state) => MaterialApp(
|
builder: (context, state) => MaterialApp(
|
||||||
key: UniqueKey(),
|
|
||||||
builder: overlayManagerBuilder(),
|
builder: overlayManagerBuilder(),
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
theme: state.lightTheme,
|
theme: state.lightTheme,
|
||||||
|
Loading…
Reference in New Issue
Block a user