feat: add region and terms to intro

This commit is contained in:
problematicconsumer
2023-09-17 14:55:46 +03:30
parent e6eab038ce
commit bb2e1a2625
8 changed files with 123 additions and 4 deletions

View File

@@ -24,6 +24,25 @@ class IntroCompleted extends _$IntroCompleted {
}
}
@Riverpod(keepAlive: true)
class RegionNotifier extends _$RegionNotifier {
late final _pref = Pref(
ref.watch(sharedPreferencesProvider),
"region",
Region.other,
mapFrom: Region.values.byName,
mapTo: (value) => value.name,
);
@override
Region build() => _pref.getValue();
Future<void> update(Region value) {
state = value;
return _pref.update(value);
}
}
@Riverpod(keepAlive: true)
class SilentStartNotifier extends _$SilentStartNotifier {
late final _pref =

View File

@@ -13,7 +13,7 @@ class LocaleNotifier extends _$LocaleNotifier {
late final _pref = Pref(
ref.watch(sharedPreferencesProvider),
"locale",
AppLocale.en,
AppLocaleUtils.findDeviceLocale(),
mapFrom: AppLocale.values.byName,
mapTo: (value) => value.name,
);