// 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 'preview_target.dart'; // ************************************************************************** // FreezedGenerator // ************************************************************************** // GENERATED CODE - DO NOT MODIFY BY HAND T _$identity(T value) => value; /// @nodoc mixin _$PreviewTargetState implements DiagnosticableTreeMixin { @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties..add(DiagnosticsProperty('type', 'PreviewTargetState')); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is PreviewTargetState); } @override int get hashCode => runtimeType.hashCode; @override String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { return 'PreviewTargetState()'; } } /// @nodoc class $PreviewTargetStateCopyWith<$Res> { $PreviewTargetStateCopyWith( PreviewTargetState _, $Res Function(PreviewTargetState) __, ); } /// Adds pattern-matching-related methods to [PreviewTargetState]. extension PreviewTargetStatePatterns on PreviewTargetState { /// 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(TimelinePreviewTarget value)? timeline, TResult Function(SourcePreviewTarget value)? source, required TResult orElse(), }) { final _that = this; switch (_that) { case TimelinePreviewTarget() when timeline != null: return timeline(_that); case SourcePreviewTarget() when source != null: return source(_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(TimelinePreviewTarget value) timeline, required TResult Function(SourcePreviewTarget value) source, }) { final _that = this; switch (_that) { case TimelinePreviewTarget(): return timeline(_that); case SourcePreviewTarget(): return source(_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(TimelinePreviewTarget value)? timeline, TResult? Function(SourcePreviewTarget value)? source, }) { final _that = this; switch (_that) { case TimelinePreviewTarget() when timeline != null: return timeline(_that); case SourcePreviewTarget() when source != null: return source(_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()? timeline, TResult Function( AssetDocument asset, SourcePreviewController? controller, bool opening, Object? error, )? source, required TResult orElse(), }) { final _that = this; switch (_that) { case TimelinePreviewTarget() when timeline != null: return timeline(); case SourcePreviewTarget() when source != null: return source( _that.asset, _that.controller, _that.opening, _that.error, ); 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() timeline, required TResult Function( AssetDocument asset, SourcePreviewController? controller, bool opening, Object? error, ) source, }) { final _that = this; switch (_that) { case TimelinePreviewTarget(): return timeline(); case SourcePreviewTarget(): return source( _that.asset, _that.controller, _that.opening, _that.error, ); } } /// 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()? timeline, TResult? Function( AssetDocument asset, SourcePreviewController? controller, bool opening, Object? error, )? source, }) { final _that = this; switch (_that) { case TimelinePreviewTarget() when timeline != null: return timeline(); case SourcePreviewTarget() when source != null: return source( _that.asset, _that.controller, _that.opening, _that.error, ); case _: return null; } } } /// @nodoc class TimelinePreviewTarget with DiagnosticableTreeMixin implements PreviewTargetState { const TimelinePreviewTarget(); @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties..add(DiagnosticsProperty('type', 'PreviewTargetState.timeline')); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is TimelinePreviewTarget); } @override int get hashCode => runtimeType.hashCode; @override String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { return 'PreviewTargetState.timeline()'; } } /// @nodoc class SourcePreviewTarget with DiagnosticableTreeMixin implements PreviewTargetState { const SourcePreviewTarget( this.asset, this.controller, { this.opening = true, this.error, }); final AssetDocument asset; final SourcePreviewController? controller; @JsonKey() final bool opening; final Object? error; /// Create a copy of PreviewTargetState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') $SourcePreviewTargetCopyWith get copyWith => _$SourcePreviewTargetCopyWithImpl(this, _$identity); @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { properties ..add(DiagnosticsProperty('type', 'PreviewTargetState.source')) ..add(DiagnosticsProperty('asset', asset)) ..add(DiagnosticsProperty('controller', controller)) ..add(DiagnosticsProperty('opening', opening)) ..add(DiagnosticsProperty('error', error)); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is SourcePreviewTarget && (identical(other.asset, asset) || other.asset == asset) && (identical(other.controller, controller) || other.controller == controller) && (identical(other.opening, opening) || other.opening == opening) && const DeepCollectionEquality().equals(other.error, error)); } @override int get hashCode { return Object.hash( runtimeType, asset, controller, opening, const DeepCollectionEquality().hash(error), ); } @override String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { return 'PreviewTargetState.source(asset: $asset, controller: $controller, opening: $opening, error: $error)'; } } /// @nodoc abstract mixin class $SourcePreviewTargetCopyWith<$Res> implements $PreviewTargetStateCopyWith<$Res> { factory $SourcePreviewTargetCopyWith( SourcePreviewTarget value, $Res Function(SourcePreviewTarget) _then, ) = _$SourcePreviewTargetCopyWithImpl; @useResult $Res call({ AssetDocument asset, SourcePreviewController? controller, bool opening, Object? error, }); } /// @nodoc class _$SourcePreviewTargetCopyWithImpl<$Res> implements $SourcePreviewTargetCopyWith<$Res> { _$SourcePreviewTargetCopyWithImpl(this._self, this._then); final SourcePreviewTarget _self; final $Res Function(SourcePreviewTarget) _then; /// Create a copy of PreviewTargetState /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') $Res call({ Object? asset = null, Object? controller = freezed, Object? opening = null, Object? error = freezed, }) { return _then( SourcePreviewTarget( null == asset ? _self.asset : asset // ignore: cast_nullable_to_non_nullable as AssetDocument, freezed == controller ? _self.controller : controller // ignore: cast_nullable_to_non_nullable as SourcePreviewController?, opening: null == opening ? _self.opening : opening // ignore: cast_nullable_to_non_nullable as bool, error: freezed == error ? _self.error : error, ), ); } }