implemented new loadable state concept
This commit is contained in:
@ -0,0 +1,158 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// 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, unnecessary_question_mark
|
||||
|
||||
part of 'loadable_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$LoadableState<TState> {
|
||||
bool get isLoading => throw _privateConstructorUsedError;
|
||||
TState? get data => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
$LoadableStateCopyWith<TState, LoadableState<TState>> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $LoadableStateCopyWith<TState, $Res> {
|
||||
factory $LoadableStateCopyWith(LoadableState<TState> value,
|
||||
$Res Function(LoadableState<TState>) then) =
|
||||
_$LoadableStateCopyWithImpl<TState, $Res, LoadableState<TState>>;
|
||||
@useResult
|
||||
$Res call({bool isLoading, TState? data});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$LoadableStateCopyWithImpl<TState, $Res,
|
||||
$Val extends LoadableState<TState>>
|
||||
implements $LoadableStateCopyWith<TState, $Res> {
|
||||
_$LoadableStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? isLoading = null,
|
||||
Object? data = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
data: freezed == data
|
||||
? _value.data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as TState?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$LoadableStateImplCopyWith<TState, $Res>
|
||||
implements $LoadableStateCopyWith<TState, $Res> {
|
||||
factory _$$LoadableStateImplCopyWith(_$LoadableStateImpl<TState> value,
|
||||
$Res Function(_$LoadableStateImpl<TState>) then) =
|
||||
__$$LoadableStateImplCopyWithImpl<TState, $Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({bool isLoading, TState? data});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$LoadableStateImplCopyWithImpl<TState, $Res>
|
||||
extends _$LoadableStateCopyWithImpl<TState, $Res,
|
||||
_$LoadableStateImpl<TState>>
|
||||
implements _$$LoadableStateImplCopyWith<TState, $Res> {
|
||||
__$$LoadableStateImplCopyWithImpl(_$LoadableStateImpl<TState> _value,
|
||||
$Res Function(_$LoadableStateImpl<TState>) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? isLoading = null,
|
||||
Object? data = freezed,
|
||||
}) {
|
||||
return _then(_$LoadableStateImpl<TState>(
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
data: freezed == data
|
||||
? _value.data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as TState?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$LoadableStateImpl<TState> extends _LoadableState<TState> {
|
||||
const _$LoadableStateImpl({this.isLoading = true, this.data = null})
|
||||
: super._();
|
||||
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool isLoading;
|
||||
@override
|
||||
@JsonKey()
|
||||
final TState? data;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadableState<$TState>(isLoading: $isLoading, data: $data)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$LoadableStateImpl<TState> &&
|
||||
(identical(other.isLoading, isLoading) ||
|
||||
other.isLoading == isLoading) &&
|
||||
const DeepCollectionEquality().equals(other.data, data));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, isLoading, const DeepCollectionEquality().hash(data));
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$LoadableStateImplCopyWith<TState, _$LoadableStateImpl<TState>>
|
||||
get copyWith => __$$LoadableStateImplCopyWithImpl<TState,
|
||||
_$LoadableStateImpl<TState>>(this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _LoadableState<TState> extends LoadableState<TState> {
|
||||
const factory _LoadableState({final bool isLoading, final TState? data}) =
|
||||
_$LoadableStateImpl<TState>;
|
||||
const _LoadableState._() : super._();
|
||||
|
||||
@override
|
||||
bool get isLoading;
|
||||
@override
|
||||
TState? get data;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$LoadableStateImplCopyWith<TState, _$LoadableStateImpl<TState>>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
Reference in New Issue
Block a user