diff --git a/lib/stores/config_store.g.dart b/lib/stores/config_store.g.dart index 1f82534..63510ea 100644 --- a/lib/stores/config_store.g.dart +++ b/lib/stores/config_store.g.dart @@ -7,8 +7,8 @@ part of 'config_store.dart'; // ************************************************************************** ConfigStore _$ConfigStoreFromJson(Map json) => ConfigStore() - ..theme = _$enumDecodeNullable(_$ThemeModeEnumMap, json['theme']) ?? - ThemeMode.system + ..theme = + $enumDecodeNullable(_$ThemeModeEnumMap, json['theme']) ?? ThemeMode.system ..amoledDarkMode = json['amoledDarkMode'] as bool? ?? false ..locale = LocaleSerde.fromJson(json['locale'] as String?) ..showAvatars = json['showAvatars'] as bool? ?? true @@ -28,43 +28,6 @@ Map _$ConfigStoreToJson(ConfigStore instance) => 'defaultListingType': instance.defaultListingType, }; -K _$enumDecode( - Map enumValues, - Object? source, { - K? unknownValue, -}) { - if (source == null) { - throw ArgumentError( - 'A value must be provided. Supported values: ' - '${enumValues.values.join(', ')}', - ); - } - - return enumValues.entries.singleWhere( - (e) => e.value == source, - orElse: () { - if (unknownValue == null) { - throw ArgumentError( - '`$source` is not one of the supported values: ' - '${enumValues.values.join(', ')}', - ); - } - return MapEntry(unknownValue, enumValues.values.first); - }, - ).key; -} - -K? _$enumDecodeNullable( - Map enumValues, - dynamic source, { - K? unknownValue, -}) { - if (source == null) { - return null; - } - return _$enumDecode(enumValues, source, unknownValue: unknownValue); -} - const _$ThemeModeEnumMap = { ThemeMode.system: 'system', ThemeMode.light: 'light', diff --git a/lib/widgets/comment/comment_store.g.dart b/lib/widgets/comment/comment_store.g.dart index 371a9b4..ecaf626 100644 --- a/lib/widgets/comment/comment_store.g.dart +++ b/lib/widgets/comment/comment_store.g.dart @@ -88,6 +88,13 @@ mixin _$CommentStore on _CommentStore, Store { }); } + final _$reportAsyncAction = AsyncAction('_CommentStore.report'); + + @override + Future report(Jwt token, String reason) { + return _$reportAsyncAction.run(() => super.report(token, reason)); + } + final _$deleteAsyncAction = AsyncAction('_CommentStore.delete'); @override diff --git a/lib/widgets/post/post_store.g.dart b/lib/widgets/post/post_store.g.dart index f17f89f..583c01e 100644 --- a/lib/widgets/post/post_store.g.dart +++ b/lib/widgets/post/post_store.g.dart @@ -45,6 +45,13 @@ mixin _$PostStore on _PostStore, Store { return _$saveAsyncAction.run(() => super.save(token)); } + final _$reportAsyncAction = AsyncAction('_PostStore.report'); + + @override + Future report(Jwt token, String reason) { + return _$reportAsyncAction.run(() => super.report(token, reason)); + } + final _$blockUserAsyncAction = AsyncAction('_PostStore.blockUser'); @override diff --git a/pubspec.yaml b/pubspec.yaml index d265423..92eb9c0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: lemmy_api_client: ^0.17.0 intl: ^0.17.0 matrix4_transform: ^2.0.0 - json_annotation: ^4.1.0 + json_annotation: ^4.3.0 keyboard_dismisser: ^2.0.0 freezed_annotation: ^0.15.0 logging: ^1.0.1