2021-02-24 21:54:15 +01:00
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
|
|
|
|
part of 'config_store.dart';
|
|
|
|
|
|
|
|
// **************************************************************************
|
|
|
|
// JsonSerializableGenerator
|
|
|
|
// **************************************************************************
|
|
|
|
|
2021-09-13 23:37:08 +02:00
|
|
|
ConfigStore _$ConfigStoreFromJson(Map<String, dynamic> json) => ConfigStore()
|
2021-10-24 23:11:44 +02:00
|
|
|
..theme =
|
|
|
|
$enumDecodeNullable(_$ThemeModeEnumMap, json['theme']) ?? ThemeMode.system
|
2021-09-13 23:37:08 +02:00
|
|
|
..amoledDarkMode = json['amoledDarkMode'] as bool? ?? false
|
2021-10-31 12:52:58 +01:00
|
|
|
..locale = const LocaleConverter().fromJson(json['locale'] as String?)
|
2021-09-13 23:37:08 +02:00
|
|
|
..showAvatars = json['showAvatars'] as bool? ?? true
|
|
|
|
..showScores = json['showScores'] as bool? ?? true
|
|
|
|
..defaultSortType = _sortTypeFromJson(json['defaultSortType'] as String?)
|
|
|
|
..defaultListingType =
|
|
|
|
_postListingTypeFromJson(json['defaultListingType'] as String?);
|
2021-02-24 21:54:15 +01:00
|
|
|
|
|
|
|
Map<String, dynamic> _$ConfigStoreToJson(ConfigStore instance) =>
|
|
|
|
<String, dynamic>{
|
2022-07-15 21:21:02 +02:00
|
|
|
'theme': _$ThemeModeEnumMap[instance.theme]!,
|
2021-02-24 21:54:15 +01:00
|
|
|
'amoledDarkMode': instance.amoledDarkMode,
|
2021-10-31 12:52:58 +01:00
|
|
|
'locale': const LocaleConverter().toJson(instance.locale),
|
2021-04-16 20:15:48 +02:00
|
|
|
'showAvatars': instance.showAvatars,
|
|
|
|
'showScores': instance.showScores,
|
2021-04-16 21:43:02 +02:00
|
|
|
'defaultSortType': instance.defaultSortType,
|
|
|
|
'defaultListingType': instance.defaultListingType,
|
2021-02-24 21:54:15 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
const _$ThemeModeEnumMap = {
|
|
|
|
ThemeMode.system: 'system',
|
|
|
|
ThemeMode.light: 'light',
|
|
|
|
ThemeMode.dark: 'dark',
|
|
|
|
};
|
2021-10-31 12:52:58 +01:00
|
|
|
|
|
|
|
// **************************************************************************
|
|
|
|
// StoreGenerator
|
|
|
|
// **************************************************************************
|
|
|
|
|
2022-07-15 21:21:02 +02:00
|
|
|
// ignore_for_file: non_constant_identifier_names, unnecessary_brace_in_string_interps, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic, no_leading_underscores_for_local_identifiers
|
2021-10-31 12:52:58 +01:00
|
|
|
|
|
|
|
mixin _$ConfigStore on _ConfigStore, Store {
|
2022-04-30 14:56:02 +02:00
|
|
|
late final _$themeAtom = Atom(name: '_ConfigStore.theme', context: context);
|
2021-10-31 12:52:58 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
ThemeMode get theme {
|
|
|
|
_$themeAtom.reportRead();
|
|
|
|
return super.theme;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
set theme(ThemeMode value) {
|
|
|
|
_$themeAtom.reportWrite(value, super.theme, () {
|
|
|
|
super.theme = value;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-04-30 14:56:02 +02:00
|
|
|
late final _$amoledDarkModeAtom =
|
|
|
|
Atom(name: '_ConfigStore.amoledDarkMode', context: context);
|
2021-10-31 12:52:58 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
bool get amoledDarkMode {
|
|
|
|
_$amoledDarkModeAtom.reportRead();
|
|
|
|
return super.amoledDarkMode;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
set amoledDarkMode(bool value) {
|
|
|
|
_$amoledDarkModeAtom.reportWrite(value, super.amoledDarkMode, () {
|
|
|
|
super.amoledDarkMode = value;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-04-30 14:56:02 +02:00
|
|
|
late final _$localeAtom = Atom(name: '_ConfigStore.locale', context: context);
|
2021-10-31 12:52:58 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
Locale get locale {
|
|
|
|
_$localeAtom.reportRead();
|
|
|
|
return super.locale;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
set locale(Locale value) {
|
|
|
|
_$localeAtom.reportWrite(value, super.locale, () {
|
|
|
|
super.locale = value;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-04-30 14:56:02 +02:00
|
|
|
late final _$showAvatarsAtom =
|
|
|
|
Atom(name: '_ConfigStore.showAvatars', context: context);
|
2021-10-31 12:52:58 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
bool get showAvatars {
|
|
|
|
_$showAvatarsAtom.reportRead();
|
|
|
|
return super.showAvatars;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
set showAvatars(bool value) {
|
|
|
|
_$showAvatarsAtom.reportWrite(value, super.showAvatars, () {
|
|
|
|
super.showAvatars = value;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-04-30 14:56:02 +02:00
|
|
|
late final _$showScoresAtom =
|
|
|
|
Atom(name: '_ConfigStore.showScores', context: context);
|
2021-10-31 12:52:58 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
bool get showScores {
|
|
|
|
_$showScoresAtom.reportRead();
|
|
|
|
return super.showScores;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
set showScores(bool value) {
|
|
|
|
_$showScoresAtom.reportWrite(value, super.showScores, () {
|
|
|
|
super.showScores = value;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-04-30 14:56:02 +02:00
|
|
|
late final _$defaultSortTypeAtom =
|
|
|
|
Atom(name: '_ConfigStore.defaultSortType', context: context);
|
2021-10-31 12:52:58 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
SortType get defaultSortType {
|
|
|
|
_$defaultSortTypeAtom.reportRead();
|
|
|
|
return super.defaultSortType;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
set defaultSortType(SortType value) {
|
|
|
|
_$defaultSortTypeAtom.reportWrite(value, super.defaultSortType, () {
|
|
|
|
super.defaultSortType = value;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-04-30 14:56:02 +02:00
|
|
|
late final _$defaultListingTypeAtom =
|
|
|
|
Atom(name: '_ConfigStore.defaultListingType', context: context);
|
2021-10-31 12:52:58 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
PostListingType get defaultListingType {
|
|
|
|
_$defaultListingTypeAtom.reportRead();
|
|
|
|
return super.defaultListingType;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
set defaultListingType(PostListingType value) {
|
|
|
|
_$defaultListingTypeAtom.reportWrite(value, super.defaultListingType, () {
|
|
|
|
super.defaultListingType = value;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-04-30 14:56:02 +02:00
|
|
|
late final _$importLemmyUserSettingsAsyncAction =
|
|
|
|
AsyncAction('_ConfigStore.importLemmyUserSettings', context: context);
|
2021-10-31 12:52:58 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
Future<void> importLemmyUserSettings(Jwt token) {
|
|
|
|
return _$importLemmyUserSettingsAsyncAction
|
|
|
|
.run(() => super.importLemmyUserSettings(token));
|
|
|
|
}
|
|
|
|
|
2022-04-30 14:56:02 +02:00
|
|
|
late final _$_ConfigStoreActionController =
|
|
|
|
ActionController(name: '_ConfigStore', context: context);
|
2021-10-31 12:52:58 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
void copyLemmyUserSettings(LocalUserSettings localUserSettings) {
|
|
|
|
final _$actionInfo = _$_ConfigStoreActionController.startAction(
|
|
|
|
name: '_ConfigStore.copyLemmyUserSettings');
|
|
|
|
try {
|
|
|
|
return super.copyLemmyUserSettings(localUserSettings);
|
|
|
|
} finally {
|
|
|
|
_$_ConfigStoreActionController.endAction(_$actionInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() {
|
|
|
|
return '''
|
|
|
|
theme: ${theme},
|
|
|
|
amoledDarkMode: ${amoledDarkMode},
|
|
|
|
locale: ${locale},
|
|
|
|
showAvatars: ${showAvatars},
|
|
|
|
showScores: ${showScores},
|
|
|
|
defaultSortType: ${defaultSortType},
|
|
|
|
defaultListingType: ${defaultListingType}
|
|
|
|
''';
|
|
|
|
}
|
|
|
|
}
|