Skip to content

Instantly share code, notes, and snippets.

@Hari-07
Created June 17, 2022 12:20
Show Gist options
  • Save Hari-07/11d5ce80eae042663a792877ba6b9d28 to your computer and use it in GitHub Desktop.
Save Hari-07/11d5ce80eae042663a792877ba6b9d28 to your computer and use it in GitHub Desktop.
Person Class freezed file
// 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
part of 'person.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#custom-getters-and-methods');
/// @nodoc
mixin _$Person {
String? get firstName => throw _privateConstructorUsedError;
String? get lastName => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$PersonCopyWith<Person> get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $PersonCopyWith<$Res> {
factory $PersonCopyWith(Person value, $Res Function(Person) then) =
_$PersonCopyWithImpl<$Res>;
$Res call({String? firstName, String? lastName});
}
/// @nodoc
class _$PersonCopyWithImpl<$Res> implements $PersonCopyWith<$Res> {
_$PersonCopyWithImpl(this._value, this._then);
final Person _value;
// ignore: unused_field
final $Res Function(Person) _then;
@override
$Res call({
Object? firstName = freezed,
Object? lastName = freezed,
}) {
return _then(_value.copyWith(
firstName: firstName == freezed
? _value.firstName
: firstName // ignore: cast_nullable_to_non_nullable
as String?,
lastName: lastName == freezed
? _value.lastName
: lastName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
abstract class _$$_PersonCopyWith<$Res> implements $PersonCopyWith<$Res> {
factory _$$_PersonCopyWith(_$_Person value, $Res Function(_$_Person) then) =
__$$_PersonCopyWithImpl<$Res>;
@override
$Res call({String? firstName, String? lastName});
}
/// @nodoc
class __$$_PersonCopyWithImpl<$Res> extends _$PersonCopyWithImpl<$Res>
implements _$$_PersonCopyWith<$Res> {
__$$_PersonCopyWithImpl(_$_Person _value, $Res Function(_$_Person) _then)
: super(_value, (v) => _then(v as _$_Person));
@override
_$_Person get _value => super._value as _$_Person;
@override
$Res call({
Object? firstName = freezed,
Object? lastName = freezed,
}) {
return _then(_$_Person(
firstName: firstName == freezed
? _value.firstName
: firstName // ignore: cast_nullable_to_non_nullable
as String?,
lastName: lastName == freezed
? _value.lastName
: lastName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
class _$_Person implements _Person {
const _$_Person({required this.firstName, required this.lastName});
@override
final String? firstName;
@override
final String? lastName;
@override
String toString() {
return 'Person(firstName: $firstName, lastName: $lastName)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$_Person &&
const DeepCollectionEquality().equals(other.firstName, firstName) &&
const DeepCollectionEquality().equals(other.lastName, lastName));
}
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(firstName),
const DeepCollectionEquality().hash(lastName));
@JsonKey(ignore: true)
@override
_$$_PersonCopyWith<_$_Person> get copyWith =>
__$$_PersonCopyWithImpl<_$_Person>(this, _$identity);
}
abstract class _Person implements Person {
const factory _Person(
{required final String? firstName,
required final String? lastName}) = _$_Person;
@override
String? get firstName => throw _privateConstructorUsedError;
@override
String? get lastName => throw _privateConstructorUsedError;
@override
@JsonKey(ignore: true)
_$$_PersonCopyWith<_$_Person> get copyWith =>
throw _privateConstructorUsedError;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment