moved reload actions out of error context

This commit is contained in:
2024-05-11 17:52:53 +02:00
parent 9fa711e460
commit 181682a424
14 changed files with 129 additions and 93 deletions

View File

@ -17,8 +17,7 @@ final _privateConstructorUsedError = UnsupportedError(
/// @nodoc
mixin _$LoadingError {
String get message => throw _privateConstructorUsedError;
bool get enableRetry => throw _privateConstructorUsedError;
void Function()? get retry => throw _privateConstructorUsedError;
bool get allowRetry => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$LoadingErrorCopyWith<LoadingError> get copyWith =>
@ -31,7 +30,7 @@ abstract class $LoadingErrorCopyWith<$Res> {
LoadingError value, $Res Function(LoadingError) then) =
_$LoadingErrorCopyWithImpl<$Res, LoadingError>;
@useResult
$Res call({String message, bool enableRetry, void Function()? retry});
$Res call({String message, bool allowRetry});
}
/// @nodoc
@ -48,22 +47,17 @@ class _$LoadingErrorCopyWithImpl<$Res, $Val extends LoadingError>
@override
$Res call({
Object? message = null,
Object? enableRetry = null,
Object? retry = freezed,
Object? allowRetry = null,
}) {
return _then(_value.copyWith(
message: null == message
? _value.message
: message // ignore: cast_nullable_to_non_nullable
as String,
enableRetry: null == enableRetry
? _value.enableRetry
: enableRetry // ignore: cast_nullable_to_non_nullable
allowRetry: null == allowRetry
? _value.allowRetry
: allowRetry // ignore: cast_nullable_to_non_nullable
as bool,
retry: freezed == retry
? _value.retry
: retry // ignore: cast_nullable_to_non_nullable
as void Function()?,
) as $Val);
}
}
@ -76,7 +70,7 @@ abstract class _$$LoadingErrorImplCopyWith<$Res>
__$$LoadingErrorImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String message, bool enableRetry, void Function()? retry});
$Res call({String message, bool allowRetry});
}
/// @nodoc
@ -91,22 +85,17 @@ class __$$LoadingErrorImplCopyWithImpl<$Res>
@override
$Res call({
Object? message = null,
Object? enableRetry = null,
Object? retry = freezed,
Object? allowRetry = null,
}) {
return _then(_$LoadingErrorImpl(
message: null == message
? _value.message
: message // ignore: cast_nullable_to_non_nullable
as String,
enableRetry: null == enableRetry
? _value.enableRetry
: enableRetry // ignore: cast_nullable_to_non_nullable
allowRetry: null == allowRetry
? _value.allowRetry
: allowRetry // ignore: cast_nullable_to_non_nullable
as bool,
retry: freezed == retry
? _value.retry
: retry // ignore: cast_nullable_to_non_nullable
as void Function()?,
));
}
}
@ -114,21 +103,17 @@ class __$$LoadingErrorImplCopyWithImpl<$Res>
/// @nodoc
class _$LoadingErrorImpl implements _LoadingError {
const _$LoadingErrorImpl(
{required this.message, this.enableRetry = false, this.retry = null});
const _$LoadingErrorImpl({required this.message, this.allowRetry = false});
@override
final String message;
@override
@JsonKey()
final bool enableRetry;
@override
@JsonKey()
final void Function()? retry;
final bool allowRetry;
@override
String toString() {
return 'LoadingError(message: $message, enableRetry: $enableRetry, retry: $retry)';
return 'LoadingError(message: $message, allowRetry: $allowRetry)';
}
@override
@ -137,13 +122,12 @@ class _$LoadingErrorImpl implements _LoadingError {
(other.runtimeType == runtimeType &&
other is _$LoadingErrorImpl &&
(identical(other.message, message) || other.message == message) &&
(identical(other.enableRetry, enableRetry) ||
other.enableRetry == enableRetry) &&
(identical(other.retry, retry) || other.retry == retry));
(identical(other.allowRetry, allowRetry) ||
other.allowRetry == allowRetry));
}
@override
int get hashCode => Object.hash(runtimeType, message, enableRetry, retry);
int get hashCode => Object.hash(runtimeType, message, allowRetry);
@JsonKey(ignore: true)
@override
@ -155,15 +139,12 @@ class _$LoadingErrorImpl implements _LoadingError {
abstract class _LoadingError implements LoadingError {
const factory _LoadingError(
{required final String message,
final bool enableRetry,
final void Function()? retry}) = _$LoadingErrorImpl;
final bool allowRetry}) = _$LoadingErrorImpl;
@override
String get message;
@override
bool get enableRetry;
@override
void Function()? get retry;
bool get allowRetry;
@override
@JsonKey(ignore: true)
_$$LoadingErrorImplCopyWith<_$LoadingErrorImpl> get copyWith =>