Fix translation code gen

This commit is contained in:
problematicconsumer
2023-09-07 14:20:31 +03:30
parent 854b522d97
commit 475357620d
2 changed files with 8 additions and 3 deletions

View File

@@ -10,8 +10,13 @@ part 'locale_prefs.g.dart';
@Riverpod(keepAlive: true)
class LocaleNotifier extends _$LocaleNotifier {
late final _pref =
Pref(ref.watch(sharedPreferencesProvider), "locale", AppLocale.en);
late final _pref = Pref(
ref.watch(sharedPreferencesProvider),
"locale",
AppLocale.en,
mapFrom: AppLocale.values.byName,
mapTo: (value) => value.name,
);
@override
AppLocale build() => _pref.getValue();