// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// 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 '../../../../../presentation/screens/receipt/bloc/receipt_state.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$ReceiptState {
bool get isLoading; AppError get error;
/// Create a copy of ReceiptState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ReceiptStateCopyWith<ReceiptState> get copyWith => _$ReceiptStateCopyWithImpl<ReceiptState>(this as ReceiptState, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ReceiptState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.error, error) || other.error == error));
}
@override
int get hashCode => Object.hash(runtimeType,isLoading,error);
@override
String toString() {
return 'ReceiptState(isLoading: $isLoading, error: $error)';
}
}
/// @nodoc
abstract mixin class $ReceiptStateCopyWith<$Res> {
factory $ReceiptStateCopyWith(ReceiptState value, $Res Function(ReceiptState) _then) = _$ReceiptStateCopyWithImpl;
@useResult
$Res call({
bool isLoading, AppError error
});
}
/// @nodoc
class _$ReceiptStateCopyWithImpl<$Res>
implements $ReceiptStateCopyWith<$Res> {
_$ReceiptStateCopyWithImpl(this._self, this._then);
final ReceiptState _self;
final $Res Function(ReceiptState) _then;
/// Create a copy of ReceiptState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? error = null,}) {
return _then(_self.copyWith(
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
as AppError,
));
}
}
/// Adds pattern-matching-related methods to [ReceiptState].
extension ReceiptStatePatterns on ReceiptState {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _ReceiptState value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ReceiptState() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _ReceiptState value) $default,){
final _that = this;
switch (_that) {
case _ReceiptState():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _ReceiptState value)? $default,){
final _that = this;
switch (_that) {
case _ReceiptState() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, AppError error)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ReceiptState() when $default != null:
return $default(_that.isLoading,_that.error);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, AppError error) $default,) {final _that = this;
switch (_that) {
case _ReceiptState():
return $default(_that.isLoading,_that.error);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, AppError error)? $default,) {final _that = this;
switch (_that) {
case _ReceiptState() when $default != null:
return $default(_that.isLoading,_that.error);case _:
return null;
}
}
}
/// @nodoc
class _ReceiptState implements ReceiptState {
const _ReceiptState({this.isLoading = false, this.error = AppError.none});
@override@JsonKey() final bool isLoading;
@override@JsonKey() final AppError error;
/// Create a copy of ReceiptState
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ReceiptStateCopyWith<_ReceiptState> get copyWith => __$ReceiptStateCopyWithImpl<_ReceiptState>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ReceiptState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.error, error) || other.error == error));
}
@override
int get hashCode => Object.hash(runtimeType,isLoading,error);
@override
String toString() {
return 'ReceiptState(isLoading: $isLoading, error: $error)';
}
}
/// @nodoc
abstract mixin class _$ReceiptStateCopyWith<$Res> implements $ReceiptStateCopyWith<$Res> {
factory _$ReceiptStateCopyWith(_ReceiptState value, $Res Function(_ReceiptState) _then) = __$ReceiptStateCopyWithImpl;
@override @useResult
$Res call({
bool isLoading, AppError error
});
}
/// @nodoc
class __$ReceiptStateCopyWithImpl<$Res>
implements _$ReceiptStateCopyWith<$Res> {
__$ReceiptStateCopyWithImpl(this._self, this._then);
final _ReceiptState _self;
final $Res Function(_ReceiptState) _then;
/// Create a copy of ReceiptState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? error = null,}) {
return _then(_ReceiptState(
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
as AppError,
));
}
}
// dart format on