// GENERATED CODE - DO NOT MODIFY BY HAND // coverage:ignore-file // ignore_for_file: type=lint, type=warning, deprecated_member_use, deprecated_member_use_from_same_package // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark part of 'background_removal_controller.dart'; // ************************************************************************** // FreezedGenerator // ************************************************************************** // GENERATED CODE - DO NOT MODIFY BY HAND T _$identity(T value) => value; /// @nodoc mixin _$BackgroundRemovalState { @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is BackgroundRemovalState); } @override int get hashCode => runtimeType.hashCode; @override String toString() { return 'BackgroundRemovalState()'; } } /// @nodoc class $BackgroundRemovalStateCopyWith<$Res> { $BackgroundRemovalStateCopyWith( BackgroundRemovalState _, $Res Function(BackgroundRemovalState) __, ); } /// Adds pattern-matching-related methods to [BackgroundRemovalState]. extension BackgroundRemovalStatePatterns on BackgroundRemovalState { /// A variant of `map` that fallback to returning `orElse`. /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case final Subclass value: /// return ...; /// case _: /// return orElse(); /// } /// ``` @optionalTypeArgs TResult maybeMap({ TResult Function(RemovalIdle value)? idle, TResult Function(RemovalDownloading value)? downloading, TResult Function(RemovalStarting value)? starting, TResult Function(RemovalStarted value)? started, TResult Function(RemovalCancelled value)? cancelled, TResult Function(RemovalFailed value)? failed, required TResult orElse(), }) { final _that = this; switch (_that) { case RemovalIdle() when idle != null: return idle(_that); case RemovalDownloading() when downloading != null: return downloading(_that); case RemovalStarting() when starting != null: return starting(_that); case RemovalStarted() when started != null: return started(_that); case RemovalCancelled() when cancelled != null: return cancelled(_that); case RemovalFailed() when failed != null: return failed(_that); case _: return orElse(); } } /// A `switch`-like method, using callbacks. /// /// Callbacks receives the raw object, upcasted. /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case final Subclass value: /// return ...; /// case final Subclass2 value: /// return ...; /// } /// ``` @optionalTypeArgs TResult map({ required TResult Function(RemovalIdle value) idle, required TResult Function(RemovalDownloading value) downloading, required TResult Function(RemovalStarting value) starting, required TResult Function(RemovalStarted value) started, required TResult Function(RemovalCancelled value) cancelled, required TResult Function(RemovalFailed value) failed, }) { final _that = this; switch (_that) { case RemovalIdle(): return idle(_that); case RemovalDownloading(): return downloading(_that); case RemovalStarting(): return starting(_that); case RemovalStarted(): return started(_that); case RemovalCancelled(): return cancelled(_that); case RemovalFailed(): return failed(_that); } } /// A variant of `map` that fallback to returning `null`. /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case final Subclass value: /// return ...; /// case _: /// return null; /// } /// ``` @optionalTypeArgs TResult? mapOrNull({ TResult? Function(RemovalIdle value)? idle, TResult? Function(RemovalDownloading value)? downloading, TResult? Function(RemovalStarting value)? starting, TResult? Function(RemovalStarted value)? started, TResult? Function(RemovalCancelled value)? cancelled, TResult? Function(RemovalFailed value)? failed, }) { final _that = this; switch (_that) { case RemovalIdle() when idle != null: return idle(_that); case RemovalDownloading() when downloading != null: return downloading(_that); case RemovalStarting() when starting != null: return starting(_that); case RemovalStarted() when started != null: return started(_that); case RemovalCancelled() when cancelled != null: return cancelled(_that); case RemovalFailed() when failed != null: return failed(_that); case _: return null; } } /// A variant of `when` that fallback to an `orElse` callback. /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case Subclass(:final field): /// return ...; /// case _: /// return orElse(); /// } /// ``` @optionalTypeArgs TResult maybeWhen({ TResult Function()? idle, TResult Function()? downloading, TResult Function()? starting, TResult Function()? started, TResult Function()? cancelled, TResult Function(BackgroundRemovalFailure failure, String? message)? failed, required TResult orElse(), }) { final _that = this; switch (_that) { case RemovalIdle() when idle != null: return idle(); case RemovalDownloading() when downloading != null: return downloading(); case RemovalStarting() when starting != null: return starting(); case RemovalStarted() when started != null: return started(); case RemovalCancelled() when cancelled != null: return cancelled(); case RemovalFailed() when failed != null: return failed(_that.failure, _that.message); case _: return orElse(); } } /// A `switch`-like method, using callbacks. /// /// As opposed to `map`, this offers destructuring. /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case Subclass(:final field): /// return ...; /// case Subclass2(:final field2): /// return ...; /// } /// ``` @optionalTypeArgs TResult when({ required TResult Function() idle, required TResult Function() downloading, required TResult Function() starting, required TResult Function() started, required TResult Function() cancelled, required TResult Function(BackgroundRemovalFailure failure, String? message) failed, }) { final _that = this; switch (_that) { case RemovalIdle(): return idle(); case RemovalDownloading(): return downloading(); case RemovalStarting(): return starting(); case RemovalStarted(): return started(); case RemovalCancelled(): return cancelled(); case RemovalFailed(): return failed(_that.failure, _that.message); } } /// A variant of `when` that fallback to returning `null` /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case Subclass(:final field): /// return ...; /// case _: /// return null; /// } /// ``` @optionalTypeArgs TResult? whenOrNull({ TResult? Function()? idle, TResult? Function()? downloading, TResult? Function()? starting, TResult? Function()? started, TResult? Function()? cancelled, TResult? Function(BackgroundRemovalFailure failure, String? message)? failed, }) { final _that = this; switch (_that) { case RemovalIdle() when idle != null: return idle(); case RemovalDownloading() when downloading != null: return downloading(); case RemovalStarting() when starting != null: return starting(); case RemovalStarted() when started != null: return started(); case RemovalCancelled() when cancelled != null: return cancelled(); case RemovalFailed() when failed != null: return failed(_that.failure, _that.message); case _: return null; } } } /// @nodoc class RemovalIdle implements BackgroundRemovalState { const RemovalIdle(); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is RemovalIdle); } @override int get hashCode => runtimeType.hashCode; @override String toString() { return 'BackgroundRemovalState.idle()'; } } /// @nodoc class RemovalDownloading implements BackgroundRemovalState { const RemovalDownloading(); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is RemovalDownloading); } @override int get hashCode => runtimeType.hashCode; @override String toString() { return 'BackgroundRemovalState.downloading()'; } } /// @nodoc class RemovalStarting implements BackgroundRemovalState { const RemovalStarting(); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is RemovalStarting); } @override int get hashCode => runtimeType.hashCode; @override String toString() { return 'BackgroundRemovalState.starting()'; } } /// @nodoc class RemovalStarted implements BackgroundRemovalState { const RemovalStarted(); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is RemovalStarted); } @override int get hashCode => runtimeType.hashCode; @override String toString() { return 'BackgroundRemovalState.started()'; } } /// @nodoc class RemovalCancelled implements BackgroundRemovalState { const RemovalCancelled(); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is RemovalCancelled); } @override int get hashCode => runtimeType.hashCode; @override String toString() { return 'BackgroundRemovalState.cancelled()'; } } /// @nodoc class RemovalFailed implements BackgroundRemovalState { const RemovalFailed(this.failure, {this.message}); final BackgroundRemovalFailure failure; final String? message; /// Create a copy of BackgroundRemovalState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') $RemovalFailedCopyWith get copyWith => _$RemovalFailedCopyWithImpl(this, _$identity); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is RemovalFailed && (identical(other.failure, failure) || other.failure == failure) && (identical(other.message, message) || other.message == message)); } @override int get hashCode { return Object.hash(runtimeType, failure, message); } @override String toString() { return 'BackgroundRemovalState.failed(failure: $failure, message: $message)'; } } /// @nodoc abstract mixin class $RemovalFailedCopyWith<$Res> implements $BackgroundRemovalStateCopyWith<$Res> { factory $RemovalFailedCopyWith( RemovalFailed value, $Res Function(RemovalFailed) _then, ) = _$RemovalFailedCopyWithImpl; @useResult $Res call({BackgroundRemovalFailure failure, String? message}); } /// @nodoc class _$RemovalFailedCopyWithImpl<$Res> implements $RemovalFailedCopyWith<$Res> { _$RemovalFailedCopyWithImpl(this._self, this._then); final RemovalFailed _self; final $Res Function(RemovalFailed) _then; /// Create a copy of BackgroundRemovalState /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') $Res call({Object? failure = null, Object? message = freezed}) { return _then( RemovalFailed( null == failure ? _self.failure : failure // ignore: cast_nullable_to_non_nullable as BackgroundRemovalFailure, message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable as String?, ), ); } }