Regenerate gen files (#254)

This commit is contained in:
Marcin Wojnarowski 2021-09-13 23:37:08 +02:00 committed by GitHub
parent e2f9c43675
commit 8c69964657
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 143 additions and 40 deletions

View File

@ -6,23 +6,23 @@ part of 'accounts_store.dart';
// JsonSerializableGenerator // JsonSerializableGenerator
// ************************************************************************** // **************************************************************************
AccountsStore _$AccountsStoreFromJson(Map<String, dynamic> json) { AccountsStore _$AccountsStoreFromJson(Map<String, dynamic> json) =>
return AccountsStore() AccountsStore()
..accounts = (json['accounts'] as Map<String, dynamic>?)?.map( ..accounts = (json['accounts'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry( (k, e) => MapEntry(
k, k,
(e as Map<String, dynamic>).map( (e as Map<String, dynamic>).map(
(k, e) => (k, e) =>
MapEntry(k, UserData.fromJson(e as Map<String, dynamic>)), MapEntry(k, UserData.fromJson(e as Map<String, dynamic>)),
)), )),
) ?? ) ??
{'lemmy.ml': {}} {'lemmy.ml': {}}
..defaultAccounts = (json['defaultAccounts'] as Map<String, dynamic>?)?.map( ..defaultAccounts =
(k, e) => MapEntry(k, e as String), (json['defaultAccounts'] as Map<String, dynamic>?)?.map(
) ?? (k, e) => MapEntry(k, e as String),
{} ) ??
..defaultAccount = json['defaultAccount'] as String?; {}
} ..defaultAccount = json['defaultAccount'] as String?;
Map<String, dynamic> _$AccountsStoreToJson(AccountsStore instance) => Map<String, dynamic> _$AccountsStoreToJson(AccountsStore instance) =>
<String, dynamic>{ <String, dynamic>{
@ -31,12 +31,10 @@ Map<String, dynamic> _$AccountsStoreToJson(AccountsStore instance) =>
'defaultAccount': instance.defaultAccount, 'defaultAccount': instance.defaultAccount,
}; };
UserData _$UserDataFromJson(Map<String, dynamic> json) { UserData _$UserDataFromJson(Map<String, dynamic> json) => UserData(
return UserData( jwt: Jwt.fromJson(json['jwt'] as String),
jwt: Jwt.fromJson(json['jwt'] as String), userId: json['userId'] as int,
userId: json['userId'] as int, );
);
}
Map<String, dynamic> _$UserDataToJson(UserData instance) => <String, dynamic>{ Map<String, dynamic> _$UserDataToJson(UserData instance) => <String, dynamic>{
'jwt': instance.jwt, 'jwt': instance.jwt,

View File

@ -6,18 +6,16 @@ part of 'config_store.dart';
// JsonSerializableGenerator // JsonSerializableGenerator
// ************************************************************************** // **************************************************************************
ConfigStore _$ConfigStoreFromJson(Map<String, dynamic> json) { ConfigStore _$ConfigStoreFromJson(Map<String, dynamic> json) => ConfigStore()
return ConfigStore() ..theme = _$enumDecodeNullable(_$ThemeModeEnumMap, json['theme']) ??
..theme = _$enumDecodeNullable(_$ThemeModeEnumMap, json['theme']) ?? ThemeMode.system
ThemeMode.system ..amoledDarkMode = json['amoledDarkMode'] as bool? ?? false
..amoledDarkMode = json['amoledDarkMode'] as bool? ?? false ..locale = LocaleSerde.fromJson(json['locale'] as String?)
..locale = LocaleSerde.fromJson(json['locale'] as String?) ..showAvatars = json['showAvatars'] as bool? ?? true
..showAvatars = json['showAvatars'] as bool? ?? true ..showScores = json['showScores'] as bool? ?? true
..showScores = json['showScores'] as bool? ?? true ..defaultSortType = _sortTypeFromJson(json['defaultSortType'] as String?)
..defaultSortType = _sortTypeFromJson(json['defaultSortType'] as String?) ..defaultListingType =
..defaultListingType = _postListingTypeFromJson(json['defaultListingType'] as String?);
_postListingTypeFromJson(json['defaultListingType'] as String?);
}
Map<String, dynamic> _$ConfigStoreToJson(ConfigStore instance) => Map<String, dynamic> _$ConfigStoreToJson(ConfigStore instance) =>
<String, dynamic>{ <String, dynamic>{

View File

@ -19,10 +19,8 @@ abstract class _AsyncStore<T> with Store {
bool get isLoading => asyncState is AsyncStateLoading; bool get isLoading => asyncState is AsyncStateLoading;
@computed @computed
String? get errorTerm => asyncState.maybeWhen( String? get errorTerm =>
error: (errorTerm) => errorTerm, asyncState.whenOrNull(error: (errorTerm) => errorTerm);
orElse: () => null,
);
/// runs some async action and reflects the progress in [asyncState]. /// runs some async action and reflects the progress in [asyncState].
/// If successful, the result is returned, otherwise null is returned. /// If successful, the result is returned, otherwise null is returned.

View File

@ -1,5 +1,6 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND // GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
part of 'async_store.dart'; part of 'async_store.dart';
@ -51,6 +52,14 @@ mixin _$AsyncState<T> {
}) => }) =>
throw _privateConstructorUsedError; throw _privateConstructorUsedError;
@optionalTypeArgs @optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function(T data)? data,
TResult Function()? loading,
TResult Function(String errorTerm)? error,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({ TResult maybeWhen<TResult extends Object?>({
TResult Function()? initial, TResult Function()? initial,
TResult Function(T data)? data, TResult Function(T data)? data,
@ -68,6 +77,14 @@ mixin _$AsyncState<T> {
}) => }) =>
throw _privateConstructorUsedError; throw _privateConstructorUsedError;
@optionalTypeArgs @optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(AsyncStateInitial<T> value)? initial,
TResult Function(AsyncStateData<T> value)? data,
TResult Function(AsyncStateLoading<T> value)? loading,
TResult Function(AsyncStateError<T> value)? error,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({ TResult maybeMap<TResult extends Object?>({
TResult Function(AsyncStateInitial<T> value)? initial, TResult Function(AsyncStateInitial<T> value)? initial,
TResult Function(AsyncStateData<T> value)? data, TResult Function(AsyncStateData<T> value)? data,
@ -115,6 +132,7 @@ class _$AsyncStateInitialCopyWithImpl<T, $Res>
} }
/// @nodoc /// @nodoc
class _$AsyncStateInitial<T> class _$AsyncStateInitial<T>
with DiagnosticableTreeMixin with DiagnosticableTreeMixin
implements AsyncStateInitial<T> { implements AsyncStateInitial<T> {
@ -150,6 +168,17 @@ class _$AsyncStateInitial<T>
return initial(); return initial();
} }
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function(T data)? data,
TResult Function()? loading,
TResult Function(String errorTerm)? error,
}) {
return initial?.call();
}
@override @override
@optionalTypeArgs @optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({ TResult maybeWhen<TResult extends Object?>({
@ -176,6 +205,17 @@ class _$AsyncStateInitial<T>
return initial(this); return initial(this);
} }
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(AsyncStateInitial<T> value)? initial,
TResult Function(AsyncStateData<T> value)? data,
TResult Function(AsyncStateLoading<T> value)? loading,
TResult Function(AsyncStateError<T> value)? error,
}) {
return initial?.call(this);
}
@override @override
@optionalTypeArgs @optionalTypeArgs
TResult maybeMap<TResult extends Object?>({ TResult maybeMap<TResult extends Object?>({
@ -229,6 +269,7 @@ class _$AsyncStateDataCopyWithImpl<T, $Res>
} }
/// @nodoc /// @nodoc
class _$AsyncStateData<T> class _$AsyncStateData<T>
with DiagnosticableTreeMixin with DiagnosticableTreeMixin
implements AsyncStateData<T> { implements AsyncStateData<T> {
@ -278,6 +319,17 @@ class _$AsyncStateData<T>
return data(this.data); return data(this.data);
} }
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function(T data)? data,
TResult Function()? loading,
TResult Function(String errorTerm)? error,
}) {
return data?.call(this.data);
}
@override @override
@optionalTypeArgs @optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({ TResult maybeWhen<TResult extends Object?>({
@ -304,6 +356,17 @@ class _$AsyncStateData<T>
return data(this); return data(this);
} }
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(AsyncStateInitial<T> value)? initial,
TResult Function(AsyncStateData<T> value)? data,
TResult Function(AsyncStateLoading<T> value)? loading,
TResult Function(AsyncStateError<T> value)? error,
}) {
return data?.call(this);
}
@override @override
@optionalTypeArgs @optionalTypeArgs
TResult maybeMap<TResult extends Object?>({ TResult maybeMap<TResult extends Object?>({
@ -349,6 +412,7 @@ class _$AsyncStateLoadingCopyWithImpl<T, $Res>
} }
/// @nodoc /// @nodoc
class _$AsyncStateLoading<T> class _$AsyncStateLoading<T>
with DiagnosticableTreeMixin with DiagnosticableTreeMixin
implements AsyncStateLoading<T> { implements AsyncStateLoading<T> {
@ -384,6 +448,17 @@ class _$AsyncStateLoading<T>
return loading(); return loading();
} }
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function(T data)? data,
TResult Function()? loading,
TResult Function(String errorTerm)? error,
}) {
return loading?.call();
}
@override @override
@optionalTypeArgs @optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({ TResult maybeWhen<TResult extends Object?>({
@ -410,6 +485,17 @@ class _$AsyncStateLoading<T>
return loading(this); return loading(this);
} }
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(AsyncStateInitial<T> value)? initial,
TResult Function(AsyncStateData<T> value)? data,
TResult Function(AsyncStateLoading<T> value)? loading,
TResult Function(AsyncStateError<T> value)? error,
}) {
return loading?.call(this);
}
@override @override
@optionalTypeArgs @optionalTypeArgs
TResult maybeMap<TResult extends Object?>({ TResult maybeMap<TResult extends Object?>({
@ -463,6 +549,7 @@ class _$AsyncStateErrorCopyWithImpl<T, $Res>
} }
/// @nodoc /// @nodoc
class _$AsyncStateError<T> class _$AsyncStateError<T>
with DiagnosticableTreeMixin with DiagnosticableTreeMixin
implements AsyncStateError<T> { implements AsyncStateError<T> {
@ -513,6 +600,17 @@ class _$AsyncStateError<T>
return error(errorTerm); return error(errorTerm);
} }
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function(T data)? data,
TResult Function()? loading,
TResult Function(String errorTerm)? error,
}) {
return error?.call(errorTerm);
}
@override @override
@optionalTypeArgs @optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({ TResult maybeWhen<TResult extends Object?>({
@ -539,6 +637,17 @@ class _$AsyncStateError<T>
return error(this); return error(this);
} }
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(AsyncStateInitial<T> value)? initial,
TResult Function(AsyncStateData<T> value)? data,
TResult Function(AsyncStateLoading<T> value)? loading,
TResult Function(AsyncStateError<T> value)? error,
}) {
return error?.call(this);
}
@override @override
@optionalTypeArgs @optionalTypeArgs
TResult maybeMap<TResult extends Object?>({ TResult maybeMap<TResult extends Object?>({