mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-04-24 22:57:12 -04:00
Added language to be observed to application widget
This commit is contained in:
parent
214946cbbc
commit
835a64ca75
1 changed files with 5 additions and 1 deletions
|
@ -2,6 +2,7 @@ import 'package:app_flowy/startup/startup.dart';
|
||||||
import 'package:app_flowy/user/infrastructure/repos/user_setting_repo.dart';
|
import 'package:app_flowy/user/infrastructure/repos/user_setting_repo.dart';
|
||||||
import 'package:app_flowy/workspace/application/appearance.dart';
|
import 'package:app_flowy/workspace/application/appearance.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:flowy_infra/language.dart';
|
||||||
import 'package:flowy_infra/theme.dart';
|
import 'package:flowy_infra/theme.dart';
|
||||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -61,6 +62,9 @@ class ApplicationWidget extends StatelessWidget {
|
||||||
AppTheme theme = context.select<AppearanceSettingModel, AppTheme>(
|
AppTheme theme = context.select<AppearanceSettingModel, AppTheme>(
|
||||||
(value) => value.theme,
|
(value) => value.theme,
|
||||||
);
|
);
|
||||||
|
AppLanguage language = context.select<AppearanceSettingModel, AppLanguage>(
|
||||||
|
(value) => value.language,
|
||||||
|
);
|
||||||
|
|
||||||
return Provider.value(
|
return Provider.value(
|
||||||
value: theme,
|
value: theme,
|
||||||
|
@ -70,7 +74,7 @@ class ApplicationWidget extends StatelessWidget {
|
||||||
theme: theme.themeData,
|
theme: theme.themeData,
|
||||||
localizationsDelegates: context.localizationDelegates,
|
localizationsDelegates: context.localizationDelegates,
|
||||||
supportedLocales: context.supportedLocales,
|
supportedLocales: context.supportedLocales,
|
||||||
locale: context.locale,
|
locale: localeFromLanguageName(language),
|
||||||
navigatorKey: AppGlobals.rootNavKey,
|
navigatorKey: AppGlobals.rootNavKey,
|
||||||
home: child,
|
home: child,
|
||||||
),
|
),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue