diff --git a/packages/stream_chat/build.yaml b/packages/stream_chat/build.yaml index d439bddb6..270b31209 100644 --- a/packages/stream_chat/build.yaml +++ b/packages/stream_chat/build.yaml @@ -4,4 +4,8 @@ targets: json_serializable: options: explicit_to_json: true - field_rename: snake \ No newline at end of file + field_rename: snake + freezed: + options: + map: false + when: false \ No newline at end of file diff --git a/packages/stream_chat/lib/src/core/models/attachment_file.freezed.dart b/packages/stream_chat/lib/src/core/models/attachment_file.freezed.dart index 54f797609..20401e945 100644 --- a/packages/stream_chat/lib/src/core/models/attachment_file.freezed.dart +++ b/packages/stream_chat/lib/src/core/models/attachment_file.freezed.dart @@ -1,3 +1,4 @@ +// dart format width=80 // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint @@ -9,11 +10,8 @@ part of 'attachment_file.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(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#adding-getters-and-methods-to-our-models'); - UploadState _$UploadStateFromJson(Map json) { switch (json['runtimeType']) { case 'preparing': @@ -33,123 +31,53 @@ UploadState _$UploadStateFromJson(Map json) { /// @nodoc mixin _$UploadState { - @optionalTypeArgs - TResult when({ - required TResult Function() preparing, - required TResult Function(int uploaded, int total) inProgress, - required TResult Function() success, - required TResult Function(String error) failed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? preparing, - TResult? Function(int uploaded, int total)? inProgress, - TResult? Function()? success, - TResult? Function(String error)? failed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? preparing, - TResult Function(int uploaded, int total)? inProgress, - TResult Function()? success, - TResult Function(String error)? failed, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(Preparing value) preparing, - required TResult Function(InProgress value) inProgress, - required TResult Function(Success value) success, - required TResult Function(Failed value) failed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Preparing value)? preparing, - TResult? Function(InProgress value)? inProgress, - TResult? Function(Success value)? success, - TResult? Function(Failed value)? failed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Preparing value)? preparing, - TResult Function(InProgress value)? inProgress, - TResult Function(Success value)? success, - TResult Function(Failed value)? failed, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - /// Serializes this UploadState to a JSON map. - Map toJson() => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $UploadStateCopyWith<$Res> { - factory $UploadStateCopyWith( - UploadState value, $Res Function(UploadState) then) = - _$UploadStateCopyWithImpl<$Res, UploadState>; -} - -/// @nodoc -class _$UploadStateCopyWithImpl<$Res, $Val extends UploadState> - implements $UploadStateCopyWith<$Res> { - _$UploadStateCopyWithImpl(this._value, this._then); + Map toJson(); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is UploadState); + } - /// Create a copy of UploadState - /// with the given fields replaced by the non-null parameter values. -} + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => runtimeType.hashCode; -/// @nodoc -abstract class _$$PreparingImplCopyWith<$Res> { - factory _$$PreparingImplCopyWith( - _$PreparingImpl value, $Res Function(_$PreparingImpl) then) = - __$$PreparingImplCopyWithImpl<$Res>; + @override + String toString() { + return 'UploadState()'; + } } /// @nodoc -class __$$PreparingImplCopyWithImpl<$Res> - extends _$UploadStateCopyWithImpl<$Res, _$PreparingImpl> - implements _$$PreparingImplCopyWith<$Res> { - __$$PreparingImplCopyWithImpl( - _$PreparingImpl _value, $Res Function(_$PreparingImpl) _then) - : super(_value, _then); - - /// Create a copy of UploadState - /// with the given fields replaced by the non-null parameter values. +class $UploadStateCopyWith<$Res> { + $UploadStateCopyWith(UploadState _, $Res Function(UploadState) __); } /// @nodoc @JsonSerializable() -class _$PreparingImpl extends Preparing { - const _$PreparingImpl({final String? $type}) +class Preparing extends UploadState { + const Preparing({final String? $type}) : $type = $type ?? 'preparing', super._(); - - factory _$PreparingImpl.fromJson(Map json) => - _$$PreparingImplFromJson(json); + factory Preparing.fromJson(Map json) => + _$PreparingFromJson(json); @JsonKey(name: 'runtimeType') final String $type; @override - String toString() { - return 'UploadState.preparing()'; + Map toJson() { + return _$PreparingToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$PreparingImpl); + (other.runtimeType == runtimeType && other is Preparing); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -157,127 +85,92 @@ class _$PreparingImpl extends Preparing { int get hashCode => runtimeType.hashCode; @override - @optionalTypeArgs - TResult when({ - required TResult Function() preparing, - required TResult Function(int uploaded, int total) inProgress, - required TResult Function() success, - required TResult Function(String error) failed, - }) { - return preparing(); + String toString() { + return 'UploadState.preparing()'; } +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? preparing, - TResult? Function(int uploaded, int total)? inProgress, - TResult? Function()? success, - TResult? Function(String error)? failed, - }) { - return preparing?.call(); - } +/// @nodoc +@JsonSerializable() +class InProgress extends UploadState { + const InProgress( + {required this.uploaded, required this.total, final String? $type}) + : $type = $type ?? 'inProgress', + super._(); + factory InProgress.fromJson(Map json) => + _$InProgressFromJson(json); - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? preparing, - TResult Function(int uploaded, int total)? inProgress, - TResult Function()? success, - TResult Function(String error)? failed, - required TResult orElse(), - }) { - if (preparing != null) { - return preparing(); - } - return orElse(); - } + final int uploaded; + final int total; + + @JsonKey(name: 'runtimeType') + final String $type; + + /// Create a copy of UploadState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $InProgressCopyWith get copyWith => + _$InProgressCopyWithImpl(this, _$identity); @override - @optionalTypeArgs - TResult map({ - required TResult Function(Preparing value) preparing, - required TResult Function(InProgress value) inProgress, - required TResult Function(Success value) success, - required TResult Function(Failed value) failed, - }) { - return preparing(this); + Map toJson() { + return _$InProgressToJson( + this, + ); } @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Preparing value)? preparing, - TResult? Function(InProgress value)? inProgress, - TResult? Function(Success value)? success, - TResult? Function(Failed value)? failed, - }) { - return preparing?.call(this); + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is InProgress && + (identical(other.uploaded, uploaded) || + other.uploaded == uploaded) && + (identical(other.total, total) || other.total == total)); } + @JsonKey(includeFromJson: false, includeToJson: false) @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Preparing value)? preparing, - TResult Function(InProgress value)? inProgress, - TResult Function(Success value)? success, - TResult Function(Failed value)? failed, - required TResult orElse(), - }) { - if (preparing != null) { - return preparing(this); - } - return orElse(); - } + int get hashCode => Object.hash(runtimeType, uploaded, total); @override - Map toJson() { - return _$$PreparingImplToJson( - this, - ); + String toString() { + return 'UploadState.inProgress(uploaded: $uploaded, total: $total)'; } } -abstract class Preparing extends UploadState { - const factory Preparing() = _$PreparingImpl; - const Preparing._() : super._(); - - factory Preparing.fromJson(Map json) = - _$PreparingImpl.fromJson; -} - /// @nodoc -abstract class _$$InProgressImplCopyWith<$Res> { - factory _$$InProgressImplCopyWith( - _$InProgressImpl value, $Res Function(_$InProgressImpl) then) = - __$$InProgressImplCopyWithImpl<$Res>; +abstract mixin class $InProgressCopyWith<$Res> + implements $UploadStateCopyWith<$Res> { + factory $InProgressCopyWith( + InProgress value, $Res Function(InProgress) _then) = + _$InProgressCopyWithImpl; @useResult $Res call({int uploaded, int total}); } /// @nodoc -class __$$InProgressImplCopyWithImpl<$Res> - extends _$UploadStateCopyWithImpl<$Res, _$InProgressImpl> - implements _$$InProgressImplCopyWith<$Res> { - __$$InProgressImplCopyWithImpl( - _$InProgressImpl _value, $Res Function(_$InProgressImpl) _then) - : super(_value, _then); +class _$InProgressCopyWithImpl<$Res> implements $InProgressCopyWith<$Res> { + _$InProgressCopyWithImpl(this._self, this._then); + + final InProgress _self; + final $Res Function(InProgress) _then; /// Create a copy of UploadState /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ Object? uploaded = null, Object? total = null, }) { - return _then(_$InProgressImpl( + return _then(InProgress( uploaded: null == uploaded - ? _value.uploaded + ? _self.uploaded : uploaded // ignore: cast_nullable_to_non_nullable as int, total: null == total - ? _value.total + ? _self.total : total // ignore: cast_nullable_to_non_nullable as int, )); @@ -286,454 +179,113 @@ class __$$InProgressImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$InProgressImpl extends InProgress { - const _$InProgressImpl( - {required this.uploaded, required this.total, final String? $type}) - : $type = $type ?? 'inProgress', +class Success extends UploadState { + const Success({final String? $type}) + : $type = $type ?? 'success', super._(); - - factory _$InProgressImpl.fromJson(Map json) => - _$$InProgressImplFromJson(json); - - @override - final int uploaded; - @override - final int total; + factory Success.fromJson(Map json) => + _$SuccessFromJson(json); @JsonKey(name: 'runtimeType') final String $type; @override - String toString() { - return 'UploadState.inProgress(uploaded: $uploaded, total: $total)'; + Map toJson() { + return _$SuccessToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$InProgressImpl && - (identical(other.uploaded, uploaded) || - other.uploaded == uploaded) && - (identical(other.total, total) || other.total == total)); + (other.runtimeType == runtimeType && other is Success); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, uploaded, total); - - /// Create a copy of UploadState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$InProgressImplCopyWith<_$InProgressImpl> get copyWith => - __$$InProgressImplCopyWithImpl<_$InProgressImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() preparing, - required TResult Function(int uploaded, int total) inProgress, - required TResult Function() success, - required TResult Function(String error) failed, - }) { - return inProgress(uploaded, total); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? preparing, - TResult? Function(int uploaded, int total)? inProgress, - TResult? Function()? success, - TResult? Function(String error)? failed, - }) { - return inProgress?.call(uploaded, total); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? preparing, - TResult Function(int uploaded, int total)? inProgress, - TResult Function()? success, - TResult Function(String error)? failed, - required TResult orElse(), - }) { - if (inProgress != null) { - return inProgress(uploaded, total); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Preparing value) preparing, - required TResult Function(InProgress value) inProgress, - required TResult Function(Success value) success, - required TResult Function(Failed value) failed, - }) { - return inProgress(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Preparing value)? preparing, - TResult? Function(InProgress value)? inProgress, - TResult? Function(Success value)? success, - TResult? Function(Failed value)? failed, - }) { - return inProgress?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Preparing value)? preparing, - TResult Function(InProgress value)? inProgress, - TResult Function(Success value)? success, - TResult Function(Failed value)? failed, - required TResult orElse(), - }) { - if (inProgress != null) { - return inProgress(this); - } - return orElse(); - } + int get hashCode => runtimeType.hashCode; @override - Map toJson() { - return _$$InProgressImplToJson( - this, - ); + String toString() { + return 'UploadState.success()'; } } -abstract class InProgress extends UploadState { - const factory InProgress( - {required final int uploaded, - required final int total}) = _$InProgressImpl; - const InProgress._() : super._(); - - factory InProgress.fromJson(Map json) = - _$InProgressImpl.fromJson; - - int get uploaded; - int get total; - - /// Create a copy of UploadState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$InProgressImplCopyWith<_$InProgressImpl> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$SuccessImplCopyWith<$Res> { - factory _$$SuccessImplCopyWith( - _$SuccessImpl value, $Res Function(_$SuccessImpl) then) = - __$$SuccessImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$SuccessImplCopyWithImpl<$Res> - extends _$UploadStateCopyWithImpl<$Res, _$SuccessImpl> - implements _$$SuccessImplCopyWith<$Res> { - __$$SuccessImplCopyWithImpl( - _$SuccessImpl _value, $Res Function(_$SuccessImpl) _then) - : super(_value, _then); - - /// Create a copy of UploadState - /// with the given fields replaced by the non-null parameter values. -} - /// @nodoc @JsonSerializable() -class _$SuccessImpl extends Success { - const _$SuccessImpl({final String? $type}) - : $type = $type ?? 'success', +class Failed extends UploadState { + const Failed({required this.error, final String? $type}) + : $type = $type ?? 'failed', super._(); + factory Failed.fromJson(Map json) => _$FailedFromJson(json); - factory _$SuccessImpl.fromJson(Map json) => - _$$SuccessImplFromJson(json); + final String error; @JsonKey(name: 'runtimeType') final String $type; + /// Create a copy of UploadState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $FailedCopyWith get copyWith => + _$FailedCopyWithImpl(this, _$identity); + @override - String toString() { - return 'UploadState.success()'; + Map toJson() { + return _$FailedToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$SuccessImpl); + (other.runtimeType == runtimeType && + other is Failed && + (identical(other.error, error) || other.error == error)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() preparing, - required TResult Function(int uploaded, int total) inProgress, - required TResult Function() success, - required TResult Function(String error) failed, - }) { - return success(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? preparing, - TResult? Function(int uploaded, int total)? inProgress, - TResult? Function()? success, - TResult? Function(String error)? failed, - }) { - return success?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? preparing, - TResult Function(int uploaded, int total)? inProgress, - TResult Function()? success, - TResult Function(String error)? failed, - required TResult orElse(), - }) { - if (success != null) { - return success(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Preparing value) preparing, - required TResult Function(InProgress value) inProgress, - required TResult Function(Success value) success, - required TResult Function(Failed value) failed, - }) { - return success(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Preparing value)? preparing, - TResult? Function(InProgress value)? inProgress, - TResult? Function(Success value)? success, - TResult? Function(Failed value)? failed, - }) { - return success?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Preparing value)? preparing, - TResult Function(InProgress value)? inProgress, - TResult Function(Success value)? success, - TResult Function(Failed value)? failed, - required TResult orElse(), - }) { - if (success != null) { - return success(this); - } - return orElse(); - } + int get hashCode => Object.hash(runtimeType, error); @override - Map toJson() { - return _$$SuccessImplToJson( - this, - ); + String toString() { + return 'UploadState.failed(error: $error)'; } } -abstract class Success extends UploadState { - const factory Success() = _$SuccessImpl; - const Success._() : super._(); - - factory Success.fromJson(Map json) = _$SuccessImpl.fromJson; -} - /// @nodoc -abstract class _$$FailedImplCopyWith<$Res> { - factory _$$FailedImplCopyWith( - _$FailedImpl value, $Res Function(_$FailedImpl) then) = - __$$FailedImplCopyWithImpl<$Res>; +abstract mixin class $FailedCopyWith<$Res> + implements $UploadStateCopyWith<$Res> { + factory $FailedCopyWith(Failed value, $Res Function(Failed) _then) = + _$FailedCopyWithImpl; @useResult $Res call({String error}); } /// @nodoc -class __$$FailedImplCopyWithImpl<$Res> - extends _$UploadStateCopyWithImpl<$Res, _$FailedImpl> - implements _$$FailedImplCopyWith<$Res> { - __$$FailedImplCopyWithImpl( - _$FailedImpl _value, $Res Function(_$FailedImpl) _then) - : super(_value, _then); +class _$FailedCopyWithImpl<$Res> implements $FailedCopyWith<$Res> { + _$FailedCopyWithImpl(this._self, this._then); + + final Failed _self; + final $Res Function(Failed) _then; /// Create a copy of UploadState /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ Object? error = null, }) { - return _then(_$FailedImpl( + return _then(Failed( error: null == error - ? _value.error + ? _self.error : error // ignore: cast_nullable_to_non_nullable as String, )); } } -/// @nodoc -@JsonSerializable() -class _$FailedImpl extends Failed { - const _$FailedImpl({required this.error, final String? $type}) - : $type = $type ?? 'failed', - super._(); - - factory _$FailedImpl.fromJson(Map json) => - _$$FailedImplFromJson(json); - - @override - final String error; - - @JsonKey(name: 'runtimeType') - final String $type; - - @override - String toString() { - return 'UploadState.failed(error: $error)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$FailedImpl && - (identical(other.error, error) || other.error == error)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, error); - - /// Create a copy of UploadState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$FailedImplCopyWith<_$FailedImpl> get copyWith => - __$$FailedImplCopyWithImpl<_$FailedImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() preparing, - required TResult Function(int uploaded, int total) inProgress, - required TResult Function() success, - required TResult Function(String error) failed, - }) { - return failed(error); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? preparing, - TResult? Function(int uploaded, int total)? inProgress, - TResult? Function()? success, - TResult? Function(String error)? failed, - }) { - return failed?.call(error); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? preparing, - TResult Function(int uploaded, int total)? inProgress, - TResult Function()? success, - TResult Function(String error)? failed, - required TResult orElse(), - }) { - if (failed != null) { - return failed(error); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Preparing value) preparing, - required TResult Function(InProgress value) inProgress, - required TResult Function(Success value) success, - required TResult Function(Failed value) failed, - }) { - return failed(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Preparing value)? preparing, - TResult? Function(InProgress value)? inProgress, - TResult? Function(Success value)? success, - TResult? Function(Failed value)? failed, - }) { - return failed?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Preparing value)? preparing, - TResult Function(InProgress value)? inProgress, - TResult Function(Success value)? success, - TResult Function(Failed value)? failed, - required TResult orElse(), - }) { - if (failed != null) { - return failed(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$FailedImplToJson( - this, - ); - } -} - -abstract class Failed extends UploadState { - const factory Failed({required final String error}) = _$FailedImpl; - const Failed._() : super._(); - - factory Failed.fromJson(Map json) = _$FailedImpl.fromJson; - - String get error; - - /// Create a copy of UploadState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$FailedImplCopyWith<_$FailedImpl> get copyWith => - throw _privateConstructorUsedError; -} +// dart format on diff --git a/packages/stream_chat/lib/src/core/models/attachment_file.g.dart b/packages/stream_chat/lib/src/core/models/attachment_file.g.dart index 6b385f2bb..256713cae 100644 --- a/packages/stream_chat/lib/src/core/models/attachment_file.g.dart +++ b/packages/stream_chat/lib/src/core/models/attachment_file.g.dart @@ -20,47 +20,41 @@ Map _$AttachmentFileToJson(AttachmentFile instance) => 'size': instance.size, }; -_$PreparingImpl _$$PreparingImplFromJson(Map json) => - _$PreparingImpl( +Preparing _$PreparingFromJson(Map json) => Preparing( $type: json['runtimeType'] as String?, ); -Map _$$PreparingImplToJson(_$PreparingImpl instance) => - { +Map _$PreparingToJson(Preparing instance) => { 'runtimeType': instance.$type, }; -_$InProgressImpl _$$InProgressImplFromJson(Map json) => - _$InProgressImpl( +InProgress _$InProgressFromJson(Map json) => InProgress( uploaded: (json['uploaded'] as num).toInt(), total: (json['total'] as num).toInt(), $type: json['runtimeType'] as String?, ); -Map _$$InProgressImplToJson(_$InProgressImpl instance) => +Map _$InProgressToJson(InProgress instance) => { 'uploaded': instance.uploaded, 'total': instance.total, 'runtimeType': instance.$type, }; -_$SuccessImpl _$$SuccessImplFromJson(Map json) => - _$SuccessImpl( +Success _$SuccessFromJson(Map json) => Success( $type: json['runtimeType'] as String?, ); -Map _$$SuccessImplToJson(_$SuccessImpl instance) => - { +Map _$SuccessToJson(Success instance) => { 'runtimeType': instance.$type, }; -_$FailedImpl _$$FailedImplFromJson(Map json) => _$FailedImpl( +Failed _$FailedFromJson(Map json) => Failed( error: json['error'] as String, $type: json['runtimeType'] as String?, ); -Map _$$FailedImplToJson(_$FailedImpl instance) => - { +Map _$FailedToJson(Failed instance) => { 'error': instance.error, 'runtimeType': instance.$type, }; diff --git a/packages/stream_chat/lib/src/core/models/message_state.freezed.dart b/packages/stream_chat/lib/src/core/models/message_state.freezed.dart index 584bc54b4..079d8b369 100644 --- a/packages/stream_chat/lib/src/core/models/message_state.freezed.dart +++ b/packages/stream_chat/lib/src/core/models/message_state.freezed.dart @@ -1,3 +1,4 @@ +// dart format width=80 // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint @@ -9,11 +10,8 @@ part of 'message_state.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(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#adding-getters-and-methods-to-our-models'); - MessageState _$MessageStateFromJson(Map json) { switch (json['runtimeType']) { case 'initial': @@ -33,122 +31,51 @@ MessageState _$MessageStateFromJson(Map json) { /// @nodoc mixin _$MessageState { - @optionalTypeArgs - TResult when({ - required TResult Function() initial, - required TResult Function(OutgoingState state) outgoing, - required TResult Function(CompletedState state) completed, - required TResult Function(FailedState state, Object? reason) failed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? initial, - TResult? Function(OutgoingState state)? outgoing, - TResult? Function(CompletedState state)? completed, - TResult? Function(FailedState state, Object? reason)? failed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function(OutgoingState state)? outgoing, - TResult Function(CompletedState state)? completed, - TResult Function(FailedState state, Object? reason)? failed, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(MessageInitial value) initial, - required TResult Function(MessageOutgoing value) outgoing, - required TResult Function(MessageCompleted value) completed, - required TResult Function(MessageFailed value) failed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(MessageInitial value)? initial, - TResult? Function(MessageOutgoing value)? outgoing, - TResult? Function(MessageCompleted value)? completed, - TResult? Function(MessageFailed value)? failed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(MessageInitial value)? initial, - TResult Function(MessageOutgoing value)? outgoing, - TResult Function(MessageCompleted value)? completed, - TResult Function(MessageFailed value)? failed, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - /// Serializes this MessageState to a JSON map. - Map toJson() => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $MessageStateCopyWith<$Res> { - factory $MessageStateCopyWith( - MessageState value, $Res Function(MessageState) then) = - _$MessageStateCopyWithImpl<$Res, MessageState>; -} - -/// @nodoc -class _$MessageStateCopyWithImpl<$Res, $Val extends MessageState> - implements $MessageStateCopyWith<$Res> { - _$MessageStateCopyWithImpl(this._value, this._then); + Map toJson(); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is MessageState); + } - /// Create a copy of MessageState - /// with the given fields replaced by the non-null parameter values. -} + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => runtimeType.hashCode; -/// @nodoc -abstract class _$$MessageInitialImplCopyWith<$Res> { - factory _$$MessageInitialImplCopyWith(_$MessageInitialImpl value, - $Res Function(_$MessageInitialImpl) then) = - __$$MessageInitialImplCopyWithImpl<$Res>; + @override + String toString() { + return 'MessageState()'; + } } /// @nodoc -class __$$MessageInitialImplCopyWithImpl<$Res> - extends _$MessageStateCopyWithImpl<$Res, _$MessageInitialImpl> - implements _$$MessageInitialImplCopyWith<$Res> { - __$$MessageInitialImplCopyWithImpl( - _$MessageInitialImpl _value, $Res Function(_$MessageInitialImpl) _then) - : super(_value, _then); - - /// Create a copy of MessageState - /// with the given fields replaced by the non-null parameter values. +class $MessageStateCopyWith<$Res> { + $MessageStateCopyWith(MessageState _, $Res Function(MessageState) __); } /// @nodoc @JsonSerializable() -class _$MessageInitialImpl implements MessageInitial { - const _$MessageInitialImpl({final String? $type}) - : $type = $type ?? 'initial'; - - factory _$MessageInitialImpl.fromJson(Map json) => - _$$MessageInitialImplFromJson(json); +class MessageInitial implements MessageState { + const MessageInitial({final String? $type}) : $type = $type ?? 'initial'; + factory MessageInitial.fromJson(Map json) => + _$MessageInitialFromJson(json); @JsonKey(name: 'runtimeType') final String $type; @override - String toString() { - return 'MessageState.initial()'; + Map toJson() { + return _$MessageInitialToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$MessageInitialImpl); + (other.runtimeType == runtimeType && other is MessageInitial); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -156,99 +83,62 @@ class _$MessageInitialImpl implements MessageInitial { int get hashCode => runtimeType.hashCode; @override - @optionalTypeArgs - TResult when({ - required TResult Function() initial, - required TResult Function(OutgoingState state) outgoing, - required TResult Function(CompletedState state) completed, - required TResult Function(FailedState state, Object? reason) failed, - }) { - return initial(); + String toString() { + return 'MessageState.initial()'; } +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? initial, - TResult? Function(OutgoingState state)? outgoing, - TResult? Function(CompletedState state)? completed, - TResult? Function(FailedState state, Object? reason)? failed, - }) { - return initial?.call(); - } +/// @nodoc +@JsonSerializable() +class MessageOutgoing implements MessageState { + const MessageOutgoing({required this.state, final String? $type}) + : $type = $type ?? 'outgoing'; + factory MessageOutgoing.fromJson(Map json) => + _$MessageOutgoingFromJson(json); - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function(OutgoingState state)? outgoing, - TResult Function(CompletedState state)? completed, - TResult Function(FailedState state, Object? reason)? failed, - required TResult orElse(), - }) { - if (initial != null) { - return initial(); - } - return orElse(); - } + final OutgoingState state; + + @JsonKey(name: 'runtimeType') + final String $type; + + /// Create a copy of MessageState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $MessageOutgoingCopyWith get copyWith => + _$MessageOutgoingCopyWithImpl(this, _$identity); @override - @optionalTypeArgs - TResult map({ - required TResult Function(MessageInitial value) initial, - required TResult Function(MessageOutgoing value) outgoing, - required TResult Function(MessageCompleted value) completed, - required TResult Function(MessageFailed value) failed, - }) { - return initial(this); + Map toJson() { + return _$MessageOutgoingToJson( + this, + ); } @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(MessageInitial value)? initial, - TResult? Function(MessageOutgoing value)? outgoing, - TResult? Function(MessageCompleted value)? completed, - TResult? Function(MessageFailed value)? failed, - }) { - return initial?.call(this); + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is MessageOutgoing && + (identical(other.state, state) || other.state == state)); } + @JsonKey(includeFromJson: false, includeToJson: false) @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(MessageInitial value)? initial, - TResult Function(MessageOutgoing value)? outgoing, - TResult Function(MessageCompleted value)? completed, - TResult Function(MessageFailed value)? failed, - required TResult orElse(), - }) { - if (initial != null) { - return initial(this); - } - return orElse(); - } + int get hashCode => Object.hash(runtimeType, state); @override - Map toJson() { - return _$$MessageInitialImplToJson( - this, - ); + String toString() { + return 'MessageState.outgoing(state: $state)'; } } -abstract class MessageInitial implements MessageState { - const factory MessageInitial() = _$MessageInitialImpl; - - factory MessageInitial.fromJson(Map json) = - _$MessageInitialImpl.fromJson; -} - /// @nodoc -abstract class _$$MessageOutgoingImplCopyWith<$Res> { - factory _$$MessageOutgoingImplCopyWith(_$MessageOutgoingImpl value, - $Res Function(_$MessageOutgoingImpl) then) = - __$$MessageOutgoingImplCopyWithImpl<$Res>; +abstract mixin class $MessageOutgoingCopyWith<$Res> + implements $MessageStateCopyWith<$Res> { + factory $MessageOutgoingCopyWith( + MessageOutgoing value, $Res Function(MessageOutgoing) _then) = + _$MessageOutgoingCopyWithImpl; @useResult $Res call({OutgoingState state}); @@ -256,23 +146,22 @@ abstract class _$$MessageOutgoingImplCopyWith<$Res> { } /// @nodoc -class __$$MessageOutgoingImplCopyWithImpl<$Res> - extends _$MessageStateCopyWithImpl<$Res, _$MessageOutgoingImpl> - implements _$$MessageOutgoingImplCopyWith<$Res> { - __$$MessageOutgoingImplCopyWithImpl( - _$MessageOutgoingImpl _value, $Res Function(_$MessageOutgoingImpl) _then) - : super(_value, _then); +class _$MessageOutgoingCopyWithImpl<$Res> + implements $MessageOutgoingCopyWith<$Res> { + _$MessageOutgoingCopyWithImpl(this._self, this._then); + + final MessageOutgoing _self; + final $Res Function(MessageOutgoing) _then; /// Create a copy of MessageState /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ Object? state = null, }) { - return _then(_$MessageOutgoingImpl( + return _then(MessageOutgoing( state: null == state - ? _value.state + ? _self.state : state // ignore: cast_nullable_to_non_nullable as OutgoingState, )); @@ -283,37 +172,44 @@ class __$$MessageOutgoingImplCopyWithImpl<$Res> @override @pragma('vm:prefer-inline') $OutgoingStateCopyWith<$Res> get state { - return $OutgoingStateCopyWith<$Res>(_value.state, (value) { - return _then(_value.copyWith(state: value)); + return $OutgoingStateCopyWith<$Res>(_self.state, (value) { + return _then(_self.copyWith(state: value)); }); } } /// @nodoc @JsonSerializable() -class _$MessageOutgoingImpl implements MessageOutgoing { - const _$MessageOutgoingImpl({required this.state, final String? $type}) - : $type = $type ?? 'outgoing'; - - factory _$MessageOutgoingImpl.fromJson(Map json) => - _$$MessageOutgoingImplFromJson(json); +class MessageCompleted implements MessageState { + const MessageCompleted({required this.state, final String? $type}) + : $type = $type ?? 'completed'; + factory MessageCompleted.fromJson(Map json) => + _$MessageCompletedFromJson(json); - @override - final OutgoingState state; + final CompletedState state; @JsonKey(name: 'runtimeType') final String $type; + /// Create a copy of MessageState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $MessageCompletedCopyWith get copyWith => + _$MessageCompletedCopyWithImpl(this, _$identity); + @override - String toString() { - return 'MessageState.outgoing(state: $state)'; + Map toJson() { + return _$MessageCompletedToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$MessageOutgoingImpl && + other is MessageCompleted && (identical(other.state, state) || other.state == state)); } @@ -321,118 +217,18 @@ class _$MessageOutgoingImpl implements MessageOutgoing { @override int get hashCode => Object.hash(runtimeType, state); - /// Create a copy of MessageState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$MessageOutgoingImplCopyWith<_$MessageOutgoingImpl> get copyWith => - __$$MessageOutgoingImplCopyWithImpl<_$MessageOutgoingImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() initial, - required TResult Function(OutgoingState state) outgoing, - required TResult Function(CompletedState state) completed, - required TResult Function(FailedState state, Object? reason) failed, - }) { - return outgoing(state); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? initial, - TResult? Function(OutgoingState state)? outgoing, - TResult? Function(CompletedState state)? completed, - TResult? Function(FailedState state, Object? reason)? failed, - }) { - return outgoing?.call(state); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function(OutgoingState state)? outgoing, - TResult Function(CompletedState state)? completed, - TResult Function(FailedState state, Object? reason)? failed, - required TResult orElse(), - }) { - if (outgoing != null) { - return outgoing(state); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(MessageInitial value) initial, - required TResult Function(MessageOutgoing value) outgoing, - required TResult Function(MessageCompleted value) completed, - required TResult Function(MessageFailed value) failed, - }) { - return outgoing(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(MessageInitial value)? initial, - TResult? Function(MessageOutgoing value)? outgoing, - TResult? Function(MessageCompleted value)? completed, - TResult? Function(MessageFailed value)? failed, - }) { - return outgoing?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(MessageInitial value)? initial, - TResult Function(MessageOutgoing value)? outgoing, - TResult Function(MessageCompleted value)? completed, - TResult Function(MessageFailed value)? failed, - required TResult orElse(), - }) { - if (outgoing != null) { - return outgoing(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$MessageOutgoingImplToJson( - this, - ); + String toString() { + return 'MessageState.completed(state: $state)'; } } -abstract class MessageOutgoing implements MessageState { - const factory MessageOutgoing({required final OutgoingState state}) = - _$MessageOutgoingImpl; - - factory MessageOutgoing.fromJson(Map json) = - _$MessageOutgoingImpl.fromJson; - - OutgoingState get state; - - /// Create a copy of MessageState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$MessageOutgoingImplCopyWith<_$MessageOutgoingImpl> get copyWith => - throw _privateConstructorUsedError; -} - /// @nodoc -abstract class _$$MessageCompletedImplCopyWith<$Res> { - factory _$$MessageCompletedImplCopyWith(_$MessageCompletedImpl value, - $Res Function(_$MessageCompletedImpl) then) = - __$$MessageCompletedImplCopyWithImpl<$Res>; +abstract mixin class $MessageCompletedCopyWith<$Res> + implements $MessageStateCopyWith<$Res> { + factory $MessageCompletedCopyWith( + MessageCompleted value, $Res Function(MessageCompleted) _then) = + _$MessageCompletedCopyWithImpl; @useResult $Res call({CompletedState state}); @@ -440,23 +236,22 @@ abstract class _$$MessageCompletedImplCopyWith<$Res> { } /// @nodoc -class __$$MessageCompletedImplCopyWithImpl<$Res> - extends _$MessageStateCopyWithImpl<$Res, _$MessageCompletedImpl> - implements _$$MessageCompletedImplCopyWith<$Res> { - __$$MessageCompletedImplCopyWithImpl(_$MessageCompletedImpl _value, - $Res Function(_$MessageCompletedImpl) _then) - : super(_value, _then); +class _$MessageCompletedCopyWithImpl<$Res> + implements $MessageCompletedCopyWith<$Res> { + _$MessageCompletedCopyWithImpl(this._self, this._then); + + final MessageCompleted _self; + final $Res Function(MessageCompleted) _then; /// Create a copy of MessageState /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ Object? state = null, }) { - return _then(_$MessageCompletedImpl( + return _then(MessageCompleted( state: null == state - ? _value.state + ? _self.state : state // ignore: cast_nullable_to_non_nullable as CompletedState, )); @@ -467,156 +262,66 @@ class __$$MessageCompletedImplCopyWithImpl<$Res> @override @pragma('vm:prefer-inline') $CompletedStateCopyWith<$Res> get state { - return $CompletedStateCopyWith<$Res>(_value.state, (value) { - return _then(_value.copyWith(state: value)); + return $CompletedStateCopyWith<$Res>(_self.state, (value) { + return _then(_self.copyWith(state: value)); }); } } /// @nodoc @JsonSerializable() -class _$MessageCompletedImpl implements MessageCompleted { - const _$MessageCompletedImpl({required this.state, final String? $type}) - : $type = $type ?? 'completed'; - - factory _$MessageCompletedImpl.fromJson(Map json) => - _$$MessageCompletedImplFromJson(json); +class MessageFailed implements MessageState { + const MessageFailed({required this.state, this.reason, final String? $type}) + : $type = $type ?? 'failed'; + factory MessageFailed.fromJson(Map json) => + _$MessageFailedFromJson(json); - @override - final CompletedState state; + final FailedState state; + final Object? reason; @JsonKey(name: 'runtimeType') final String $type; - @override - String toString() { - return 'MessageState.completed(state: $state)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$MessageCompletedImpl && - (identical(other.state, state) || other.state == state)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, state); - /// Create a copy of MessageState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - @override @pragma('vm:prefer-inline') - _$$MessageCompletedImplCopyWith<_$MessageCompletedImpl> get copyWith => - __$$MessageCompletedImplCopyWithImpl<_$MessageCompletedImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() initial, - required TResult Function(OutgoingState state) outgoing, - required TResult Function(CompletedState state) completed, - required TResult Function(FailedState state, Object? reason) failed, - }) { - return completed(state); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? initial, - TResult? Function(OutgoingState state)? outgoing, - TResult? Function(CompletedState state)? completed, - TResult? Function(FailedState state, Object? reason)? failed, - }) { - return completed?.call(state); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function(OutgoingState state)? outgoing, - TResult Function(CompletedState state)? completed, - TResult Function(FailedState state, Object? reason)? failed, - required TResult orElse(), - }) { - if (completed != null) { - return completed(state); - } - return orElse(); - } + $MessageFailedCopyWith get copyWith => + _$MessageFailedCopyWithImpl(this, _$identity); @override - @optionalTypeArgs - TResult map({ - required TResult Function(MessageInitial value) initial, - required TResult Function(MessageOutgoing value) outgoing, - required TResult Function(MessageCompleted value) completed, - required TResult Function(MessageFailed value) failed, - }) { - return completed(this); + Map toJson() { + return _$MessageFailedToJson( + this, + ); } @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(MessageInitial value)? initial, - TResult? Function(MessageOutgoing value)? outgoing, - TResult? Function(MessageCompleted value)? completed, - TResult? Function(MessageFailed value)? failed, - }) { - return completed?.call(this); + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is MessageFailed && + (identical(other.state, state) || other.state == state) && + const DeepCollectionEquality().equals(other.reason, reason)); } + @JsonKey(includeFromJson: false, includeToJson: false) @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(MessageInitial value)? initial, - TResult Function(MessageOutgoing value)? outgoing, - TResult Function(MessageCompleted value)? completed, - TResult Function(MessageFailed value)? failed, - required TResult orElse(), - }) { - if (completed != null) { - return completed(this); - } - return orElse(); - } + int get hashCode => Object.hash( + runtimeType, state, const DeepCollectionEquality().hash(reason)); @override - Map toJson() { - return _$$MessageCompletedImplToJson( - this, - ); + String toString() { + return 'MessageState.failed(state: $state, reason: $reason)'; } } -abstract class MessageCompleted implements MessageState { - const factory MessageCompleted({required final CompletedState state}) = - _$MessageCompletedImpl; - - factory MessageCompleted.fromJson(Map json) = - _$MessageCompletedImpl.fromJson; - - CompletedState get state; - - /// Create a copy of MessageState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$MessageCompletedImplCopyWith<_$MessageCompletedImpl> get copyWith => - throw _privateConstructorUsedError; -} - /// @nodoc -abstract class _$$MessageFailedImplCopyWith<$Res> { - factory _$$MessageFailedImplCopyWith( - _$MessageFailedImpl value, $Res Function(_$MessageFailedImpl) then) = - __$$MessageFailedImplCopyWithImpl<$Res>; +abstract mixin class $MessageFailedCopyWith<$Res> + implements $MessageStateCopyWith<$Res> { + factory $MessageFailedCopyWith( + MessageFailed value, $Res Function(MessageFailed) _then) = + _$MessageFailedCopyWithImpl; @useResult $Res call({FailedState state, Object? reason}); @@ -624,27 +329,26 @@ abstract class _$$MessageFailedImplCopyWith<$Res> { } /// @nodoc -class __$$MessageFailedImplCopyWithImpl<$Res> - extends _$MessageStateCopyWithImpl<$Res, _$MessageFailedImpl> - implements _$$MessageFailedImplCopyWith<$Res> { - __$$MessageFailedImplCopyWithImpl( - _$MessageFailedImpl _value, $Res Function(_$MessageFailedImpl) _then) - : super(_value, _then); +class _$MessageFailedCopyWithImpl<$Res> + implements $MessageFailedCopyWith<$Res> { + _$MessageFailedCopyWithImpl(this._self, this._then); + + final MessageFailed _self; + final $Res Function(MessageFailed) _then; /// Create a copy of MessageState /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ Object? state = null, Object? reason = freezed, }) { - return _then(_$MessageFailedImpl( + return _then(MessageFailed( state: null == state - ? _value.state + ? _self.state : state // ignore: cast_nullable_to_non_nullable as FailedState, - reason: freezed == reason ? _value.reason : reason, + reason: freezed == reason ? _self.reason : reason, )); } @@ -653,410 +357,107 @@ class __$$MessageFailedImplCopyWithImpl<$Res> @override @pragma('vm:prefer-inline') $FailedStateCopyWith<$Res> get state { - return $FailedStateCopyWith<$Res>(_value.state, (value) { - return _then(_value.copyWith(state: value)); + return $FailedStateCopyWith<$Res>(_self.state, (value) { + return _then(_self.copyWith(state: value)); }); } } +OutgoingState _$OutgoingStateFromJson(Map json) { + switch (json['runtimeType']) { + case 'sending': + return Sending.fromJson(json); + case 'updating': + return Updating.fromJson(json); + case 'deleting': + return Deleting.fromJson(json); + + default: + throw CheckedFromJsonException(json, 'runtimeType', 'OutgoingState', + 'Invalid union type "${json['runtimeType']}"!'); + } +} + /// @nodoc -@JsonSerializable() -class _$MessageFailedImpl implements MessageFailed { - const _$MessageFailedImpl( - {required this.state, this.reason, final String? $type}) - : $type = $type ?? 'failed'; +mixin _$OutgoingState { + /// Serializes this OutgoingState to a JSON map. + Map toJson(); - factory _$MessageFailedImpl.fromJson(Map json) => - _$$MessageFailedImplFromJson(json); + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is OutgoingState); + } + @JsonKey(includeFromJson: false, includeToJson: false) @override - final FailedState state; + int get hashCode => runtimeType.hashCode; + @override - final Object? reason; + String toString() { + return 'OutgoingState()'; + } +} + +/// @nodoc +class $OutgoingStateCopyWith<$Res> { + $OutgoingStateCopyWith(OutgoingState _, $Res Function(OutgoingState) __); +} + +/// @nodoc +@JsonSerializable() +class Sending implements OutgoingState { + const Sending({final String? $type}) : $type = $type ?? 'sending'; + factory Sending.fromJson(Map json) => + _$SendingFromJson(json); @JsonKey(name: 'runtimeType') final String $type; @override - String toString() { - return 'MessageState.failed(state: $state, reason: $reason)'; + Map toJson() { + return _$SendingToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$MessageFailedImpl && - (identical(other.state, state) || other.state == state) && - const DeepCollectionEquality().equals(other.reason, reason)); + (other.runtimeType == runtimeType && other is Sending); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, state, const DeepCollectionEquality().hash(reason)); - - /// Create a copy of MessageState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$MessageFailedImplCopyWith<_$MessageFailedImpl> get copyWith => - __$$MessageFailedImplCopyWithImpl<_$MessageFailedImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() initial, - required TResult Function(OutgoingState state) outgoing, - required TResult Function(CompletedState state) completed, - required TResult Function(FailedState state, Object? reason) failed, - }) { - return failed(state, reason); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? initial, - TResult? Function(OutgoingState state)? outgoing, - TResult? Function(CompletedState state)? completed, - TResult? Function(FailedState state, Object? reason)? failed, - }) { - return failed?.call(state, reason); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function(OutgoingState state)? outgoing, - TResult Function(CompletedState state)? completed, - TResult Function(FailedState state, Object? reason)? failed, - required TResult orElse(), - }) { - if (failed != null) { - return failed(state, reason); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(MessageInitial value) initial, - required TResult Function(MessageOutgoing value) outgoing, - required TResult Function(MessageCompleted value) completed, - required TResult Function(MessageFailed value) failed, - }) { - return failed(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(MessageInitial value)? initial, - TResult? Function(MessageOutgoing value)? outgoing, - TResult? Function(MessageCompleted value)? completed, - TResult? Function(MessageFailed value)? failed, - }) { - return failed?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(MessageInitial value)? initial, - TResult Function(MessageOutgoing value)? outgoing, - TResult Function(MessageCompleted value)? completed, - TResult Function(MessageFailed value)? failed, - required TResult orElse(), - }) { - if (failed != null) { - return failed(this); - } - return orElse(); - } + int get hashCode => runtimeType.hashCode; @override - Map toJson() { - return _$$MessageFailedImplToJson( - this, - ); - } -} - -abstract class MessageFailed implements MessageState { - const factory MessageFailed( - {required final FailedState state, - final Object? reason}) = _$MessageFailedImpl; - - factory MessageFailed.fromJson(Map json) = - _$MessageFailedImpl.fromJson; - - FailedState get state; - Object? get reason; - - /// Create a copy of MessageState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$MessageFailedImplCopyWith<_$MessageFailedImpl> get copyWith => - throw _privateConstructorUsedError; -} - -OutgoingState _$OutgoingStateFromJson(Map json) { - switch (json['runtimeType']) { - case 'sending': - return Sending.fromJson(json); - case 'updating': - return Updating.fromJson(json); - case 'deleting': - return Deleting.fromJson(json); - - default: - throw CheckedFromJsonException(json, 'runtimeType', 'OutgoingState', - 'Invalid union type "${json['runtimeType']}"!'); + String toString() { + return 'OutgoingState.sending()'; } } -/// @nodoc -mixin _$OutgoingState { - @optionalTypeArgs - TResult when({ - required TResult Function() sending, - required TResult Function() updating, - required TResult Function(bool hard) deleting, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? sending, - TResult? Function()? updating, - TResult? Function(bool hard)? deleting, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? sending, - TResult Function()? updating, - TResult Function(bool hard)? deleting, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(Sending value) sending, - required TResult Function(Updating value) updating, - required TResult Function(Deleting value) deleting, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Sending value)? sending, - TResult? Function(Updating value)? updating, - TResult? Function(Deleting value)? deleting, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Sending value)? sending, - TResult Function(Updating value)? updating, - TResult Function(Deleting value)? deleting, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - - /// Serializes this OutgoingState to a JSON map. - Map toJson() => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $OutgoingStateCopyWith<$Res> { - factory $OutgoingStateCopyWith( - OutgoingState value, $Res Function(OutgoingState) then) = - _$OutgoingStateCopyWithImpl<$Res, OutgoingState>; -} - -/// @nodoc -class _$OutgoingStateCopyWithImpl<$Res, $Val extends OutgoingState> - implements $OutgoingStateCopyWith<$Res> { - _$OutgoingStateCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of OutgoingState - /// with the given fields replaced by the non-null parameter values. -} - -/// @nodoc -abstract class _$$SendingImplCopyWith<$Res> { - factory _$$SendingImplCopyWith( - _$SendingImpl value, $Res Function(_$SendingImpl) then) = - __$$SendingImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$SendingImplCopyWithImpl<$Res> - extends _$OutgoingStateCopyWithImpl<$Res, _$SendingImpl> - implements _$$SendingImplCopyWith<$Res> { - __$$SendingImplCopyWithImpl( - _$SendingImpl _value, $Res Function(_$SendingImpl) _then) - : super(_value, _then); - - /// Create a copy of OutgoingState - /// with the given fields replaced by the non-null parameter values. -} - /// @nodoc @JsonSerializable() -class _$SendingImpl implements Sending { - const _$SendingImpl({final String? $type}) : $type = $type ?? 'sending'; - - factory _$SendingImpl.fromJson(Map json) => - _$$SendingImplFromJson(json); +class Updating implements OutgoingState { + const Updating({final String? $type}) : $type = $type ?? 'updating'; + factory Updating.fromJson(Map json) => + _$UpdatingFromJson(json); @JsonKey(name: 'runtimeType') final String $type; - @override - String toString() { - return 'OutgoingState.sending()'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$SendingImpl); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() sending, - required TResult Function() updating, - required TResult Function(bool hard) deleting, - }) { - return sending(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? sending, - TResult? Function()? updating, - TResult? Function(bool hard)? deleting, - }) { - return sending?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? sending, - TResult Function()? updating, - TResult Function(bool hard)? deleting, - required TResult orElse(), - }) { - if (sending != null) { - return sending(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Sending value) sending, - required TResult Function(Updating value) updating, - required TResult Function(Deleting value) deleting, - }) { - return sending(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Sending value)? sending, - TResult? Function(Updating value)? updating, - TResult? Function(Deleting value)? deleting, - }) { - return sending?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Sending value)? sending, - TResult Function(Updating value)? updating, - TResult Function(Deleting value)? deleting, - required TResult orElse(), - }) { - if (sending != null) { - return sending(this); - } - return orElse(); - } - @override Map toJson() { - return _$$SendingImplToJson( + return _$UpdatingToJson( this, ); } -} - -abstract class Sending implements OutgoingState { - const factory Sending() = _$SendingImpl; - - factory Sending.fromJson(Map json) = _$SendingImpl.fromJson; -} - -/// @nodoc -abstract class _$$UpdatingImplCopyWith<$Res> { - factory _$$UpdatingImplCopyWith( - _$UpdatingImpl value, $Res Function(_$UpdatingImpl) then) = - __$$UpdatingImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$UpdatingImplCopyWithImpl<$Res> - extends _$OutgoingStateCopyWithImpl<$Res, _$UpdatingImpl> - implements _$$UpdatingImplCopyWith<$Res> { - __$$UpdatingImplCopyWithImpl( - _$UpdatingImpl _value, $Res Function(_$UpdatingImpl) _then) - : super(_value, _then); - - /// Create a copy of OutgoingState - /// with the given fields replaced by the non-null parameter values. -} - -/// @nodoc -@JsonSerializable() -class _$UpdatingImpl implements Updating { - const _$UpdatingImpl({final String? $type}) : $type = $type ?? 'updating'; - - factory _$UpdatingImpl.fromJson(Map json) => - _$$UpdatingImplFromJson(json); - - @JsonKey(name: 'runtimeType') - final String $type; - - @override - String toString() { - return 'OutgoingState.updating()'; - } @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$UpdatingImpl); + (other.runtimeType == runtimeType && other is Updating); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -1064,884 +465,149 @@ class _$UpdatingImpl implements Updating { int get hashCode => runtimeType.hashCode; @override - @optionalTypeArgs - TResult when({ - required TResult Function() sending, - required TResult Function() updating, - required TResult Function(bool hard) deleting, - }) { - return updating(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? sending, - TResult? Function()? updating, - TResult? Function(bool hard)? deleting, - }) { - return updating?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? sending, - TResult Function()? updating, - TResult Function(bool hard)? deleting, - required TResult orElse(), - }) { - if (updating != null) { - return updating(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Sending value) sending, - required TResult Function(Updating value) updating, - required TResult Function(Deleting value) deleting, - }) { - return updating(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Sending value)? sending, - TResult? Function(Updating value)? updating, - TResult? Function(Deleting value)? deleting, - }) { - return updating?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Sending value)? sending, - TResult Function(Updating value)? updating, - TResult Function(Deleting value)? deleting, - required TResult orElse(), - }) { - if (updating != null) { - return updating(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$UpdatingImplToJson( - this, - ); - } -} - -abstract class Updating implements OutgoingState { - const factory Updating() = _$UpdatingImpl; - - factory Updating.fromJson(Map json) = - _$UpdatingImpl.fromJson; -} - -/// @nodoc -abstract class _$$DeletingImplCopyWith<$Res> { - factory _$$DeletingImplCopyWith( - _$DeletingImpl value, $Res Function(_$DeletingImpl) then) = - __$$DeletingImplCopyWithImpl<$Res>; - @useResult - $Res call({bool hard}); -} - -/// @nodoc -class __$$DeletingImplCopyWithImpl<$Res> - extends _$OutgoingStateCopyWithImpl<$Res, _$DeletingImpl> - implements _$$DeletingImplCopyWith<$Res> { - __$$DeletingImplCopyWithImpl( - _$DeletingImpl _value, $Res Function(_$DeletingImpl) _then) - : super(_value, _then); - - /// Create a copy of OutgoingState - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? hard = null, - }) { - return _then(_$DeletingImpl( - hard: null == hard - ? _value.hard - : hard // ignore: cast_nullable_to_non_nullable - as bool, - )); + String toString() { + return 'OutgoingState.updating()'; } } /// @nodoc @JsonSerializable() -class _$DeletingImpl implements Deleting { - const _$DeletingImpl({this.hard = false, final String? $type}) +class Deleting implements OutgoingState { + const Deleting({this.hard = false, final String? $type}) : $type = $type ?? 'deleting'; + factory Deleting.fromJson(Map json) => + _$DeletingFromJson(json); - factory _$DeletingImpl.fromJson(Map json) => - _$$DeletingImplFromJson(json); - - @override @JsonKey() final bool hard; @JsonKey(name: 'runtimeType') final String $type; - @override - String toString() { - return 'OutgoingState.deleting(hard: $hard)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$DeletingImpl && - (identical(other.hard, hard) || other.hard == hard)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, hard); - /// Create a copy of OutgoingState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - @override @pragma('vm:prefer-inline') - _$$DeletingImplCopyWith<_$DeletingImpl> get copyWith => - __$$DeletingImplCopyWithImpl<_$DeletingImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() sending, - required TResult Function() updating, - required TResult Function(bool hard) deleting, - }) { - return deleting(hard); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? sending, - TResult? Function()? updating, - TResult? Function(bool hard)? deleting, - }) { - return deleting?.call(hard); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? sending, - TResult Function()? updating, - TResult Function(bool hard)? deleting, - required TResult orElse(), - }) { - if (deleting != null) { - return deleting(hard); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Sending value) sending, - required TResult Function(Updating value) updating, - required TResult Function(Deleting value) deleting, - }) { - return deleting(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Sending value)? sending, - TResult? Function(Updating value)? updating, - TResult? Function(Deleting value)? deleting, - }) { - return deleting?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Sending value)? sending, - TResult Function(Updating value)? updating, - TResult Function(Deleting value)? deleting, - required TResult orElse(), - }) { - if (deleting != null) { - return deleting(this); - } - return orElse(); - } + $DeletingCopyWith get copyWith => + _$DeletingCopyWithImpl(this, _$identity); @override Map toJson() { - return _$$DeletingImplToJson( + return _$DeletingToJson( this, ); } -} - -abstract class Deleting implements OutgoingState { - const factory Deleting({final bool hard}) = _$DeletingImpl; - - factory Deleting.fromJson(Map json) = - _$DeletingImpl.fromJson; - - bool get hard; - - /// Create a copy of OutgoingState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$DeletingImplCopyWith<_$DeletingImpl> get copyWith => - throw _privateConstructorUsedError; -} - -CompletedState _$CompletedStateFromJson(Map json) { - switch (json['runtimeType']) { - case 'sent': - return Sent.fromJson(json); - case 'updated': - return Updated.fromJson(json); - case 'deleted': - return Deleted.fromJson(json); - - default: - throw CheckedFromJsonException(json, 'runtimeType', 'CompletedState', - 'Invalid union type "${json['runtimeType']}"!'); - } -} - -/// @nodoc -mixin _$CompletedState { - @optionalTypeArgs - TResult when({ - required TResult Function() sent, - required TResult Function() updated, - required TResult Function(bool hard) deleted, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? sent, - TResult? Function()? updated, - TResult? Function(bool hard)? deleted, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? sent, - TResult Function()? updated, - TResult Function(bool hard)? deleted, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(Sent value) sent, - required TResult Function(Updated value) updated, - required TResult Function(Deleted value) deleted, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Sent value)? sent, - TResult? Function(Updated value)? updated, - TResult? Function(Deleted value)? deleted, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Sent value)? sent, - TResult Function(Updated value)? updated, - TResult Function(Deleted value)? deleted, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - - /// Serializes this CompletedState to a JSON map. - Map toJson() => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $CompletedStateCopyWith<$Res> { - factory $CompletedStateCopyWith( - CompletedState value, $Res Function(CompletedState) then) = - _$CompletedStateCopyWithImpl<$Res, CompletedState>; -} - -/// @nodoc -class _$CompletedStateCopyWithImpl<$Res, $Val extends CompletedState> - implements $CompletedStateCopyWith<$Res> { - _$CompletedStateCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CompletedState - /// with the given fields replaced by the non-null parameter values. -} - -/// @nodoc -abstract class _$$SentImplCopyWith<$Res> { - factory _$$SentImplCopyWith( - _$SentImpl value, $Res Function(_$SentImpl) then) = - __$$SentImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$SentImplCopyWithImpl<$Res> - extends _$CompletedStateCopyWithImpl<$Res, _$SentImpl> - implements _$$SentImplCopyWith<$Res> { - __$$SentImplCopyWithImpl(_$SentImpl _value, $Res Function(_$SentImpl) _then) - : super(_value, _then); - - /// Create a copy of CompletedState - /// with the given fields replaced by the non-null parameter values. -} - -/// @nodoc -@JsonSerializable() -class _$SentImpl implements Sent { - const _$SentImpl({final String? $type}) : $type = $type ?? 'sent'; - - factory _$SentImpl.fromJson(Map json) => - _$$SentImplFromJson(json); - - @JsonKey(name: 'runtimeType') - final String $type; - - @override - String toString() { - return 'CompletedState.sent()'; - } @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$SentImpl); + (other.runtimeType == runtimeType && + other is Deleting && + (identical(other.hard, hard) || other.hard == hard)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() sent, - required TResult Function() updated, - required TResult Function(bool hard) deleted, - }) { - return sent(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? sent, - TResult? Function()? updated, - TResult? Function(bool hard)? deleted, - }) { - return sent?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? sent, - TResult Function()? updated, - TResult Function(bool hard)? deleted, - required TResult orElse(), - }) { - if (sent != null) { - return sent(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Sent value) sent, - required TResult Function(Updated value) updated, - required TResult Function(Deleted value) deleted, - }) { - return sent(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Sent value)? sent, - TResult? Function(Updated value)? updated, - TResult? Function(Deleted value)? deleted, - }) { - return sent?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Sent value)? sent, - TResult Function(Updated value)? updated, - TResult Function(Deleted value)? deleted, - required TResult orElse(), - }) { - if (sent != null) { - return sent(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$SentImplToJson( - this, - ); - } -} - -abstract class Sent implements CompletedState { - const factory Sent() = _$SentImpl; - - factory Sent.fromJson(Map json) = _$SentImpl.fromJson; -} - -/// @nodoc -abstract class _$$UpdatedImplCopyWith<$Res> { - factory _$$UpdatedImplCopyWith( - _$UpdatedImpl value, $Res Function(_$UpdatedImpl) then) = - __$$UpdatedImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$UpdatedImplCopyWithImpl<$Res> - extends _$CompletedStateCopyWithImpl<$Res, _$UpdatedImpl> - implements _$$UpdatedImplCopyWith<$Res> { - __$$UpdatedImplCopyWithImpl( - _$UpdatedImpl _value, $Res Function(_$UpdatedImpl) _then) - : super(_value, _then); - - /// Create a copy of CompletedState - /// with the given fields replaced by the non-null parameter values. -} - -/// @nodoc -@JsonSerializable() -class _$UpdatedImpl implements Updated { - const _$UpdatedImpl({final String? $type}) : $type = $type ?? 'updated'; - - factory _$UpdatedImpl.fromJson(Map json) => - _$$UpdatedImplFromJson(json); - - @JsonKey(name: 'runtimeType') - final String $type; + int get hashCode => Object.hash(runtimeType, hard); @override String toString() { - return 'CompletedState.updated()'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$UpdatedImpl); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() sent, - required TResult Function() updated, - required TResult Function(bool hard) deleted, - }) { - return updated(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? sent, - TResult? Function()? updated, - TResult? Function(bool hard)? deleted, - }) { - return updated?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? sent, - TResult Function()? updated, - TResult Function(bool hard)? deleted, - required TResult orElse(), - }) { - if (updated != null) { - return updated(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Sent value) sent, - required TResult Function(Updated value) updated, - required TResult Function(Deleted value) deleted, - }) { - return updated(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Sent value)? sent, - TResult? Function(Updated value)? updated, - TResult? Function(Deleted value)? deleted, - }) { - return updated?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Sent value)? sent, - TResult Function(Updated value)? updated, - TResult Function(Deleted value)? deleted, - required TResult orElse(), - }) { - if (updated != null) { - return updated(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$UpdatedImplToJson( - this, - ); + return 'OutgoingState.deleting(hard: $hard)'; } } -abstract class Updated implements CompletedState { - const factory Updated() = _$UpdatedImpl; - - factory Updated.fromJson(Map json) = _$UpdatedImpl.fromJson; -} - /// @nodoc -abstract class _$$DeletedImplCopyWith<$Res> { - factory _$$DeletedImplCopyWith( - _$DeletedImpl value, $Res Function(_$DeletedImpl) then) = - __$$DeletedImplCopyWithImpl<$Res>; +abstract mixin class $DeletingCopyWith<$Res> + implements $OutgoingStateCopyWith<$Res> { + factory $DeletingCopyWith(Deleting value, $Res Function(Deleting) _then) = + _$DeletingCopyWithImpl; @useResult $Res call({bool hard}); } /// @nodoc -class __$$DeletedImplCopyWithImpl<$Res> - extends _$CompletedStateCopyWithImpl<$Res, _$DeletedImpl> - implements _$$DeletedImplCopyWith<$Res> { - __$$DeletedImplCopyWithImpl( - _$DeletedImpl _value, $Res Function(_$DeletedImpl) _then) - : super(_value, _then); +class _$DeletingCopyWithImpl<$Res> implements $DeletingCopyWith<$Res> { + _$DeletingCopyWithImpl(this._self, this._then); - /// Create a copy of CompletedState + final Deleting _self; + final $Res Function(Deleting) _then; + + /// Create a copy of OutgoingState /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ Object? hard = null, }) { - return _then(_$DeletedImpl( + return _then(Deleting( hard: null == hard - ? _value.hard + ? _self.hard : hard // ignore: cast_nullable_to_non_nullable as bool, )); } } -/// @nodoc -@JsonSerializable() -class _$DeletedImpl implements Deleted { - const _$DeletedImpl({this.hard = false, final String? $type}) - : $type = $type ?? 'deleted'; - - factory _$DeletedImpl.fromJson(Map json) => - _$$DeletedImplFromJson(json); - - @override - @JsonKey() - final bool hard; - - @JsonKey(name: 'runtimeType') - final String $type; - - @override - String toString() { - return 'CompletedState.deleted(hard: $hard)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$DeletedImpl && - (identical(other.hard, hard) || other.hard == hard)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, hard); - - /// Create a copy of CompletedState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$DeletedImplCopyWith<_$DeletedImpl> get copyWith => - __$$DeletedImplCopyWithImpl<_$DeletedImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() sent, - required TResult Function() updated, - required TResult Function(bool hard) deleted, - }) { - return deleted(hard); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? sent, - TResult? Function()? updated, - TResult? Function(bool hard)? deleted, - }) { - return deleted?.call(hard); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? sent, - TResult Function()? updated, - TResult Function(bool hard)? deleted, - required TResult orElse(), - }) { - if (deleted != null) { - return deleted(hard); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Sent value) sent, - required TResult Function(Updated value) updated, - required TResult Function(Deleted value) deleted, - }) { - return deleted(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Sent value)? sent, - TResult? Function(Updated value)? updated, - TResult? Function(Deleted value)? deleted, - }) { - return deleted?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Sent value)? sent, - TResult Function(Updated value)? updated, - TResult Function(Deleted value)? deleted, - required TResult orElse(), - }) { - if (deleted != null) { - return deleted(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$DeletedImplToJson( - this, - ); - } -} - -abstract class Deleted implements CompletedState { - const factory Deleted({final bool hard}) = _$DeletedImpl; - - factory Deleted.fromJson(Map json) = _$DeletedImpl.fromJson; - - bool get hard; - - /// Create a copy of CompletedState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$DeletedImplCopyWith<_$DeletedImpl> get copyWith => - throw _privateConstructorUsedError; -} - -FailedState _$FailedStateFromJson(Map json) { +CompletedState _$CompletedStateFromJson(Map json) { switch (json['runtimeType']) { - case 'sendingFailed': - return SendingFailed.fromJson(json); - case 'updatingFailed': - return UpdatingFailed.fromJson(json); - case 'deletingFailed': - return DeletingFailed.fromJson(json); - - default: - throw CheckedFromJsonException(json, 'runtimeType', 'FailedState', - 'Invalid union type "${json['runtimeType']}"!'); - } -} - -/// @nodoc -mixin _$FailedState { - @optionalTypeArgs - TResult when({ - required TResult Function() sendingFailed, - required TResult Function() updatingFailed, - required TResult Function(bool hard) deletingFailed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? sendingFailed, - TResult? Function()? updatingFailed, - TResult? Function(bool hard)? deletingFailed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? sendingFailed, - TResult Function()? updatingFailed, - TResult Function(bool hard)? deletingFailed, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(SendingFailed value) sendingFailed, - required TResult Function(UpdatingFailed value) updatingFailed, - required TResult Function(DeletingFailed value) deletingFailed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(SendingFailed value)? sendingFailed, - TResult? Function(UpdatingFailed value)? updatingFailed, - TResult? Function(DeletingFailed value)? deletingFailed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(SendingFailed value)? sendingFailed, - TResult Function(UpdatingFailed value)? updatingFailed, - TResult Function(DeletingFailed value)? deletingFailed, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - - /// Serializes this FailedState to a JSON map. - Map toJson() => throw _privateConstructorUsedError; -} + case 'sent': + return Sent.fromJson(json); + case 'updated': + return Updated.fromJson(json); + case 'deleted': + return Deleted.fromJson(json); -/// @nodoc -abstract class $FailedStateCopyWith<$Res> { - factory $FailedStateCopyWith( - FailedState value, $Res Function(FailedState) then) = - _$FailedStateCopyWithImpl<$Res, FailedState>; + default: + throw CheckedFromJsonException(json, 'runtimeType', 'CompletedState', + 'Invalid union type "${json['runtimeType']}"!'); + } } /// @nodoc -class _$FailedStateCopyWithImpl<$Res, $Val extends FailedState> - implements $FailedStateCopyWith<$Res> { - _$FailedStateCopyWithImpl(this._value, this._then); +mixin _$CompletedState { + /// Serializes this CompletedState to a JSON map. + Map toJson(); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is CompletedState); + } - /// Create a copy of FailedState - /// with the given fields replaced by the non-null parameter values. -} + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => runtimeType.hashCode; -/// @nodoc -abstract class _$$SendingFailedImplCopyWith<$Res> { - factory _$$SendingFailedImplCopyWith( - _$SendingFailedImpl value, $Res Function(_$SendingFailedImpl) then) = - __$$SendingFailedImplCopyWithImpl<$Res>; + @override + String toString() { + return 'CompletedState()'; + } } /// @nodoc -class __$$SendingFailedImplCopyWithImpl<$Res> - extends _$FailedStateCopyWithImpl<$Res, _$SendingFailedImpl> - implements _$$SendingFailedImplCopyWith<$Res> { - __$$SendingFailedImplCopyWithImpl( - _$SendingFailedImpl _value, $Res Function(_$SendingFailedImpl) _then) - : super(_value, _then); - - /// Create a copy of FailedState - /// with the given fields replaced by the non-null parameter values. +class $CompletedStateCopyWith<$Res> { + $CompletedStateCopyWith(CompletedState _, $Res Function(CompletedState) __); } /// @nodoc @JsonSerializable() -class _$SendingFailedImpl implements SendingFailed { - const _$SendingFailedImpl({final String? $type}) - : $type = $type ?? 'sendingFailed'; - - factory _$SendingFailedImpl.fromJson(Map json) => - _$$SendingFailedImplFromJson(json); +class Sent implements CompletedState { + const Sent({final String? $type}) : $type = $type ?? 'sent'; + factory Sent.fromJson(Map json) => _$SentFromJson(json); @JsonKey(name: 'runtimeType') final String $type; @override - String toString() { - return 'FailedState.sendingFailed()'; + Map toJson() { + return _$SentToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$SendingFailedImpl); + (other.runtimeType == runtimeType && other is Sent); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -1949,128 +615,32 @@ class _$SendingFailedImpl implements SendingFailed { int get hashCode => runtimeType.hashCode; @override - @optionalTypeArgs - TResult when({ - required TResult Function() sendingFailed, - required TResult Function() updatingFailed, - required TResult Function(bool hard) deletingFailed, - }) { - return sendingFailed(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? sendingFailed, - TResult? Function()? updatingFailed, - TResult? Function(bool hard)? deletingFailed, - }) { - return sendingFailed?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? sendingFailed, - TResult Function()? updatingFailed, - TResult Function(bool hard)? deletingFailed, - required TResult orElse(), - }) { - if (sendingFailed != null) { - return sendingFailed(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(SendingFailed value) sendingFailed, - required TResult Function(UpdatingFailed value) updatingFailed, - required TResult Function(DeletingFailed value) deletingFailed, - }) { - return sendingFailed(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(SendingFailed value)? sendingFailed, - TResult? Function(UpdatingFailed value)? updatingFailed, - TResult? Function(DeletingFailed value)? deletingFailed, - }) { - return sendingFailed?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(SendingFailed value)? sendingFailed, - TResult Function(UpdatingFailed value)? updatingFailed, - TResult Function(DeletingFailed value)? deletingFailed, - required TResult orElse(), - }) { - if (sendingFailed != null) { - return sendingFailed(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$SendingFailedImplToJson( - this, - ); + String toString() { + return 'CompletedState.sent()'; } } -abstract class SendingFailed implements FailedState { - const factory SendingFailed() = _$SendingFailedImpl; - - factory SendingFailed.fromJson(Map json) = - _$SendingFailedImpl.fromJson; -} - -/// @nodoc -abstract class _$$UpdatingFailedImplCopyWith<$Res> { - factory _$$UpdatingFailedImplCopyWith(_$UpdatingFailedImpl value, - $Res Function(_$UpdatingFailedImpl) then) = - __$$UpdatingFailedImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$UpdatingFailedImplCopyWithImpl<$Res> - extends _$FailedStateCopyWithImpl<$Res, _$UpdatingFailedImpl> - implements _$$UpdatingFailedImplCopyWith<$Res> { - __$$UpdatingFailedImplCopyWithImpl( - _$UpdatingFailedImpl _value, $Res Function(_$UpdatingFailedImpl) _then) - : super(_value, _then); - - /// Create a copy of FailedState - /// with the given fields replaced by the non-null parameter values. -} - /// @nodoc @JsonSerializable() -class _$UpdatingFailedImpl implements UpdatingFailed { - const _$UpdatingFailedImpl({final String? $type}) - : $type = $type ?? 'updatingFailed'; - - factory _$UpdatingFailedImpl.fromJson(Map json) => - _$$UpdatingFailedImplFromJson(json); +class Updated implements CompletedState { + const Updated({final String? $type}) : $type = $type ?? 'updated'; + factory Updated.fromJson(Map json) => + _$UpdatedFromJson(json); @JsonKey(name: 'runtimeType') final String $type; @override - String toString() { - return 'FailedState.updatingFailed()'; + Map toJson() { + return _$UpdatedToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$UpdatingFailedImpl); + (other.runtimeType == runtimeType && other is Updated); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -2078,250 +648,273 @@ class _$UpdatingFailedImpl implements UpdatingFailed { int get hashCode => runtimeType.hashCode; @override - @optionalTypeArgs - TResult when({ - required TResult Function() sendingFailed, - required TResult Function() updatingFailed, - required TResult Function(bool hard) deletingFailed, - }) { - return updatingFailed(); + String toString() { + return 'CompletedState.updated()'; } +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? sendingFailed, - TResult? Function()? updatingFailed, - TResult? Function(bool hard)? deletingFailed, - }) { - return updatingFailed?.call(); - } +/// @nodoc +@JsonSerializable() +class Deleted implements CompletedState { + const Deleted({this.hard = false, final String? $type}) + : $type = $type ?? 'deleted'; + factory Deleted.fromJson(Map json) => + _$DeletedFromJson(json); - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? sendingFailed, - TResult Function()? updatingFailed, - TResult Function(bool hard)? deletingFailed, - required TResult orElse(), - }) { - if (updatingFailed != null) { - return updatingFailed(); - } - return orElse(); - } + @JsonKey() + final bool hard; + + @JsonKey(name: 'runtimeType') + final String $type; + + /// Create a copy of CompletedState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $DeletedCopyWith get copyWith => + _$DeletedCopyWithImpl(this, _$identity); @override - @optionalTypeArgs - TResult map({ - required TResult Function(SendingFailed value) sendingFailed, - required TResult Function(UpdatingFailed value) updatingFailed, - required TResult Function(DeletingFailed value) deletingFailed, - }) { - return updatingFailed(this); + Map toJson() { + return _$DeletedToJson( + this, + ); } @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(SendingFailed value)? sendingFailed, - TResult? Function(UpdatingFailed value)? updatingFailed, - TResult? Function(DeletingFailed value)? deletingFailed, - }) { - return updatingFailed?.call(this); + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is Deleted && + (identical(other.hard, hard) || other.hard == hard)); } + @JsonKey(includeFromJson: false, includeToJson: false) @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(SendingFailed value)? sendingFailed, - TResult Function(UpdatingFailed value)? updatingFailed, - TResult Function(DeletingFailed value)? deletingFailed, - required TResult orElse(), - }) { - if (updatingFailed != null) { - return updatingFailed(this); - } - return orElse(); - } + int get hashCode => Object.hash(runtimeType, hard); @override - Map toJson() { - return _$$UpdatingFailedImplToJson( - this, - ); + String toString() { + return 'CompletedState.deleted(hard: $hard)'; } } -abstract class UpdatingFailed implements FailedState { - const factory UpdatingFailed() = _$UpdatingFailedImpl; - - factory UpdatingFailed.fromJson(Map json) = - _$UpdatingFailedImpl.fromJson; -} - /// @nodoc -abstract class _$$DeletingFailedImplCopyWith<$Res> { - factory _$$DeletingFailedImplCopyWith(_$DeletingFailedImpl value, - $Res Function(_$DeletingFailedImpl) then) = - __$$DeletingFailedImplCopyWithImpl<$Res>; +abstract mixin class $DeletedCopyWith<$Res> + implements $CompletedStateCopyWith<$Res> { + factory $DeletedCopyWith(Deleted value, $Res Function(Deleted) _then) = + _$DeletedCopyWithImpl; @useResult $Res call({bool hard}); } /// @nodoc -class __$$DeletingFailedImplCopyWithImpl<$Res> - extends _$FailedStateCopyWithImpl<$Res, _$DeletingFailedImpl> - implements _$$DeletingFailedImplCopyWith<$Res> { - __$$DeletingFailedImplCopyWithImpl( - _$DeletingFailedImpl _value, $Res Function(_$DeletingFailedImpl) _then) - : super(_value, _then); +class _$DeletedCopyWithImpl<$Res> implements $DeletedCopyWith<$Res> { + _$DeletedCopyWithImpl(this._self, this._then); - /// Create a copy of FailedState + final Deleted _self; + final $Res Function(Deleted) _then; + + /// Create a copy of CompletedState /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') - @override $Res call({ Object? hard = null, }) { - return _then(_$DeletingFailedImpl( + return _then(Deleted( hard: null == hard - ? _value.hard + ? _self.hard : hard // ignore: cast_nullable_to_non_nullable as bool, )); } } +FailedState _$FailedStateFromJson(Map json) { + switch (json['runtimeType']) { + case 'sendingFailed': + return SendingFailed.fromJson(json); + case 'updatingFailed': + return UpdatingFailed.fromJson(json); + case 'deletingFailed': + return DeletingFailed.fromJson(json); + + default: + throw CheckedFromJsonException(json, 'runtimeType', 'FailedState', + 'Invalid union type "${json['runtimeType']}"!'); + } +} + /// @nodoc -@JsonSerializable() -class _$DeletingFailedImpl implements DeletingFailed { - const _$DeletingFailedImpl({this.hard = false, final String? $type}) - : $type = $type ?? 'deletingFailed'; +mixin _$FailedState { + /// Serializes this FailedState to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is FailedState); + } - factory _$DeletingFailedImpl.fromJson(Map json) => - _$$DeletingFailedImplFromJson(json); + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => runtimeType.hashCode; @override - @JsonKey() - final bool hard; + String toString() { + return 'FailedState()'; + } +} + +/// @nodoc +class $FailedStateCopyWith<$Res> { + $FailedStateCopyWith(FailedState _, $Res Function(FailedState) __); +} + +/// @nodoc +@JsonSerializable() +class SendingFailed implements FailedState { + const SendingFailed({final String? $type}) : $type = $type ?? 'sendingFailed'; + factory SendingFailed.fromJson(Map json) => + _$SendingFailedFromJson(json); @JsonKey(name: 'runtimeType') final String $type; @override - String toString() { - return 'FailedState.deletingFailed(hard: $hard)'; + Map toJson() { + return _$SendingFailedToJson( + this, + ); } @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$DeletingFailedImpl && - (identical(other.hard, hard) || other.hard == hard)); + (other.runtimeType == runtimeType && other is SendingFailed); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, hard); + int get hashCode => runtimeType.hashCode; - /// Create a copy of FailedState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) @override - @pragma('vm:prefer-inline') - _$$DeletingFailedImplCopyWith<_$DeletingFailedImpl> get copyWith => - __$$DeletingFailedImplCopyWithImpl<_$DeletingFailedImpl>( - this, _$identity); + String toString() { + return 'FailedState.sendingFailed()'; + } +} + +/// @nodoc +@JsonSerializable() +class UpdatingFailed implements FailedState { + const UpdatingFailed({final String? $type}) + : $type = $type ?? 'updatingFailed'; + factory UpdatingFailed.fromJson(Map json) => + _$UpdatingFailedFromJson(json); + + @JsonKey(name: 'runtimeType') + final String $type; @override - @optionalTypeArgs - TResult when({ - required TResult Function() sendingFailed, - required TResult Function() updatingFailed, - required TResult Function(bool hard) deletingFailed, - }) { - return deletingFailed(hard); + Map toJson() { + return _$UpdatingFailedToJson( + this, + ); } @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? sendingFailed, - TResult? Function()? updatingFailed, - TResult? Function(bool hard)? deletingFailed, - }) { - return deletingFailed?.call(hard); + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is UpdatingFailed); } + @JsonKey(includeFromJson: false, includeToJson: false) @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? sendingFailed, - TResult Function()? updatingFailed, - TResult Function(bool hard)? deletingFailed, - required TResult orElse(), - }) { - if (deletingFailed != null) { - return deletingFailed(hard); - } - return orElse(); - } + int get hashCode => runtimeType.hashCode; @override - @optionalTypeArgs - TResult map({ - required TResult Function(SendingFailed value) sendingFailed, - required TResult Function(UpdatingFailed value) updatingFailed, - required TResult Function(DeletingFailed value) deletingFailed, - }) { - return deletingFailed(this); + String toString() { + return 'FailedState.updatingFailed()'; } +} + +/// @nodoc +@JsonSerializable() +class DeletingFailed implements FailedState { + const DeletingFailed({this.hard = false, final String? $type}) + : $type = $type ?? 'deletingFailed'; + factory DeletingFailed.fromJson(Map json) => + _$DeletingFailedFromJson(json); + + @JsonKey() + final bool hard; + + @JsonKey(name: 'runtimeType') + final String $type; + + /// Create a copy of FailedState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $DeletingFailedCopyWith get copyWith => + _$DeletingFailedCopyWithImpl(this, _$identity); @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(SendingFailed value)? sendingFailed, - TResult? Function(UpdatingFailed value)? updatingFailed, - TResult? Function(DeletingFailed value)? deletingFailed, - }) { - return deletingFailed?.call(this); + Map toJson() { + return _$DeletingFailedToJson( + this, + ); } @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(SendingFailed value)? sendingFailed, - TResult Function(UpdatingFailed value)? updatingFailed, - TResult Function(DeletingFailed value)? deletingFailed, - required TResult orElse(), - }) { - if (deletingFailed != null) { - return deletingFailed(this); - } - return orElse(); + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is DeletingFailed && + (identical(other.hard, hard) || other.hard == hard)); } + @JsonKey(includeFromJson: false, includeToJson: false) @override - Map toJson() { - return _$$DeletingFailedImplToJson( - this, - ); + int get hashCode => Object.hash(runtimeType, hard); + + @override + String toString() { + return 'FailedState.deletingFailed(hard: $hard)'; } } -abstract class DeletingFailed implements FailedState { - const factory DeletingFailed({final bool hard}) = _$DeletingFailedImpl; +/// @nodoc +abstract mixin class $DeletingFailedCopyWith<$Res> + implements $FailedStateCopyWith<$Res> { + factory $DeletingFailedCopyWith( + DeletingFailed value, $Res Function(DeletingFailed) _then) = + _$DeletingFailedCopyWithImpl; + @useResult + $Res call({bool hard}); +} - factory DeletingFailed.fromJson(Map json) = - _$DeletingFailedImpl.fromJson; +/// @nodoc +class _$DeletingFailedCopyWithImpl<$Res> + implements $DeletingFailedCopyWith<$Res> { + _$DeletingFailedCopyWithImpl(this._self, this._then); - bool get hard; + final DeletingFailed _self; + final $Res Function(DeletingFailed) _then; /// Create a copy of FailedState /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$DeletingFailedImplCopyWith<_$DeletingFailedImpl> get copyWith => - throw _privateConstructorUsedError; + @pragma('vm:prefer-inline') + $Res call({ + Object? hard = null, + }) { + return _then(DeletingFailed( + hard: null == hard + ? _self.hard + : hard // ignore: cast_nullable_to_non_nullable + as bool, + )); + } } + +// dart format on diff --git a/packages/stream_chat/lib/src/core/models/message_state.g.dart b/packages/stream_chat/lib/src/core/models/message_state.g.dart index 7cf2531c8..e39b40667 100644 --- a/packages/stream_chat/lib/src/core/models/message_state.g.dart +++ b/packages/stream_chat/lib/src/core/models/message_state.g.dart @@ -6,151 +6,133 @@ part of 'message_state.dart'; // JsonSerializableGenerator // ************************************************************************** -_$MessageInitialImpl _$$MessageInitialImplFromJson(Map json) => - _$MessageInitialImpl( +MessageInitial _$MessageInitialFromJson(Map json) => + MessageInitial( $type: json['runtimeType'] as String?, ); -Map _$$MessageInitialImplToJson( - _$MessageInitialImpl instance) => +Map _$MessageInitialToJson(MessageInitial instance) => { 'runtimeType': instance.$type, }; -_$MessageOutgoingImpl _$$MessageOutgoingImplFromJson( - Map json) => - _$MessageOutgoingImpl( +MessageOutgoing _$MessageOutgoingFromJson(Map json) => + MessageOutgoing( state: OutgoingState.fromJson(json['state'] as Map), $type: json['runtimeType'] as String?, ); -Map _$$MessageOutgoingImplToJson( - _$MessageOutgoingImpl instance) => +Map _$MessageOutgoingToJson(MessageOutgoing instance) => { 'state': instance.state.toJson(), 'runtimeType': instance.$type, }; -_$MessageCompletedImpl _$$MessageCompletedImplFromJson( - Map json) => - _$MessageCompletedImpl( +MessageCompleted _$MessageCompletedFromJson(Map json) => + MessageCompleted( state: CompletedState.fromJson(json['state'] as Map), $type: json['runtimeType'] as String?, ); -Map _$$MessageCompletedImplToJson( - _$MessageCompletedImpl instance) => +Map _$MessageCompletedToJson(MessageCompleted instance) => { 'state': instance.state.toJson(), 'runtimeType': instance.$type, }; -_$MessageFailedImpl _$$MessageFailedImplFromJson(Map json) => - _$MessageFailedImpl( +MessageFailed _$MessageFailedFromJson(Map json) => + MessageFailed( state: FailedState.fromJson(json['state'] as Map), reason: json['reason'], $type: json['runtimeType'] as String?, ); -Map _$$MessageFailedImplToJson(_$MessageFailedImpl instance) => +Map _$MessageFailedToJson(MessageFailed instance) => { 'state': instance.state.toJson(), 'reason': instance.reason, 'runtimeType': instance.$type, }; -_$SendingImpl _$$SendingImplFromJson(Map json) => - _$SendingImpl( +Sending _$SendingFromJson(Map json) => Sending( $type: json['runtimeType'] as String?, ); -Map _$$SendingImplToJson(_$SendingImpl instance) => - { +Map _$SendingToJson(Sending instance) => { 'runtimeType': instance.$type, }; -_$UpdatingImpl _$$UpdatingImplFromJson(Map json) => - _$UpdatingImpl( +Updating _$UpdatingFromJson(Map json) => Updating( $type: json['runtimeType'] as String?, ); -Map _$$UpdatingImplToJson(_$UpdatingImpl instance) => - { +Map _$UpdatingToJson(Updating instance) => { 'runtimeType': instance.$type, }; -_$DeletingImpl _$$DeletingImplFromJson(Map json) => - _$DeletingImpl( +Deleting _$DeletingFromJson(Map json) => Deleting( hard: json['hard'] as bool? ?? false, $type: json['runtimeType'] as String?, ); -Map _$$DeletingImplToJson(_$DeletingImpl instance) => - { +Map _$DeletingToJson(Deleting instance) => { 'hard': instance.hard, 'runtimeType': instance.$type, }; -_$SentImpl _$$SentImplFromJson(Map json) => _$SentImpl( +Sent _$SentFromJson(Map json) => Sent( $type: json['runtimeType'] as String?, ); -Map _$$SentImplToJson(_$SentImpl instance) => - { +Map _$SentToJson(Sent instance) => { 'runtimeType': instance.$type, }; -_$UpdatedImpl _$$UpdatedImplFromJson(Map json) => - _$UpdatedImpl( +Updated _$UpdatedFromJson(Map json) => Updated( $type: json['runtimeType'] as String?, ); -Map _$$UpdatedImplToJson(_$UpdatedImpl instance) => - { +Map _$UpdatedToJson(Updated instance) => { 'runtimeType': instance.$type, }; -_$DeletedImpl _$$DeletedImplFromJson(Map json) => - _$DeletedImpl( +Deleted _$DeletedFromJson(Map json) => Deleted( hard: json['hard'] as bool? ?? false, $type: json['runtimeType'] as String?, ); -Map _$$DeletedImplToJson(_$DeletedImpl instance) => - { +Map _$DeletedToJson(Deleted instance) => { 'hard': instance.hard, 'runtimeType': instance.$type, }; -_$SendingFailedImpl _$$SendingFailedImplFromJson(Map json) => - _$SendingFailedImpl( +SendingFailed _$SendingFailedFromJson(Map json) => + SendingFailed( $type: json['runtimeType'] as String?, ); -Map _$$SendingFailedImplToJson(_$SendingFailedImpl instance) => +Map _$SendingFailedToJson(SendingFailed instance) => { 'runtimeType': instance.$type, }; -_$UpdatingFailedImpl _$$UpdatingFailedImplFromJson(Map json) => - _$UpdatingFailedImpl( +UpdatingFailed _$UpdatingFailedFromJson(Map json) => + UpdatingFailed( $type: json['runtimeType'] as String?, ); -Map _$$UpdatingFailedImplToJson( - _$UpdatingFailedImpl instance) => +Map _$UpdatingFailedToJson(UpdatingFailed instance) => { 'runtimeType': instance.$type, }; -_$DeletingFailedImpl _$$DeletingFailedImplFromJson(Map json) => - _$DeletingFailedImpl( +DeletingFailed _$DeletingFailedFromJson(Map json) => + DeletingFailed( hard: json['hard'] as bool? ?? false, $type: json['runtimeType'] as String?, ); -Map _$$DeletingFailedImplToJson( - _$DeletingFailedImpl instance) => +Map _$DeletingFailedToJson(DeletingFailed instance) => { 'hard': instance.hard, 'runtimeType': instance.$type, diff --git a/packages/stream_chat/lib/src/core/models/poll_voting_mode.freezed.dart b/packages/stream_chat/lib/src/core/models/poll_voting_mode.freezed.dart index 1545f113a..7353088c2 100644 --- a/packages/stream_chat/lib/src/core/models/poll_voting_mode.freezed.dart +++ b/packages/stream_chat/lib/src/core/models/poll_voting_mode.freezed.dart @@ -1,3 +1,4 @@ +// dart format width=80 // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint @@ -9,585 +10,153 @@ part of 'poll_voting_mode.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(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#adding-getters-and-methods-to-our-models'); - /// @nodoc mixin _$PollVotingMode { - @optionalTypeArgs - TResult when({ - required TResult Function() disabled, - required TResult Function() unique, - required TResult Function(int count) limited, - required TResult Function() all, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? disabled, - TResult? Function()? unique, - TResult? Function(int count)? limited, - TResult? Function()? all, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? disabled, - TResult Function()? unique, - TResult Function(int count)? limited, - TResult Function()? all, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(VotingDisabled value) disabled, - required TResult Function(VotingUnique value) unique, - required TResult Function(VotingLimited value) limited, - required TResult Function(VotingAll value) all, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(VotingDisabled value)? disabled, - TResult? Function(VotingUnique value)? unique, - TResult? Function(VotingLimited value)? limited, - TResult? Function(VotingAll value)? all, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(VotingDisabled value)? disabled, - TResult Function(VotingUnique value)? unique, - TResult Function(VotingLimited value)? limited, - TResult Function(VotingAll value)? all, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $PollVotingModeCopyWith<$Res> { - factory $PollVotingModeCopyWith( - PollVotingMode value, $Res Function(PollVotingMode) then) = - _$PollVotingModeCopyWithImpl<$Res, PollVotingMode>; -} - -/// @nodoc -class _$PollVotingModeCopyWithImpl<$Res, $Val extends PollVotingMode> - implements $PollVotingModeCopyWith<$Res> { - _$PollVotingModeCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PollVotingMode - /// with the given fields replaced by the non-null parameter values. -} - -/// @nodoc -abstract class _$$VotingDisabledImplCopyWith<$Res> { - factory _$$VotingDisabledImplCopyWith(_$VotingDisabledImpl value, - $Res Function(_$VotingDisabledImpl) then) = - __$$VotingDisabledImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$VotingDisabledImplCopyWithImpl<$Res> - extends _$PollVotingModeCopyWithImpl<$Res, _$VotingDisabledImpl> - implements _$$VotingDisabledImplCopyWith<$Res> { - __$$VotingDisabledImplCopyWithImpl( - _$VotingDisabledImpl _value, $Res Function(_$VotingDisabledImpl) _then) - : super(_value, _then); - - /// Create a copy of PollVotingMode - /// with the given fields replaced by the non-null parameter values. -} - -/// @nodoc - -class _$VotingDisabledImpl implements VotingDisabled { - const _$VotingDisabledImpl(); - - @override - String toString() { - return 'PollVotingMode.disabled()'; - } - @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$VotingDisabledImpl); + (other.runtimeType == runtimeType && other is PollVotingMode); } @override int get hashCode => runtimeType.hashCode; @override - @optionalTypeArgs - TResult when({ - required TResult Function() disabled, - required TResult Function() unique, - required TResult Function(int count) limited, - required TResult Function() all, - }) { - return disabled(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? disabled, - TResult? Function()? unique, - TResult? Function(int count)? limited, - TResult? Function()? all, - }) { - return disabled?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? disabled, - TResult Function()? unique, - TResult Function(int count)? limited, - TResult Function()? all, - required TResult orElse(), - }) { - if (disabled != null) { - return disabled(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(VotingDisabled value) disabled, - required TResult Function(VotingUnique value) unique, - required TResult Function(VotingLimited value) limited, - required TResult Function(VotingAll value) all, - }) { - return disabled(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(VotingDisabled value)? disabled, - TResult? Function(VotingUnique value)? unique, - TResult? Function(VotingLimited value)? limited, - TResult? Function(VotingAll value)? all, - }) { - return disabled?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(VotingDisabled value)? disabled, - TResult Function(VotingUnique value)? unique, - TResult Function(VotingLimited value)? limited, - TResult Function(VotingAll value)? all, - required TResult orElse(), - }) { - if (disabled != null) { - return disabled(this); - } - return orElse(); + String toString() { + return 'PollVotingMode()'; } } -abstract class VotingDisabled implements PollVotingMode { - const factory VotingDisabled() = _$VotingDisabledImpl; -} - /// @nodoc -abstract class _$$VotingUniqueImplCopyWith<$Res> { - factory _$$VotingUniqueImplCopyWith( - _$VotingUniqueImpl value, $Res Function(_$VotingUniqueImpl) then) = - __$$VotingUniqueImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$VotingUniqueImplCopyWithImpl<$Res> - extends _$PollVotingModeCopyWithImpl<$Res, _$VotingUniqueImpl> - implements _$$VotingUniqueImplCopyWith<$Res> { - __$$VotingUniqueImplCopyWithImpl( - _$VotingUniqueImpl _value, $Res Function(_$VotingUniqueImpl) _then) - : super(_value, _then); - - /// Create a copy of PollVotingMode - /// with the given fields replaced by the non-null parameter values. +class $PollVotingModeCopyWith<$Res> { + $PollVotingModeCopyWith(PollVotingMode _, $Res Function(PollVotingMode) __); } /// @nodoc -class _$VotingUniqueImpl implements VotingUnique { - const _$VotingUniqueImpl(); - - @override - String toString() { - return 'PollVotingMode.unique()'; - } +class VotingDisabled implements PollVotingMode { + const VotingDisabled(); @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$VotingUniqueImpl); + (other.runtimeType == runtimeType && other is VotingDisabled); } @override int get hashCode => runtimeType.hashCode; @override - @optionalTypeArgs - TResult when({ - required TResult Function() disabled, - required TResult Function() unique, - required TResult Function(int count) limited, - required TResult Function() all, - }) { - return unique(); + String toString() { + return 'PollVotingMode.disabled()'; } +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? disabled, - TResult? Function()? unique, - TResult? Function(int count)? limited, - TResult? Function()? all, - }) { - return unique?.call(); - } +/// @nodoc - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? disabled, - TResult Function()? unique, - TResult Function(int count)? limited, - TResult Function()? all, - required TResult orElse(), - }) { - if (unique != null) { - return unique(); - } - return orElse(); - } +class VotingUnique implements PollVotingMode { + const VotingUnique(); @override - @optionalTypeArgs - TResult map({ - required TResult Function(VotingDisabled value) disabled, - required TResult Function(VotingUnique value) unique, - required TResult Function(VotingLimited value) limited, - required TResult Function(VotingAll value) all, - }) { - return unique(this); + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is VotingUnique); } @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(VotingDisabled value)? disabled, - TResult? Function(VotingUnique value)? unique, - TResult? Function(VotingLimited value)? limited, - TResult? Function(VotingAll value)? all, - }) { - return unique?.call(this); - } + int get hashCode => runtimeType.hashCode; @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(VotingDisabled value)? disabled, - TResult Function(VotingUnique value)? unique, - TResult Function(VotingLimited value)? limited, - TResult Function(VotingAll value)? all, - required TResult orElse(), - }) { - if (unique != null) { - return unique(this); - } - return orElse(); + String toString() { + return 'PollVotingMode.unique()'; } } -abstract class VotingUnique implements PollVotingMode { - const factory VotingUnique() = _$VotingUniqueImpl; -} - /// @nodoc -abstract class _$$VotingLimitedImplCopyWith<$Res> { - factory _$$VotingLimitedImplCopyWith( - _$VotingLimitedImpl value, $Res Function(_$VotingLimitedImpl) then) = - __$$VotingLimitedImplCopyWithImpl<$Res>; - @useResult - $Res call({int count}); -} -/// @nodoc -class __$$VotingLimitedImplCopyWithImpl<$Res> - extends _$PollVotingModeCopyWithImpl<$Res, _$VotingLimitedImpl> - implements _$$VotingLimitedImplCopyWith<$Res> { - __$$VotingLimitedImplCopyWithImpl( - _$VotingLimitedImpl _value, $Res Function(_$VotingLimitedImpl) _then) - : super(_value, _then); +class VotingLimited implements PollVotingMode { + const VotingLimited({required this.count}); + + final int count; /// Create a copy of PollVotingMode /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') - @override - $Res call({ - Object? count = null, - }) { - return _then(_$VotingLimitedImpl( - count: null == count - ? _value.count - : count // ignore: cast_nullable_to_non_nullable - as int, - )); - } -} - -/// @nodoc - -class _$VotingLimitedImpl implements VotingLimited { - const _$VotingLimitedImpl({required this.count}); - - @override - final int count; - - @override - String toString() { - return 'PollVotingMode.limited(count: $count)'; - } + $VotingLimitedCopyWith get copyWith => + _$VotingLimitedCopyWithImpl(this, _$identity); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$VotingLimitedImpl && + other is VotingLimited && (identical(other.count, count) || other.count == count)); } @override int get hashCode => Object.hash(runtimeType, count); - /// Create a copy of PollVotingMode - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$VotingLimitedImplCopyWith<_$VotingLimitedImpl> get copyWith => - __$$VotingLimitedImplCopyWithImpl<_$VotingLimitedImpl>(this, _$identity); - @override - @optionalTypeArgs - TResult when({ - required TResult Function() disabled, - required TResult Function() unique, - required TResult Function(int count) limited, - required TResult Function() all, - }) { - return limited(count); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? disabled, - TResult? Function()? unique, - TResult? Function(int count)? limited, - TResult? Function()? all, - }) { - return limited?.call(count); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? disabled, - TResult Function()? unique, - TResult Function(int count)? limited, - TResult Function()? all, - required TResult orElse(), - }) { - if (limited != null) { - return limited(count); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(VotingDisabled value) disabled, - required TResult Function(VotingUnique value) unique, - required TResult Function(VotingLimited value) limited, - required TResult Function(VotingAll value) all, - }) { - return limited(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(VotingDisabled value)? disabled, - TResult? Function(VotingUnique value)? unique, - TResult? Function(VotingLimited value)? limited, - TResult? Function(VotingAll value)? all, - }) { - return limited?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(VotingDisabled value)? disabled, - TResult Function(VotingUnique value)? unique, - TResult Function(VotingLimited value)? limited, - TResult Function(VotingAll value)? all, - required TResult orElse(), - }) { - if (limited != null) { - return limited(this); - } - return orElse(); + String toString() { + return 'PollVotingMode.limited(count: $count)'; } } -abstract class VotingLimited implements PollVotingMode { - const factory VotingLimited({required final int count}) = _$VotingLimitedImpl; - - int get count; - - /// Create a copy of PollVotingMode - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VotingLimitedImplCopyWith<_$VotingLimitedImpl> get copyWith => - throw _privateConstructorUsedError; -} - /// @nodoc -abstract class _$$VotingAllImplCopyWith<$Res> { - factory _$$VotingAllImplCopyWith( - _$VotingAllImpl value, $Res Function(_$VotingAllImpl) then) = - __$$VotingAllImplCopyWithImpl<$Res>; +abstract mixin class $VotingLimitedCopyWith<$Res> + implements $PollVotingModeCopyWith<$Res> { + factory $VotingLimitedCopyWith( + VotingLimited value, $Res Function(VotingLimited) _then) = + _$VotingLimitedCopyWithImpl; + @useResult + $Res call({int count}); } /// @nodoc -class __$$VotingAllImplCopyWithImpl<$Res> - extends _$PollVotingModeCopyWithImpl<$Res, _$VotingAllImpl> - implements _$$VotingAllImplCopyWith<$Res> { - __$$VotingAllImplCopyWithImpl( - _$VotingAllImpl _value, $Res Function(_$VotingAllImpl) _then) - : super(_value, _then); +class _$VotingLimitedCopyWithImpl<$Res> + implements $VotingLimitedCopyWith<$Res> { + _$VotingLimitedCopyWithImpl(this._self, this._then); + + final VotingLimited _self; + final $Res Function(VotingLimited) _then; /// Create a copy of PollVotingMode /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + $Res call({ + Object? count = null, + }) { + return _then(VotingLimited( + count: null == count + ? _self.count + : count // ignore: cast_nullable_to_non_nullable + as int, + )); + } } /// @nodoc -class _$VotingAllImpl implements VotingAll { - const _$VotingAllImpl(); - - @override - String toString() { - return 'PollVotingMode.all()'; - } +class VotingAll implements PollVotingMode { + const VotingAll(); @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$VotingAllImpl); + (other.runtimeType == runtimeType && other is VotingAll); } @override int get hashCode => runtimeType.hashCode; @override - @optionalTypeArgs - TResult when({ - required TResult Function() disabled, - required TResult Function() unique, - required TResult Function(int count) limited, - required TResult Function() all, - }) { - return all(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? disabled, - TResult? Function()? unique, - TResult? Function(int count)? limited, - TResult? Function()? all, - }) { - return all?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? disabled, - TResult Function()? unique, - TResult Function(int count)? limited, - TResult Function()? all, - required TResult orElse(), - }) { - if (all != null) { - return all(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(VotingDisabled value) disabled, - required TResult Function(VotingUnique value) unique, - required TResult Function(VotingLimited value) limited, - required TResult Function(VotingAll value) all, - }) { - return all(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(VotingDisabled value)? disabled, - TResult? Function(VotingUnique value)? unique, - TResult? Function(VotingLimited value)? limited, - TResult? Function(VotingAll value)? all, - }) { - return all?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(VotingDisabled value)? disabled, - TResult Function(VotingUnique value)? unique, - TResult Function(VotingLimited value)? limited, - TResult Function(VotingAll value)? all, - required TResult orElse(), - }) { - if (all != null) { - return all(this); - } - return orElse(); + String toString() { + return 'PollVotingMode.all()'; } } -abstract class VotingAll implements PollVotingMode { - const factory VotingAll() = _$VotingAllImpl; -} +// dart format on diff --git a/packages/stream_chat_flutter_core/build.yaml b/packages/stream_chat_flutter_core/build.yaml new file mode 100644 index 000000000..58d8c4e17 --- /dev/null +++ b/packages/stream_chat_flutter_core/build.yaml @@ -0,0 +1,7 @@ +targets: + $default: + builders: + freezed: + options: + map: false + when: false \ No newline at end of file