// 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 { String get id; String get phoneNumber; String? get nickname; String? get avatarUrl; /// 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.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)&&(identical(other.nickname, nickname) || other.nickname == nickname)&&(identical(other.avatarUrl, avatarUrl) || other.avatarUrl == avatarUrl)); } @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType,id,phoneNumber,nickname,avatarUrl); @override String toString() { return 'User(id: $id, phoneNumber: $phoneNumber, nickname: $nickname, avatarUrl: $avatarUrl)'; } } /// @nodoc abstract mixin class $UserCopyWith<$Res> { factory $UserCopyWith(User value, $Res Function(User) _then) = _$UserCopyWithImpl; @useResult $Res call({ String id, String phoneNumber, String? nickname, String? avatarUrl }); } /// @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? phoneNumber = null,Object? nickname = freezed,Object? avatarUrl = freezed,}) { return _then(_self.copyWith( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as String,phoneNumber: null == phoneNumber ? _self.phoneNumber : phoneNumber // ignore: cast_nullable_to_non_nullable as String,nickname: freezed == nickname ? _self.nickname : nickname // ignore: cast_nullable_to_non_nullable as String?,avatarUrl: freezed == avatarUrl ? _self.avatarUrl : avatarUrl // 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( String id, String phoneNumber, String? nickname, String? avatarUrl)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _User() when $default != null: return $default(_that.id,_that.phoneNumber,_that.nickname,_that.avatarUrl);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( String id, String phoneNumber, String? nickname, String? avatarUrl) $default,) {final _that = this; switch (_that) { case _User(): return $default(_that.id,_that.phoneNumber,_that.nickname,_that.avatarUrl);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( String id, String phoneNumber, String? nickname, String? avatarUrl)? $default,) {final _that = this; switch (_that) { case _User() when $default != null: return $default(_that.id,_that.phoneNumber,_that.nickname,_that.avatarUrl);case _: return null; } } } /// @nodoc @JsonSerializable() class _User implements User { const _User({required this.id, required this.phoneNumber, this.nickname, this.avatarUrl}); factory _User.fromJson(Map json) => _$UserFromJson(json); @override final String id; @override final String phoneNumber; @override final String? nickname; @override final String? avatarUrl; /// 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.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)&&(identical(other.nickname, nickname) || other.nickname == nickname)&&(identical(other.avatarUrl, avatarUrl) || other.avatarUrl == avatarUrl)); } @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType,id,phoneNumber,nickname,avatarUrl); @override String toString() { return 'User(id: $id, phoneNumber: $phoneNumber, nickname: $nickname, avatarUrl: $avatarUrl)'; } } /// @nodoc abstract mixin class _$UserCopyWith<$Res> implements $UserCopyWith<$Res> { factory _$UserCopyWith(_User value, $Res Function(_User) _then) = __$UserCopyWithImpl; @override @useResult $Res call({ String id, String phoneNumber, String? nickname, String? avatarUrl }); } /// @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? phoneNumber = null,Object? nickname = freezed,Object? avatarUrl = freezed,}) { return _then(_User( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as String,phoneNumber: null == phoneNumber ? _self.phoneNumber : phoneNumber // ignore: cast_nullable_to_non_nullable as String,nickname: freezed == nickname ? _self.nickname : nickname // ignore: cast_nullable_to_non_nullable as String?,avatarUrl: freezed == avatarUrl ? _self.avatarUrl : avatarUrl // ignore: cast_nullable_to_non_nullable as String?, )); } } // dart format on