mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: dropdown state unchanging after file reset (#2109)
This commit is contained in:
parent
c73b7d1184
commit
d62493ce01
@ -55,9 +55,9 @@ class AppearanceSettingsCubit extends Cubit<AppearanceSettingsState> {
|
||||
newLocale = const Locale('en');
|
||||
}
|
||||
|
||||
context.setLocale(newLocale);
|
||||
|
||||
if (state.locale != newLocale) {
|
||||
context.setLocale(newLocale);
|
||||
|
||||
_setting.locale.languageCode = newLocale.languageCode;
|
||||
_setting.locale.countryCode = newLocale.countryCode ?? "";
|
||||
_saveAppearanceSettings();
|
||||
|
@ -54,8 +54,8 @@ class _LanguageSelectorDropdownState extends State<LanguageSelectorDropdown> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MouseRegion(
|
||||
onEnter: (event) => {hoverEnterLanguage()},
|
||||
onExit: (event) => {hoverExitLanguage()},
|
||||
onEnter: (_) => hoverEnterLanguage(),
|
||||
onExit: (_) => hoverExitLanguage(),
|
||||
child: Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
@ -67,12 +67,10 @@ class _LanguageSelectorDropdownState extends State<LanguageSelectorDropdown> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6),
|
||||
child: DropdownButton<Locale>(
|
||||
value: context.locale,
|
||||
onChanged: (val) {
|
||||
setState(() {
|
||||
context
|
||||
.read<AppearanceSettingsCubit>()
|
||||
.setLocale(context, val!);
|
||||
});
|
||||
onChanged: (locale) {
|
||||
context
|
||||
.read<AppearanceSettingsCubit>()
|
||||
.setLocale(context, locale!);
|
||||
},
|
||||
autofocus: true,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
|
Loading…
Reference in New Issue
Block a user