feat: add region and terms to intro
This commit is contained in:
@@ -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 =
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user