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