// 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 'user.dart'; // ************************************************************************** // FreezedGenerator // ************************************************************************** // dart format off T _$identity(T value) => value; /// @nodoc mixin _$User { int get id; String get phone; String? get nickname; String? get avatar; String? get gender; String? get birthday; /// Create a copy of User /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') $UserCopyWith get copyWith => _$UserCopyWithImpl(this as User, _$identity); /// Serializes this User to a JSON map. Map toJson(); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType&&other is User&&(identical(other.id, id) || other.id == id)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.nickname, nickname) || other.nickname == nickname)&&(identical(other.avatar, avatar) || other.avatar == avatar)&&(identical(other.gender, gender) || other.gender == gender)&&(identical(other.birthday, birthday) || other.birthday == birthday)); } @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType,id,phone,nickname,avatar,gender,birthday); @override String toString() { return 'User(id: $id, phone: $phone, nickname: $nickname, avatar: $avatar, gender: $gender, birthday: $birthday)'; } } /// @nodoc abstract mixin class $UserCopyWith<$Res> { factory $UserCopyWith(User value, $Res Function(User) _then) = _$UserCopyWithImpl; @useResult $Res call({ int id, String phone, String? nickname, String? avatar, String? gender, String? birthday }); } /// @nodoc class _$UserCopyWithImpl<$Res> implements $UserCopyWith<$Res> { _$UserCopyWithImpl(this._self, this._then); final User _self; final $Res Function(User) _then; /// Create a copy of User /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? phone = null,Object? nickname = freezed,Object? avatar = freezed,Object? gender = freezed,Object? birthday = freezed,}) { return _then(_self.copyWith( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as int,phone: null == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable as String,nickname: freezed == nickname ? _self.nickname : nickname // ignore: cast_nullable_to_non_nullable as String?,avatar: freezed == avatar ? _self.avatar : avatar // ignore: cast_nullable_to_non_nullable as String?,gender: freezed == gender ? _self.gender : gender // ignore: cast_nullable_to_non_nullable as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable as String?, )); } } /// Adds pattern-matching-related methods to [User]. extension UserPatterns on User { /// 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 Function( _User value)? $default,{required TResult orElse(),}){ final _that = this; switch (_that) { case _User() 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 Function( _User value) $default,){ final _that = this; switch (_that) { case _User(): 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? Function( _User value)? $default,){ final _that = this; switch (_that) { case _User() 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 Function( int id, String phone, String? nickname, String? avatar, String? gender, String? birthday)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _User() when $default != null: return $default(_that.id,_that.phone,_that.nickname,_that.avatar,_that.gender,_that.birthday);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 Function( int id, String phone, String? nickname, String? avatar, String? gender, String? birthday) $default,) {final _that = this; switch (_that) { case _User(): return $default(_that.id,_that.phone,_that.nickname,_that.avatar,_that.gender,_that.birthday);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? Function( int id, String phone, String? nickname, String? avatar, String? gender, String? birthday)? $default,) {final _that = this; switch (_that) { case _User() when $default != null: return $default(_that.id,_that.phone,_that.nickname,_that.avatar,_that.gender,_that.birthday);case _: return null; } } } /// @nodoc @JsonSerializable() class _User implements User { const _User({required this.id, required this.phone, this.nickname, this.avatar, this.gender, this.birthday}); factory _User.fromJson(Map json) => _$UserFromJson(json); @override final int id; @override final String phone; @override final String? nickname; @override final String? avatar; @override final String? gender; @override final String? birthday; /// Create a copy of User /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') _$UserCopyWith<_User> get copyWith => __$UserCopyWithImpl<_User>(this, _$identity); @override Map toJson() { return _$UserToJson(this, ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType&&other is _User&&(identical(other.id, id) || other.id == id)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.nickname, nickname) || other.nickname == nickname)&&(identical(other.avatar, avatar) || other.avatar == avatar)&&(identical(other.gender, gender) || other.gender == gender)&&(identical(other.birthday, birthday) || other.birthday == birthday)); } @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType,id,phone,nickname,avatar,gender,birthday); @override String toString() { return 'User(id: $id, phone: $phone, nickname: $nickname, avatar: $avatar, gender: $gender, birthday: $birthday)'; } } /// @nodoc abstract mixin class _$UserCopyWith<$Res> implements $UserCopyWith<$Res> { factory _$UserCopyWith(_User value, $Res Function(_User) _then) = __$UserCopyWithImpl; @override @useResult $Res call({ int id, String phone, String? nickname, String? avatar, String? gender, String? birthday }); } /// @nodoc class __$UserCopyWithImpl<$Res> implements _$UserCopyWith<$Res> { __$UserCopyWithImpl(this._self, this._then); final _User _self; final $Res Function(_User) _then; /// Create a copy of User /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? phone = null,Object? nickname = freezed,Object? avatar = freezed,Object? gender = freezed,Object? birthday = freezed,}) { return _then(_User( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as int,phone: null == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable as String,nickname: freezed == nickname ? _self.nickname : nickname // ignore: cast_nullable_to_non_nullable as String?,avatar: freezed == avatar ? _self.avatar : avatar // ignore: cast_nullable_to_non_nullable as String?,gender: freezed == gender ? _self.gender : gender // ignore: cast_nullable_to_non_nullable as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable as String?, )); } } // dart format on