Files
cutdex/lib/features/assistant/agent_message_codec.freezed.dart
T
lingjhf 27e77fff39 feat: initial Cutdex application
Add the Flutter video editing application with project management, media
import, timeline editing, preview, AI assistance, diagnostics and settings.

Include shared UI and native host packages, platform runners, application
tests and release tooling.

Provide usage and contribution guides, the MIT license and third-party
notices. Exclude local credentials, build outputs and validation data.
2026-10-05 23:36:23 +08:00

420 lines
12 KiB
Dart

// 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 'agent_message_codec.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// GENERATED CODE - DO NOT MODIFY BY HAND
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$AgentComposerMessage {
String get text;
List<AgentMediaAttachment> get attachments;
List<ComposerSegment> get segments;
/// Create a copy of AgentComposerMessage
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$AgentComposerMessageCopyWith<AgentComposerMessage> get copyWith =>
_$AgentComposerMessageCopyWithImpl<AgentComposerMessage>(
this as AgentComposerMessage,
_$identity,
);
/// Serializes this AgentComposerMessage to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
final _this = this as AgentComposerMessage;
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is AgentComposerMessage &&
(identical(other.text, _this.text) || other.text == _this.text) &&
const DeepCollectionEquality().equals(
other.attachments,
_this.attachments,
) &&
const DeepCollectionEquality().equals(
other.segments,
_this.segments,
));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode {
final _this = this as AgentComposerMessage;
return Object.hash(
runtimeType,
_this.text,
const DeepCollectionEquality().hash(_this.attachments),
const DeepCollectionEquality().hash(_this.segments),
);
}
@override
String toString() {
final _this = this as AgentComposerMessage;
return 'AgentComposerMessage(text: ${_this.text}, attachments: ${_this.attachments}, segments: ${_this.segments})';
}
}
/// @nodoc
abstract mixin class $AgentComposerMessageCopyWith<$Res> {
factory $AgentComposerMessageCopyWith(
AgentComposerMessage value,
$Res Function(AgentComposerMessage) _then,
) = _$AgentComposerMessageCopyWithImpl;
@useResult
$Res call({
String text,
List<AgentMediaAttachment> attachments,
List<ComposerSegment> segments,
});
}
/// @nodoc
class _$AgentComposerMessageCopyWithImpl<$Res>
implements $AgentComposerMessageCopyWith<$Res> {
_$AgentComposerMessageCopyWithImpl(this._self, this._then);
final AgentComposerMessage _self;
final $Res Function(AgentComposerMessage) _then;
/// Create a copy of AgentComposerMessage
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? text = null,
Object? attachments = null,
Object? segments = null,
}) {
return _then(
AgentComposerMessage(
text: null == text
? _self.text
: text // ignore: cast_nullable_to_non_nullable
as String,
attachments: null == attachments
? _self.attachments
: attachments // ignore: cast_nullable_to_non_nullable
as List<AgentMediaAttachment>,
segments: null == segments
? _self.segments
: segments // ignore: cast_nullable_to_non_nullable
as List<ComposerSegment>,
),
);
}
}
/// Adds pattern-matching-related methods to [AgentComposerMessage].
extension AgentComposerMessagePatterns on AgentComposerMessage {
/// 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 extends Object?>(
TResult Function(_AgentComposerMessage value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _AgentComposerMessage() when $default != null:
return $default(_that);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_AgentComposerMessage value) $default,
) {
final _that = this;
switch (_that) {
case _AgentComposerMessage():
return $default(_that);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_AgentComposerMessage value)? $default,
) {
final _that = this;
switch (_that) {
case _AgentComposerMessage() when $default != null:
return $default(_that);
case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function(
String text,
List<AgentMediaAttachment> attachments,
List<ComposerSegment> segments,
)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _AgentComposerMessage() when $default != null:
return $default(_that.text, _that.attachments, _that.segments);
case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs
TResult when<TResult extends Object?>(
TResult Function(
String text,
List<AgentMediaAttachment> attachments,
List<ComposerSegment> segments,
)
$default,
) {
final _that = this;
switch (_that) {
case _AgentComposerMessage():
return $default(_that.text, _that.attachments, _that.segments);
case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function(
String text,
List<AgentMediaAttachment> attachments,
List<ComposerSegment> segments,
)?
$default,
) {
final _that = this;
switch (_that) {
case _AgentComposerMessage() when $default != null:
return $default(_that.text, _that.attachments, _that.segments);
case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _AgentComposerMessage extends AgentComposerMessage {
const _AgentComposerMessage({
required this.text,
required List<AgentMediaAttachment> attachments,
required List<ComposerSegment> segments,
}) : _attachments = attachments,
_segments = segments,
super._();
factory _AgentComposerMessage.fromJson(Map<String, dynamic> json) =>
_$AgentComposerMessageFromJson(json);
@override
final String text;
final List<AgentMediaAttachment> _attachments;
@override
List<AgentMediaAttachment> get attachments {
if (_attachments is EqualUnmodifiableListView) return _attachments;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_attachments);
}
final List<ComposerSegment> _segments;
@override
List<ComposerSegment> get segments {
if (_segments is EqualUnmodifiableListView) return _segments;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_segments);
}
/// Create a copy of AgentComposerMessage
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$AgentComposerMessageCopyWith<_AgentComposerMessage> get copyWith =>
__$AgentComposerMessageCopyWithImpl<_AgentComposerMessage>(
this,
_$identity,
);
@override
Map<String, dynamic> toJson() {
return _$AgentComposerMessageToJson(this);
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _AgentComposerMessage &&
(identical(other.text, text) || other.text == text) &&
const DeepCollectionEquality().equals(
other.attachments,
_attachments,
) &&
const DeepCollectionEquality().equals(other.segments, _segments));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode {
return Object.hash(
runtimeType,
text,
const DeepCollectionEquality().hash(_attachments),
const DeepCollectionEquality().hash(_segments),
);
}
@override
String toString() {
return 'AgentComposerMessage(text: $text, attachments: $attachments, segments: $segments)';
}
}
/// @nodoc
abstract mixin class _$AgentComposerMessageCopyWith<$Res>
implements $AgentComposerMessageCopyWith<$Res> {
factory _$AgentComposerMessageCopyWith(
_AgentComposerMessage value,
$Res Function(_AgentComposerMessage) _then,
) = __$AgentComposerMessageCopyWithImpl;
@override
@useResult
$Res call({
String text,
List<AgentMediaAttachment> attachments,
List<ComposerSegment> segments,
});
}
/// @nodoc
class __$AgentComposerMessageCopyWithImpl<$Res>
implements _$AgentComposerMessageCopyWith<$Res> {
__$AgentComposerMessageCopyWithImpl(this._self, this._then);
final _AgentComposerMessage _self;
final $Res Function(_AgentComposerMessage) _then;
/// Create a copy of AgentComposerMessage
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$Res call({
Object? text = null,
Object? attachments = null,
Object? segments = null,
}) {
return _then(
_AgentComposerMessage(
text: null == text
? _self.text
: text // ignore: cast_nullable_to_non_nullable
as String,
attachments: null == attachments
? _self._attachments
: attachments // ignore: cast_nullable_to_non_nullable
as List<AgentMediaAttachment>,
segments: null == segments
? _self._segments
: segments // ignore: cast_nullable_to_non_nullable
as List<ComposerSegment>,
),
);
}
}