Files

4109 lines
164 KiB
Dart
Raw Permalink Normal View History

2026-07-14 11:11:36 +08:00
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'script_widget.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$ScriptWidgetOption {
String get title;@JsonKey(fromJson: _stringFromAny) String get value;
/// Create a copy of ScriptWidgetOption
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ScriptWidgetOptionCopyWith<ScriptWidgetOption> get copyWith => _$ScriptWidgetOptionCopyWithImpl<ScriptWidgetOption>(this as ScriptWidgetOption, _$identity);
/// Serializes this ScriptWidgetOption to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ScriptWidgetOption&&(identical(other.title, title) || other.title == title)&&(identical(other.value, value) || other.value == value));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,title,value);
@override
String toString() {
return 'ScriptWidgetOption(title: $title, value: $value)';
}
}
/// @nodoc
abstract mixin class $ScriptWidgetOptionCopyWith<$Res> {
factory $ScriptWidgetOptionCopyWith(ScriptWidgetOption value, $Res Function(ScriptWidgetOption) _then) = _$ScriptWidgetOptionCopyWithImpl;
@useResult
$Res call({
String title,@JsonKey(fromJson: _stringFromAny) String value
});
}
/// @nodoc
class _$ScriptWidgetOptionCopyWithImpl<$Res>
implements $ScriptWidgetOptionCopyWith<$Res> {
_$ScriptWidgetOptionCopyWithImpl(this._self, this._then);
final ScriptWidgetOption _self;
final $Res Function(ScriptWidgetOption) _then;
/// Create a copy of ScriptWidgetOption
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? title = null,Object? value = null,}) {
return _then(_self.copyWith(
title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,value: null == value ? _self.value : value // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// Adds pattern-matching-related methods to [ScriptWidgetOption].
extension ScriptWidgetOptionPatterns on ScriptWidgetOption {
/// 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( _ScriptWidgetOption value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ScriptWidgetOption() 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( _ScriptWidgetOption value) $default,){
final _that = this;
switch (_that) {
case _ScriptWidgetOption():
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( _ScriptWidgetOption value)? $default,){
final _that = this;
switch (_that) {
case _ScriptWidgetOption() 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 title, @JsonKey(fromJson: _stringFromAny) String value)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ScriptWidgetOption() when $default != null:
return $default(_that.title,_that.value);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 title, @JsonKey(fromJson: _stringFromAny) String value) $default,) {final _that = this;
switch (_that) {
case _ScriptWidgetOption():
return $default(_that.title,_that.value);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 title, @JsonKey(fromJson: _stringFromAny) String value)? $default,) {final _that = this;
switch (_that) {
case _ScriptWidgetOption() when $default != null:
return $default(_that.title,_that.value);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _ScriptWidgetOption implements ScriptWidgetOption {
const _ScriptWidgetOption({this.title = '', @JsonKey(fromJson: _stringFromAny) this.value = ''});
factory _ScriptWidgetOption.fromJson(Map<String, dynamic> json) => _$ScriptWidgetOptionFromJson(json);
@override@JsonKey() final String title;
@override@JsonKey(fromJson: _stringFromAny) final String value;
/// Create a copy of ScriptWidgetOption
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ScriptWidgetOptionCopyWith<_ScriptWidgetOption> get copyWith => __$ScriptWidgetOptionCopyWithImpl<_ScriptWidgetOption>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ScriptWidgetOptionToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ScriptWidgetOption&&(identical(other.title, title) || other.title == title)&&(identical(other.value, value) || other.value == value));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,title,value);
@override
String toString() {
return 'ScriptWidgetOption(title: $title, value: $value)';
}
}
/// @nodoc
abstract mixin class _$ScriptWidgetOptionCopyWith<$Res> implements $ScriptWidgetOptionCopyWith<$Res> {
factory _$ScriptWidgetOptionCopyWith(_ScriptWidgetOption value, $Res Function(_ScriptWidgetOption) _then) = __$ScriptWidgetOptionCopyWithImpl;
@override @useResult
$Res call({
String title,@JsonKey(fromJson: _stringFromAny) String value
});
}
/// @nodoc
class __$ScriptWidgetOptionCopyWithImpl<$Res>
implements _$ScriptWidgetOptionCopyWith<$Res> {
__$ScriptWidgetOptionCopyWithImpl(this._self, this._then);
final _ScriptWidgetOption _self;
final $Res Function(_ScriptWidgetOption) _then;
/// Create a copy of ScriptWidgetOption
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? title = null,Object? value = null,}) {
return _then(_ScriptWidgetOption(
title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,value: null == value ? _self.value : value // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
mixin _$ScriptWidgetBelongTo {
String get paramName;@JsonKey(fromJson: _stringListFromAny) List<String> get value;
/// Create a copy of ScriptWidgetBelongTo
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ScriptWidgetBelongToCopyWith<ScriptWidgetBelongTo> get copyWith => _$ScriptWidgetBelongToCopyWithImpl<ScriptWidgetBelongTo>(this as ScriptWidgetBelongTo, _$identity);
/// Serializes this ScriptWidgetBelongTo to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ScriptWidgetBelongTo&&(identical(other.paramName, paramName) || other.paramName == paramName)&&const DeepCollectionEquality().equals(other.value, value));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,paramName,const DeepCollectionEquality().hash(value));
@override
String toString() {
return 'ScriptWidgetBelongTo(paramName: $paramName, value: $value)';
}
}
/// @nodoc
abstract mixin class $ScriptWidgetBelongToCopyWith<$Res> {
factory $ScriptWidgetBelongToCopyWith(ScriptWidgetBelongTo value, $Res Function(ScriptWidgetBelongTo) _then) = _$ScriptWidgetBelongToCopyWithImpl;
@useResult
$Res call({
String paramName,@JsonKey(fromJson: _stringListFromAny) List<String> value
});
}
/// @nodoc
class _$ScriptWidgetBelongToCopyWithImpl<$Res>
implements $ScriptWidgetBelongToCopyWith<$Res> {
_$ScriptWidgetBelongToCopyWithImpl(this._self, this._then);
final ScriptWidgetBelongTo _self;
final $Res Function(ScriptWidgetBelongTo) _then;
/// Create a copy of ScriptWidgetBelongTo
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? paramName = null,Object? value = null,}) {
return _then(_self.copyWith(
paramName: null == paramName ? _self.paramName : paramName // ignore: cast_nullable_to_non_nullable
as String,value: null == value ? _self.value : value // ignore: cast_nullable_to_non_nullable
as List<String>,
));
}
}
/// Adds pattern-matching-related methods to [ScriptWidgetBelongTo].
extension ScriptWidgetBelongToPatterns on ScriptWidgetBelongTo {
/// 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( _ScriptWidgetBelongTo value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ScriptWidgetBelongTo() 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( _ScriptWidgetBelongTo value) $default,){
final _that = this;
switch (_that) {
case _ScriptWidgetBelongTo():
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( _ScriptWidgetBelongTo value)? $default,){
final _that = this;
switch (_that) {
case _ScriptWidgetBelongTo() 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 paramName, @JsonKey(fromJson: _stringListFromAny) List<String> value)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ScriptWidgetBelongTo() when $default != null:
return $default(_that.paramName,_that.value);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 paramName, @JsonKey(fromJson: _stringListFromAny) List<String> value) $default,) {final _that = this;
switch (_that) {
case _ScriptWidgetBelongTo():
return $default(_that.paramName,_that.value);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 paramName, @JsonKey(fromJson: _stringListFromAny) List<String> value)? $default,) {final _that = this;
switch (_that) {
case _ScriptWidgetBelongTo() when $default != null:
return $default(_that.paramName,_that.value);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _ScriptWidgetBelongTo implements ScriptWidgetBelongTo {
const _ScriptWidgetBelongTo({this.paramName = '', @JsonKey(fromJson: _stringListFromAny) final List<String> value = const <String>[]}): _value = value;
factory _ScriptWidgetBelongTo.fromJson(Map<String, dynamic> json) => _$ScriptWidgetBelongToFromJson(json);
@override@JsonKey() final String paramName;
final List<String> _value;
@override@JsonKey(fromJson: _stringListFromAny) List<String> get value {
if (_value is EqualUnmodifiableListView) return _value;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_value);
}
/// Create a copy of ScriptWidgetBelongTo
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ScriptWidgetBelongToCopyWith<_ScriptWidgetBelongTo> get copyWith => __$ScriptWidgetBelongToCopyWithImpl<_ScriptWidgetBelongTo>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ScriptWidgetBelongToToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ScriptWidgetBelongTo&&(identical(other.paramName, paramName) || other.paramName == paramName)&&const DeepCollectionEquality().equals(other._value, _value));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,paramName,const DeepCollectionEquality().hash(_value));
@override
String toString() {
return 'ScriptWidgetBelongTo(paramName: $paramName, value: $value)';
}
}
/// @nodoc
abstract mixin class _$ScriptWidgetBelongToCopyWith<$Res> implements $ScriptWidgetBelongToCopyWith<$Res> {
factory _$ScriptWidgetBelongToCopyWith(_ScriptWidgetBelongTo value, $Res Function(_ScriptWidgetBelongTo) _then) = __$ScriptWidgetBelongToCopyWithImpl;
@override @useResult
$Res call({
String paramName,@JsonKey(fromJson: _stringListFromAny) List<String> value
});
}
/// @nodoc
class __$ScriptWidgetBelongToCopyWithImpl<$Res>
implements _$ScriptWidgetBelongToCopyWith<$Res> {
__$ScriptWidgetBelongToCopyWithImpl(this._self, this._then);
final _ScriptWidgetBelongTo _self;
final $Res Function(_ScriptWidgetBelongTo) _then;
/// Create a copy of ScriptWidgetBelongTo
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? paramName = null,Object? value = null,}) {
return _then(_ScriptWidgetBelongTo(
paramName: null == paramName ? _self.paramName : paramName // ignore: cast_nullable_to_non_nullable
as String,value: null == value ? _self._value : value // ignore: cast_nullable_to_non_nullable
as List<String>,
));
}
}
/// @nodoc
mixin _$ScriptWidgetParam {
String get name; String get title; String get type; String get description; Object? get value; ScriptWidgetBelongTo? get belongTo; List<ScriptWidgetOption> get placeholders; List<ScriptWidgetOption> get enumOptions;
/// Create a copy of ScriptWidgetParam
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ScriptWidgetParamCopyWith<ScriptWidgetParam> get copyWith => _$ScriptWidgetParamCopyWithImpl<ScriptWidgetParam>(this as ScriptWidgetParam, _$identity);
/// Serializes this ScriptWidgetParam to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ScriptWidgetParam&&(identical(other.name, name) || other.name == name)&&(identical(other.title, title) || other.title == title)&&(identical(other.type, type) || other.type == type)&&(identical(other.description, description) || other.description == description)&&const DeepCollectionEquality().equals(other.value, value)&&(identical(other.belongTo, belongTo) || other.belongTo == belongTo)&&const DeepCollectionEquality().equals(other.placeholders, placeholders)&&const DeepCollectionEquality().equals(other.enumOptions, enumOptions));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,name,title,type,description,const DeepCollectionEquality().hash(value),belongTo,const DeepCollectionEquality().hash(placeholders),const DeepCollectionEquality().hash(enumOptions));
@override
String toString() {
return 'ScriptWidgetParam(name: $name, title: $title, type: $type, description: $description, value: $value, belongTo: $belongTo, placeholders: $placeholders, enumOptions: $enumOptions)';
}
}
/// @nodoc
abstract mixin class $ScriptWidgetParamCopyWith<$Res> {
factory $ScriptWidgetParamCopyWith(ScriptWidgetParam value, $Res Function(ScriptWidgetParam) _then) = _$ScriptWidgetParamCopyWithImpl;
@useResult
$Res call({
String name, String title, String type, String description, Object? value, ScriptWidgetBelongTo? belongTo, List<ScriptWidgetOption> placeholders, List<ScriptWidgetOption> enumOptions
});
$ScriptWidgetBelongToCopyWith<$Res>? get belongTo;
}
/// @nodoc
class _$ScriptWidgetParamCopyWithImpl<$Res>
implements $ScriptWidgetParamCopyWith<$Res> {
_$ScriptWidgetParamCopyWithImpl(this._self, this._then);
final ScriptWidgetParam _self;
final $Res Function(ScriptWidgetParam) _then;
/// Create a copy of ScriptWidgetParam
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? name = null,Object? title = null,Object? type = null,Object? description = null,Object? value = freezed,Object? belongTo = freezed,Object? placeholders = null,Object? enumOptions = null,}) {
return _then(_self.copyWith(
name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String,value: freezed == value ? _self.value : value ,belongTo: freezed == belongTo ? _self.belongTo : belongTo // ignore: cast_nullable_to_non_nullable
as ScriptWidgetBelongTo?,placeholders: null == placeholders ? _self.placeholders : placeholders // ignore: cast_nullable_to_non_nullable
as List<ScriptWidgetOption>,enumOptions: null == enumOptions ? _self.enumOptions : enumOptions // ignore: cast_nullable_to_non_nullable
as List<ScriptWidgetOption>,
));
}
/// Create a copy of ScriptWidgetParam
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ScriptWidgetBelongToCopyWith<$Res>? get belongTo {
if (_self.belongTo == null) {
return null;
}
return $ScriptWidgetBelongToCopyWith<$Res>(_self.belongTo!, (value) {
return _then(_self.copyWith(belongTo: value));
});
}
}
/// Adds pattern-matching-related methods to [ScriptWidgetParam].
extension ScriptWidgetParamPatterns on ScriptWidgetParam {
/// 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( _ScriptWidgetParam value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ScriptWidgetParam() 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( _ScriptWidgetParam value) $default,){
final _that = this;
switch (_that) {
case _ScriptWidgetParam():
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( _ScriptWidgetParam value)? $default,){
final _that = this;
switch (_that) {
case _ScriptWidgetParam() 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 name, String title, String type, String description, Object? value, ScriptWidgetBelongTo? belongTo, List<ScriptWidgetOption> placeholders, List<ScriptWidgetOption> enumOptions)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ScriptWidgetParam() when $default != null:
return $default(_that.name,_that.title,_that.type,_that.description,_that.value,_that.belongTo,_that.placeholders,_that.enumOptions);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 name, String title, String type, String description, Object? value, ScriptWidgetBelongTo? belongTo, List<ScriptWidgetOption> placeholders, List<ScriptWidgetOption> enumOptions) $default,) {final _that = this;
switch (_that) {
case _ScriptWidgetParam():
return $default(_that.name,_that.title,_that.type,_that.description,_that.value,_that.belongTo,_that.placeholders,_that.enumOptions);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 name, String title, String type, String description, Object? value, ScriptWidgetBelongTo? belongTo, List<ScriptWidgetOption> placeholders, List<ScriptWidgetOption> enumOptions)? $default,) {final _that = this;
switch (_that) {
case _ScriptWidgetParam() when $default != null:
return $default(_that.name,_that.title,_that.type,_that.description,_that.value,_that.belongTo,_that.placeholders,_that.enumOptions);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _ScriptWidgetParam implements ScriptWidgetParam {
const _ScriptWidgetParam({required this.name, this.title = '', this.type = 'input', this.description = '', this.value, this.belongTo, final List<ScriptWidgetOption> placeholders = const <ScriptWidgetOption>[], final List<ScriptWidgetOption> enumOptions = const <ScriptWidgetOption>[]}): _placeholders = placeholders,_enumOptions = enumOptions;
factory _ScriptWidgetParam.fromJson(Map<String, dynamic> json) => _$ScriptWidgetParamFromJson(json);
@override final String name;
@override@JsonKey() final String title;
@override@JsonKey() final String type;
@override@JsonKey() final String description;
@override final Object? value;
@override final ScriptWidgetBelongTo? belongTo;
final List<ScriptWidgetOption> _placeholders;
@override@JsonKey() List<ScriptWidgetOption> get placeholders {
if (_placeholders is EqualUnmodifiableListView) return _placeholders;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_placeholders);
}
final List<ScriptWidgetOption> _enumOptions;
@override@JsonKey() List<ScriptWidgetOption> get enumOptions {
if (_enumOptions is EqualUnmodifiableListView) return _enumOptions;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_enumOptions);
}
/// Create a copy of ScriptWidgetParam
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ScriptWidgetParamCopyWith<_ScriptWidgetParam> get copyWith => __$ScriptWidgetParamCopyWithImpl<_ScriptWidgetParam>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ScriptWidgetParamToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ScriptWidgetParam&&(identical(other.name, name) || other.name == name)&&(identical(other.title, title) || other.title == title)&&(identical(other.type, type) || other.type == type)&&(identical(other.description, description) || other.description == description)&&const DeepCollectionEquality().equals(other.value, value)&&(identical(other.belongTo, belongTo) || other.belongTo == belongTo)&&const DeepCollectionEquality().equals(other._placeholders, _placeholders)&&const DeepCollectionEquality().equals(other._enumOptions, _enumOptions));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,name,title,type,description,const DeepCollectionEquality().hash(value),belongTo,const DeepCollectionEquality().hash(_placeholders),const DeepCollectionEquality().hash(_enumOptions));
@override
String toString() {
return 'ScriptWidgetParam(name: $name, title: $title, type: $type, description: $description, value: $value, belongTo: $belongTo, placeholders: $placeholders, enumOptions: $enumOptions)';
}
}
/// @nodoc
abstract mixin class _$ScriptWidgetParamCopyWith<$Res> implements $ScriptWidgetParamCopyWith<$Res> {
factory _$ScriptWidgetParamCopyWith(_ScriptWidgetParam value, $Res Function(_ScriptWidgetParam) _then) = __$ScriptWidgetParamCopyWithImpl;
@override @useResult
$Res call({
String name, String title, String type, String description, Object? value, ScriptWidgetBelongTo? belongTo, List<ScriptWidgetOption> placeholders, List<ScriptWidgetOption> enumOptions
});
@override $ScriptWidgetBelongToCopyWith<$Res>? get belongTo;
}
/// @nodoc
class __$ScriptWidgetParamCopyWithImpl<$Res>
implements _$ScriptWidgetParamCopyWith<$Res> {
__$ScriptWidgetParamCopyWithImpl(this._self, this._then);
final _ScriptWidgetParam _self;
final $Res Function(_ScriptWidgetParam) _then;
/// Create a copy of ScriptWidgetParam
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? title = null,Object? type = null,Object? description = null,Object? value = freezed,Object? belongTo = freezed,Object? placeholders = null,Object? enumOptions = null,}) {
return _then(_ScriptWidgetParam(
name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String,value: freezed == value ? _self.value : value ,belongTo: freezed == belongTo ? _self.belongTo : belongTo // ignore: cast_nullable_to_non_nullable
as ScriptWidgetBelongTo?,placeholders: null == placeholders ? _self._placeholders : placeholders // ignore: cast_nullable_to_non_nullable
as List<ScriptWidgetOption>,enumOptions: null == enumOptions ? _self._enumOptions : enumOptions // ignore: cast_nullable_to_non_nullable
as List<ScriptWidgetOption>,
));
}
/// Create a copy of ScriptWidgetParam
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ScriptWidgetBelongToCopyWith<$Res>? get belongTo {
if (_self.belongTo == null) {
return null;
}
return $ScriptWidgetBelongToCopyWith<$Res>(_self.belongTo!, (value) {
return _then(_self.copyWith(belongTo: value));
});
}
}
/// @nodoc
mixin _$ScriptWidgetModule {
String get id; String get title; String get description; bool get requiresWebView; String get functionName; bool get sectionMode; int get cacheDuration; String get type; List<ScriptWidgetParam> get params;
/// Create a copy of ScriptWidgetModule
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ScriptWidgetModuleCopyWith<ScriptWidgetModule> get copyWith => _$ScriptWidgetModuleCopyWithImpl<ScriptWidgetModule>(this as ScriptWidgetModule, _$identity);
/// Serializes this ScriptWidgetModule to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ScriptWidgetModule&&(identical(other.id, id) || other.id == id)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.requiresWebView, requiresWebView) || other.requiresWebView == requiresWebView)&&(identical(other.functionName, functionName) || other.functionName == functionName)&&(identical(other.sectionMode, sectionMode) || other.sectionMode == sectionMode)&&(identical(other.cacheDuration, cacheDuration) || other.cacheDuration == cacheDuration)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other.params, params));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,title,description,requiresWebView,functionName,sectionMode,cacheDuration,type,const DeepCollectionEquality().hash(params));
@override
String toString() {
return 'ScriptWidgetModule(id: $id, title: $title, description: $description, requiresWebView: $requiresWebView, functionName: $functionName, sectionMode: $sectionMode, cacheDuration: $cacheDuration, type: $type, params: $params)';
}
}
/// @nodoc
abstract mixin class $ScriptWidgetModuleCopyWith<$Res> {
factory $ScriptWidgetModuleCopyWith(ScriptWidgetModule value, $Res Function(ScriptWidgetModule) _then) = _$ScriptWidgetModuleCopyWithImpl;
@useResult
$Res call({
String id, String title, String description, bool requiresWebView, String functionName, bool sectionMode, int cacheDuration, String type, List<ScriptWidgetParam> params
});
}
/// @nodoc
class _$ScriptWidgetModuleCopyWithImpl<$Res>
implements $ScriptWidgetModuleCopyWith<$Res> {
_$ScriptWidgetModuleCopyWithImpl(this._self, this._then);
final ScriptWidgetModule _self;
final $Res Function(ScriptWidgetModule) _then;
/// Create a copy of ScriptWidgetModule
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? title = null,Object? description = null,Object? requiresWebView = null,Object? functionName = null,Object? sectionMode = null,Object? cacheDuration = null,Object? type = null,Object? params = null,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String,requiresWebView: null == requiresWebView ? _self.requiresWebView : requiresWebView // ignore: cast_nullable_to_non_nullable
as bool,functionName: null == functionName ? _self.functionName : functionName // ignore: cast_nullable_to_non_nullable
as String,sectionMode: null == sectionMode ? _self.sectionMode : sectionMode // ignore: cast_nullable_to_non_nullable
as bool,cacheDuration: null == cacheDuration ? _self.cacheDuration : cacheDuration // ignore: cast_nullable_to_non_nullable
as int,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as String,params: null == params ? _self.params : params // ignore: cast_nullable_to_non_nullable
as List<ScriptWidgetParam>,
));
}
}
/// Adds pattern-matching-related methods to [ScriptWidgetModule].
extension ScriptWidgetModulePatterns on ScriptWidgetModule {
/// 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( _ScriptWidgetModule value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ScriptWidgetModule() 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( _ScriptWidgetModule value) $default,){
final _that = this;
switch (_that) {
case _ScriptWidgetModule():
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( _ScriptWidgetModule value)? $default,){
final _that = this;
switch (_that) {
case _ScriptWidgetModule() 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 id, String title, String description, bool requiresWebView, String functionName, bool sectionMode, int cacheDuration, String type, List<ScriptWidgetParam> params)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ScriptWidgetModule() when $default != null:
return $default(_that.id,_that.title,_that.description,_that.requiresWebView,_that.functionName,_that.sectionMode,_that.cacheDuration,_that.type,_that.params);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 id, String title, String description, bool requiresWebView, String functionName, bool sectionMode, int cacheDuration, String type, List<ScriptWidgetParam> params) $default,) {final _that = this;
switch (_that) {
case _ScriptWidgetModule():
return $default(_that.id,_that.title,_that.description,_that.requiresWebView,_that.functionName,_that.sectionMode,_that.cacheDuration,_that.type,_that.params);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 id, String title, String description, bool requiresWebView, String functionName, bool sectionMode, int cacheDuration, String type, List<ScriptWidgetParam> params)? $default,) {final _that = this;
switch (_that) {
case _ScriptWidgetModule() when $default != null:
return $default(_that.id,_that.title,_that.description,_that.requiresWebView,_that.functionName,_that.sectionMode,_that.cacheDuration,_that.type,_that.params);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _ScriptWidgetModule implements ScriptWidgetModule {
const _ScriptWidgetModule({this.id = '', required this.title, this.description = '', this.requiresWebView = false, required this.functionName, this.sectionMode = false, this.cacheDuration = 3600, this.type = 'list', final List<ScriptWidgetParam> params = const <ScriptWidgetParam>[]}): _params = params;
factory _ScriptWidgetModule.fromJson(Map<String, dynamic> json) => _$ScriptWidgetModuleFromJson(json);
@override@JsonKey() final String id;
@override final String title;
@override@JsonKey() final String description;
@override@JsonKey() final bool requiresWebView;
@override final String functionName;
@override@JsonKey() final bool sectionMode;
@override@JsonKey() final int cacheDuration;
@override@JsonKey() final String type;
final List<ScriptWidgetParam> _params;
@override@JsonKey() List<ScriptWidgetParam> get params {
if (_params is EqualUnmodifiableListView) return _params;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_params);
}
/// Create a copy of ScriptWidgetModule
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ScriptWidgetModuleCopyWith<_ScriptWidgetModule> get copyWith => __$ScriptWidgetModuleCopyWithImpl<_ScriptWidgetModule>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ScriptWidgetModuleToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ScriptWidgetModule&&(identical(other.id, id) || other.id == id)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.requiresWebView, requiresWebView) || other.requiresWebView == requiresWebView)&&(identical(other.functionName, functionName) || other.functionName == functionName)&&(identical(other.sectionMode, sectionMode) || other.sectionMode == sectionMode)&&(identical(other.cacheDuration, cacheDuration) || other.cacheDuration == cacheDuration)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other._params, _params));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,title,description,requiresWebView,functionName,sectionMode,cacheDuration,type,const DeepCollectionEquality().hash(_params));
@override
String toString() {
return 'ScriptWidgetModule(id: $id, title: $title, description: $description, requiresWebView: $requiresWebView, functionName: $functionName, sectionMode: $sectionMode, cacheDuration: $cacheDuration, type: $type, params: $params)';
}
}
/// @nodoc
abstract mixin class _$ScriptWidgetModuleCopyWith<$Res> implements $ScriptWidgetModuleCopyWith<$Res> {
factory _$ScriptWidgetModuleCopyWith(_ScriptWidgetModule value, $Res Function(_ScriptWidgetModule) _then) = __$ScriptWidgetModuleCopyWithImpl;
@override @useResult
$Res call({
String id, String title, String description, bool requiresWebView, String functionName, bool sectionMode, int cacheDuration, String type, List<ScriptWidgetParam> params
});
}
/// @nodoc
class __$ScriptWidgetModuleCopyWithImpl<$Res>
implements _$ScriptWidgetModuleCopyWith<$Res> {
__$ScriptWidgetModuleCopyWithImpl(this._self, this._then);
final _ScriptWidgetModule _self;
final $Res Function(_ScriptWidgetModule) _then;
/// Create a copy of ScriptWidgetModule
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? title = null,Object? description = null,Object? requiresWebView = null,Object? functionName = null,Object? sectionMode = null,Object? cacheDuration = null,Object? type = null,Object? params = null,}) {
return _then(_ScriptWidgetModule(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String,requiresWebView: null == requiresWebView ? _self.requiresWebView : requiresWebView // ignore: cast_nullable_to_non_nullable
as bool,functionName: null == functionName ? _self.functionName : functionName // ignore: cast_nullable_to_non_nullable
as String,sectionMode: null == sectionMode ? _self.sectionMode : sectionMode // ignore: cast_nullable_to_non_nullable
as bool,cacheDuration: null == cacheDuration ? _self.cacheDuration : cacheDuration // ignore: cast_nullable_to_non_nullable
as int,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as String,params: null == params ? _self._params : params // ignore: cast_nullable_to_non_nullable
as List<ScriptWidgetParam>,
));
}
}
/// @nodoc
mixin _$ScriptWidgetManifest {
String get id; String get title; String get description; String get author; String get site; String get version; String get requiredVersion; int get detailCacheDuration; List<ScriptWidgetParam> get globalParams; List<ScriptWidgetModule> get modules; ScriptWidgetModule? get search;
/// Create a copy of ScriptWidgetManifest
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ScriptWidgetManifestCopyWith<ScriptWidgetManifest> get copyWith => _$ScriptWidgetManifestCopyWithImpl<ScriptWidgetManifest>(this as ScriptWidgetManifest, _$identity);
/// Serializes this ScriptWidgetManifest to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ScriptWidgetManifest&&(identical(other.id, id) || other.id == id)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.author, author) || other.author == author)&&(identical(other.site, site) || other.site == site)&&(identical(other.version, version) || other.version == version)&&(identical(other.requiredVersion, requiredVersion) || other.requiredVersion == requiredVersion)&&(identical(other.detailCacheDuration, detailCacheDuration) || other.detailCacheDuration == detailCacheDuration)&&const DeepCollectionEquality().equals(other.globalParams, globalParams)&&const DeepCollectionEquality().equals(other.modules, modules)&&(identical(other.search, search) || other.search == search));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,title,description,author,site,version,requiredVersion,detailCacheDuration,const DeepCollectionEquality().hash(globalParams),const DeepCollectionEquality().hash(modules),search);
@override
String toString() {
return 'ScriptWidgetManifest(id: $id, title: $title, description: $description, author: $author, site: $site, version: $version, requiredVersion: $requiredVersion, detailCacheDuration: $detailCacheDuration, globalParams: $globalParams, modules: $modules, search: $search)';
}
}
/// @nodoc
abstract mixin class $ScriptWidgetManifestCopyWith<$Res> {
factory $ScriptWidgetManifestCopyWith(ScriptWidgetManifest value, $Res Function(ScriptWidgetManifest) _then) = _$ScriptWidgetManifestCopyWithImpl;
@useResult
$Res call({
String id, String title, String description, String author, String site, String version, String requiredVersion, int detailCacheDuration, List<ScriptWidgetParam> globalParams, List<ScriptWidgetModule> modules, ScriptWidgetModule? search
});
$ScriptWidgetModuleCopyWith<$Res>? get search;
}
/// @nodoc
class _$ScriptWidgetManifestCopyWithImpl<$Res>
implements $ScriptWidgetManifestCopyWith<$Res> {
_$ScriptWidgetManifestCopyWithImpl(this._self, this._then);
final ScriptWidgetManifest _self;
final $Res Function(ScriptWidgetManifest) _then;
/// Create a copy of ScriptWidgetManifest
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? title = null,Object? description = null,Object? author = null,Object? site = null,Object? version = null,Object? requiredVersion = null,Object? detailCacheDuration = null,Object? globalParams = null,Object? modules = null,Object? search = freezed,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String,author: null == author ? _self.author : author // ignore: cast_nullable_to_non_nullable
as String,site: null == site ? _self.site : site // ignore: cast_nullable_to_non_nullable
as String,version: null == version ? _self.version : version // ignore: cast_nullable_to_non_nullable
as String,requiredVersion: null == requiredVersion ? _self.requiredVersion : requiredVersion // ignore: cast_nullable_to_non_nullable
as String,detailCacheDuration: null == detailCacheDuration ? _self.detailCacheDuration : detailCacheDuration // ignore: cast_nullable_to_non_nullable
as int,globalParams: null == globalParams ? _self.globalParams : globalParams // ignore: cast_nullable_to_non_nullable
as List<ScriptWidgetParam>,modules: null == modules ? _self.modules : modules // ignore: cast_nullable_to_non_nullable
as List<ScriptWidgetModule>,search: freezed == search ? _self.search : search // ignore: cast_nullable_to_non_nullable
as ScriptWidgetModule?,
));
}
/// Create a copy of ScriptWidgetManifest
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ScriptWidgetModuleCopyWith<$Res>? get search {
if (_self.search == null) {
return null;
}
return $ScriptWidgetModuleCopyWith<$Res>(_self.search!, (value) {
return _then(_self.copyWith(search: value));
});
}
}
/// Adds pattern-matching-related methods to [ScriptWidgetManifest].
extension ScriptWidgetManifestPatterns on ScriptWidgetManifest {
/// 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( _ScriptWidgetManifest value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ScriptWidgetManifest() 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( _ScriptWidgetManifest value) $default,){
final _that = this;
switch (_that) {
case _ScriptWidgetManifest():
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( _ScriptWidgetManifest value)? $default,){
final _that = this;
switch (_that) {
case _ScriptWidgetManifest() 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 id, String title, String description, String author, String site, String version, String requiredVersion, int detailCacheDuration, List<ScriptWidgetParam> globalParams, List<ScriptWidgetModule> modules, ScriptWidgetModule? search)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ScriptWidgetManifest() when $default != null:
return $default(_that.id,_that.title,_that.description,_that.author,_that.site,_that.version,_that.requiredVersion,_that.detailCacheDuration,_that.globalParams,_that.modules,_that.search);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 id, String title, String description, String author, String site, String version, String requiredVersion, int detailCacheDuration, List<ScriptWidgetParam> globalParams, List<ScriptWidgetModule> modules, ScriptWidgetModule? search) $default,) {final _that = this;
switch (_that) {
case _ScriptWidgetManifest():
return $default(_that.id,_that.title,_that.description,_that.author,_that.site,_that.version,_that.requiredVersion,_that.detailCacheDuration,_that.globalParams,_that.modules,_that.search);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 id, String title, String description, String author, String site, String version, String requiredVersion, int detailCacheDuration, List<ScriptWidgetParam> globalParams, List<ScriptWidgetModule> modules, ScriptWidgetModule? search)? $default,) {final _that = this;
switch (_that) {
case _ScriptWidgetManifest() when $default != null:
return $default(_that.id,_that.title,_that.description,_that.author,_that.site,_that.version,_that.requiredVersion,_that.detailCacheDuration,_that.globalParams,_that.modules,_that.search);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _ScriptWidgetManifest implements ScriptWidgetManifest {
const _ScriptWidgetManifest({required this.id, required this.title, this.description = '', this.author = '', this.site = '', this.version = '0.0.0', this.requiredVersion = '0.0.1', this.detailCacheDuration = 60, final List<ScriptWidgetParam> globalParams = const <ScriptWidgetParam>[], final List<ScriptWidgetModule> modules = const <ScriptWidgetModule>[], this.search}): _globalParams = globalParams,_modules = modules;
factory _ScriptWidgetManifest.fromJson(Map<String, dynamic> json) => _$ScriptWidgetManifestFromJson(json);
@override final String id;
@override final String title;
@override@JsonKey() final String description;
@override@JsonKey() final String author;
@override@JsonKey() final String site;
@override@JsonKey() final String version;
@override@JsonKey() final String requiredVersion;
@override@JsonKey() final int detailCacheDuration;
final List<ScriptWidgetParam> _globalParams;
@override@JsonKey() List<ScriptWidgetParam> get globalParams {
if (_globalParams is EqualUnmodifiableListView) return _globalParams;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_globalParams);
}
final List<ScriptWidgetModule> _modules;
@override@JsonKey() List<ScriptWidgetModule> get modules {
if (_modules is EqualUnmodifiableListView) return _modules;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_modules);
}
@override final ScriptWidgetModule? search;
/// Create a copy of ScriptWidgetManifest
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ScriptWidgetManifestCopyWith<_ScriptWidgetManifest> get copyWith => __$ScriptWidgetManifestCopyWithImpl<_ScriptWidgetManifest>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ScriptWidgetManifestToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ScriptWidgetManifest&&(identical(other.id, id) || other.id == id)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.author, author) || other.author == author)&&(identical(other.site, site) || other.site == site)&&(identical(other.version, version) || other.version == version)&&(identical(other.requiredVersion, requiredVersion) || other.requiredVersion == requiredVersion)&&(identical(other.detailCacheDuration, detailCacheDuration) || other.detailCacheDuration == detailCacheDuration)&&const DeepCollectionEquality().equals(other._globalParams, _globalParams)&&const DeepCollectionEquality().equals(other._modules, _modules)&&(identical(other.search, search) || other.search == search));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,title,description,author,site,version,requiredVersion,detailCacheDuration,const DeepCollectionEquality().hash(_globalParams),const DeepCollectionEquality().hash(_modules),search);
@override
String toString() {
return 'ScriptWidgetManifest(id: $id, title: $title, description: $description, author: $author, site: $site, version: $version, requiredVersion: $requiredVersion, detailCacheDuration: $detailCacheDuration, globalParams: $globalParams, modules: $modules, search: $search)';
}
}
/// @nodoc
abstract mixin class _$ScriptWidgetManifestCopyWith<$Res> implements $ScriptWidgetManifestCopyWith<$Res> {
factory _$ScriptWidgetManifestCopyWith(_ScriptWidgetManifest value, $Res Function(_ScriptWidgetManifest) _then) = __$ScriptWidgetManifestCopyWithImpl;
@override @useResult
$Res call({
String id, String title, String description, String author, String site, String version, String requiredVersion, int detailCacheDuration, List<ScriptWidgetParam> globalParams, List<ScriptWidgetModule> modules, ScriptWidgetModule? search
});
@override $ScriptWidgetModuleCopyWith<$Res>? get search;
}
/// @nodoc
class __$ScriptWidgetManifestCopyWithImpl<$Res>
implements _$ScriptWidgetManifestCopyWith<$Res> {
__$ScriptWidgetManifestCopyWithImpl(this._self, this._then);
final _ScriptWidgetManifest _self;
final $Res Function(_ScriptWidgetManifest) _then;
/// Create a copy of ScriptWidgetManifest
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? title = null,Object? description = null,Object? author = null,Object? site = null,Object? version = null,Object? requiredVersion = null,Object? detailCacheDuration = null,Object? globalParams = null,Object? modules = null,Object? search = freezed,}) {
return _then(_ScriptWidgetManifest(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String,author: null == author ? _self.author : author // ignore: cast_nullable_to_non_nullable
as String,site: null == site ? _self.site : site // ignore: cast_nullable_to_non_nullable
as String,version: null == version ? _self.version : version // ignore: cast_nullable_to_non_nullable
as String,requiredVersion: null == requiredVersion ? _self.requiredVersion : requiredVersion // ignore: cast_nullable_to_non_nullable
as String,detailCacheDuration: null == detailCacheDuration ? _self.detailCacheDuration : detailCacheDuration // ignore: cast_nullable_to_non_nullable
as int,globalParams: null == globalParams ? _self._globalParams : globalParams // ignore: cast_nullable_to_non_nullable
as List<ScriptWidgetParam>,modules: null == modules ? _self._modules : modules // ignore: cast_nullable_to_non_nullable
as List<ScriptWidgetModule>,search: freezed == search ? _self.search : search // ignore: cast_nullable_to_non_nullable
as ScriptWidgetModule?,
));
}
/// Create a copy of ScriptWidgetManifest
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ScriptWidgetModuleCopyWith<$Res>? get search {
if (_self.search == null) {
return null;
}
return $ScriptWidgetModuleCopyWith<$Res>(_self.search!, (value) {
return _then(_self.copyWith(search: value));
});
}
}
/// @nodoc
mixin _$ScriptVideoPerson {
@JsonKey(fromJson: _stringFromAny) String get id; String get title; String get avatar; String get role;
/// Create a copy of ScriptVideoPerson
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ScriptVideoPersonCopyWith<ScriptVideoPerson> get copyWith => _$ScriptVideoPersonCopyWithImpl<ScriptVideoPerson>(this as ScriptVideoPerson, _$identity);
/// Serializes this ScriptVideoPerson to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ScriptVideoPerson&&(identical(other.id, id) || other.id == id)&&(identical(other.title, title) || other.title == title)&&(identical(other.avatar, avatar) || other.avatar == avatar)&&(identical(other.role, role) || other.role == role));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,title,avatar,role);
@override
String toString() {
return 'ScriptVideoPerson(id: $id, title: $title, avatar: $avatar, role: $role)';
}
}
/// @nodoc
abstract mixin class $ScriptVideoPersonCopyWith<$Res> {
factory $ScriptVideoPersonCopyWith(ScriptVideoPerson value, $Res Function(ScriptVideoPerson) _then) = _$ScriptVideoPersonCopyWithImpl;
@useResult
$Res call({
@JsonKey(fromJson: _stringFromAny) String id, String title, String avatar, String role
});
}
/// @nodoc
class _$ScriptVideoPersonCopyWithImpl<$Res>
implements $ScriptVideoPersonCopyWith<$Res> {
_$ScriptVideoPersonCopyWithImpl(this._self, this._then);
final ScriptVideoPerson _self;
final $Res Function(ScriptVideoPerson) _then;
/// Create a copy of ScriptVideoPerson
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? title = null,Object? avatar = null,Object? role = null,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,avatar: null == avatar ? _self.avatar : avatar // ignore: cast_nullable_to_non_nullable
as String,role: null == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// Adds pattern-matching-related methods to [ScriptVideoPerson].
extension ScriptVideoPersonPatterns on ScriptVideoPerson {
/// 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( _ScriptVideoPerson value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ScriptVideoPerson() 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( _ScriptVideoPerson value) $default,){
final _that = this;
switch (_that) {
case _ScriptVideoPerson():
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( _ScriptVideoPerson value)? $default,){
final _that = this;
switch (_that) {
case _ScriptVideoPerson() 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(@JsonKey(fromJson: _stringFromAny) String id, String title, String avatar, String role)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ScriptVideoPerson() when $default != null:
return $default(_that.id,_that.title,_that.avatar,_that.role);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(@JsonKey(fromJson: _stringFromAny) String id, String title, String avatar, String role) $default,) {final _that = this;
switch (_that) {
case _ScriptVideoPerson():
return $default(_that.id,_that.title,_that.avatar,_that.role);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(@JsonKey(fromJson: _stringFromAny) String id, String title, String avatar, String role)? $default,) {final _that = this;
switch (_that) {
case _ScriptVideoPerson() when $default != null:
return $default(_that.id,_that.title,_that.avatar,_that.role);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _ScriptVideoPerson implements ScriptVideoPerson {
const _ScriptVideoPerson({@JsonKey(fromJson: _stringFromAny) this.id = '', this.title = '', this.avatar = '', this.role = ''});
factory _ScriptVideoPerson.fromJson(Map<String, dynamic> json) => _$ScriptVideoPersonFromJson(json);
@override@JsonKey(fromJson: _stringFromAny) final String id;
@override@JsonKey() final String title;
@override@JsonKey() final String avatar;
@override@JsonKey() final String role;
/// Create a copy of ScriptVideoPerson
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ScriptVideoPersonCopyWith<_ScriptVideoPerson> get copyWith => __$ScriptVideoPersonCopyWithImpl<_ScriptVideoPerson>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ScriptVideoPersonToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ScriptVideoPerson&&(identical(other.id, id) || other.id == id)&&(identical(other.title, title) || other.title == title)&&(identical(other.avatar, avatar) || other.avatar == avatar)&&(identical(other.role, role) || other.role == role));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,title,avatar,role);
@override
String toString() {
return 'ScriptVideoPerson(id: $id, title: $title, avatar: $avatar, role: $role)';
}
}
/// @nodoc
abstract mixin class _$ScriptVideoPersonCopyWith<$Res> implements $ScriptVideoPersonCopyWith<$Res> {
factory _$ScriptVideoPersonCopyWith(_ScriptVideoPerson value, $Res Function(_ScriptVideoPerson) _then) = __$ScriptVideoPersonCopyWithImpl;
@override @useResult
$Res call({
@JsonKey(fromJson: _stringFromAny) String id, String title, String avatar, String role
});
}
/// @nodoc
class __$ScriptVideoPersonCopyWithImpl<$Res>
implements _$ScriptVideoPersonCopyWith<$Res> {
__$ScriptVideoPersonCopyWithImpl(this._self, this._then);
final _ScriptVideoPerson _self;
final $Res Function(_ScriptVideoPerson) _then;
/// Create a copy of ScriptVideoPerson
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? title = null,Object? avatar = null,Object? role = null,}) {
return _then(_ScriptVideoPerson(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,avatar: null == avatar ? _self.avatar : avatar // ignore: cast_nullable_to_non_nullable
as String,role: null == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
mixin _$ScriptVideoGenre {
@JsonKey(fromJson: _stringFromAny) String get id; String get title;
/// Create a copy of ScriptVideoGenre
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ScriptVideoGenreCopyWith<ScriptVideoGenre> get copyWith => _$ScriptVideoGenreCopyWithImpl<ScriptVideoGenre>(this as ScriptVideoGenre, _$identity);
/// Serializes this ScriptVideoGenre to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ScriptVideoGenre&&(identical(other.id, id) || other.id == id)&&(identical(other.title, title) || other.title == title));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,title);
@override
String toString() {
return 'ScriptVideoGenre(id: $id, title: $title)';
}
}
/// @nodoc
abstract mixin class $ScriptVideoGenreCopyWith<$Res> {
factory $ScriptVideoGenreCopyWith(ScriptVideoGenre value, $Res Function(ScriptVideoGenre) _then) = _$ScriptVideoGenreCopyWithImpl;
@useResult
$Res call({
@JsonKey(fromJson: _stringFromAny) String id, String title
});
}
/// @nodoc
class _$ScriptVideoGenreCopyWithImpl<$Res>
implements $ScriptVideoGenreCopyWith<$Res> {
_$ScriptVideoGenreCopyWithImpl(this._self, this._then);
final ScriptVideoGenre _self;
final $Res Function(ScriptVideoGenre) _then;
/// Create a copy of ScriptVideoGenre
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? title = null,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// Adds pattern-matching-related methods to [ScriptVideoGenre].
extension ScriptVideoGenrePatterns on ScriptVideoGenre {
/// 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( _ScriptVideoGenre value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ScriptVideoGenre() 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( _ScriptVideoGenre value) $default,){
final _that = this;
switch (_that) {
case _ScriptVideoGenre():
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( _ScriptVideoGenre value)? $default,){
final _that = this;
switch (_that) {
case _ScriptVideoGenre() 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(@JsonKey(fromJson: _stringFromAny) String id, String title)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ScriptVideoGenre() when $default != null:
return $default(_that.id,_that.title);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(@JsonKey(fromJson: _stringFromAny) String id, String title) $default,) {final _that = this;
switch (_that) {
case _ScriptVideoGenre():
return $default(_that.id,_that.title);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(@JsonKey(fromJson: _stringFromAny) String id, String title)? $default,) {final _that = this;
switch (_that) {
case _ScriptVideoGenre() when $default != null:
return $default(_that.id,_that.title);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _ScriptVideoGenre implements ScriptVideoGenre {
const _ScriptVideoGenre({@JsonKey(fromJson: _stringFromAny) this.id = '', this.title = ''});
factory _ScriptVideoGenre.fromJson(Map<String, dynamic> json) => _$ScriptVideoGenreFromJson(json);
@override@JsonKey(fromJson: _stringFromAny) final String id;
@override@JsonKey() final String title;
/// Create a copy of ScriptVideoGenre
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ScriptVideoGenreCopyWith<_ScriptVideoGenre> get copyWith => __$ScriptVideoGenreCopyWithImpl<_ScriptVideoGenre>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ScriptVideoGenreToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ScriptVideoGenre&&(identical(other.id, id) || other.id == id)&&(identical(other.title, title) || other.title == title));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,title);
@override
String toString() {
return 'ScriptVideoGenre(id: $id, title: $title)';
}
}
/// @nodoc
abstract mixin class _$ScriptVideoGenreCopyWith<$Res> implements $ScriptVideoGenreCopyWith<$Res> {
factory _$ScriptVideoGenreCopyWith(_ScriptVideoGenre value, $Res Function(_ScriptVideoGenre) _then) = __$ScriptVideoGenreCopyWithImpl;
@override @useResult
$Res call({
@JsonKey(fromJson: _stringFromAny) String id, String title
});
}
/// @nodoc
class __$ScriptVideoGenreCopyWithImpl<$Res>
implements _$ScriptVideoGenreCopyWith<$Res> {
__$ScriptVideoGenreCopyWithImpl(this._self, this._then);
final _ScriptVideoGenre _self;
final $Res Function(_ScriptVideoGenre) _then;
/// Create a copy of ScriptVideoGenre
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? title = null,}) {
return _then(_ScriptVideoGenre(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
mixin _$ScriptVideoTrailer {
String get coverUrl; String get url;
/// Create a copy of ScriptVideoTrailer
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ScriptVideoTrailerCopyWith<ScriptVideoTrailer> get copyWith => _$ScriptVideoTrailerCopyWithImpl<ScriptVideoTrailer>(this as ScriptVideoTrailer, _$identity);
/// Serializes this ScriptVideoTrailer to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ScriptVideoTrailer&&(identical(other.coverUrl, coverUrl) || other.coverUrl == coverUrl)&&(identical(other.url, url) || other.url == url));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,coverUrl,url);
@override
String toString() {
return 'ScriptVideoTrailer(coverUrl: $coverUrl, url: $url)';
}
}
/// @nodoc
abstract mixin class $ScriptVideoTrailerCopyWith<$Res> {
factory $ScriptVideoTrailerCopyWith(ScriptVideoTrailer value, $Res Function(ScriptVideoTrailer) _then) = _$ScriptVideoTrailerCopyWithImpl;
@useResult
$Res call({
String coverUrl, String url
});
}
/// @nodoc
class _$ScriptVideoTrailerCopyWithImpl<$Res>
implements $ScriptVideoTrailerCopyWith<$Res> {
_$ScriptVideoTrailerCopyWithImpl(this._self, this._then);
final ScriptVideoTrailer _self;
final $Res Function(ScriptVideoTrailer) _then;
/// Create a copy of ScriptVideoTrailer
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? coverUrl = null,Object? url = null,}) {
return _then(_self.copyWith(
coverUrl: null == coverUrl ? _self.coverUrl : coverUrl // ignore: cast_nullable_to_non_nullable
as String,url: null == url ? _self.url : url // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// Adds pattern-matching-related methods to [ScriptVideoTrailer].
extension ScriptVideoTrailerPatterns on ScriptVideoTrailer {
/// 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( _ScriptVideoTrailer value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ScriptVideoTrailer() 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( _ScriptVideoTrailer value) $default,){
final _that = this;
switch (_that) {
case _ScriptVideoTrailer():
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( _ScriptVideoTrailer value)? $default,){
final _that = this;
switch (_that) {
case _ScriptVideoTrailer() 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 coverUrl, String url)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ScriptVideoTrailer() when $default != null:
return $default(_that.coverUrl,_that.url);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 coverUrl, String url) $default,) {final _that = this;
switch (_that) {
case _ScriptVideoTrailer():
return $default(_that.coverUrl,_that.url);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 coverUrl, String url)? $default,) {final _that = this;
switch (_that) {
case _ScriptVideoTrailer() when $default != null:
return $default(_that.coverUrl,_that.url);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _ScriptVideoTrailer implements ScriptVideoTrailer {
const _ScriptVideoTrailer({this.coverUrl = '', this.url = ''});
factory _ScriptVideoTrailer.fromJson(Map<String, dynamic> json) => _$ScriptVideoTrailerFromJson(json);
@override@JsonKey() final String coverUrl;
@override@JsonKey() final String url;
/// Create a copy of ScriptVideoTrailer
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ScriptVideoTrailerCopyWith<_ScriptVideoTrailer> get copyWith => __$ScriptVideoTrailerCopyWithImpl<_ScriptVideoTrailer>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ScriptVideoTrailerToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ScriptVideoTrailer&&(identical(other.coverUrl, coverUrl) || other.coverUrl == coverUrl)&&(identical(other.url, url) || other.url == url));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,coverUrl,url);
@override
String toString() {
return 'ScriptVideoTrailer(coverUrl: $coverUrl, url: $url)';
}
}
/// @nodoc
abstract mixin class _$ScriptVideoTrailerCopyWith<$Res> implements $ScriptVideoTrailerCopyWith<$Res> {
factory _$ScriptVideoTrailerCopyWith(_ScriptVideoTrailer value, $Res Function(_ScriptVideoTrailer) _then) = __$ScriptVideoTrailerCopyWithImpl;
@override @useResult
$Res call({
String coverUrl, String url
});
}
/// @nodoc
class __$ScriptVideoTrailerCopyWithImpl<$Res>
implements _$ScriptVideoTrailerCopyWith<$Res> {
__$ScriptVideoTrailerCopyWithImpl(this._self, this._then);
final _ScriptVideoTrailer _self;
final $Res Function(_ScriptVideoTrailer) _then;
/// Create a copy of ScriptVideoTrailer
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? coverUrl = null,Object? url = null,}) {
return _then(_ScriptVideoTrailer(
coverUrl: null == coverUrl ? _self.coverUrl : coverUrl // ignore: cast_nullable_to_non_nullable
as String,url: null == url ? _self.url : url // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
mixin _$ScriptVideoItem {
@JsonKey(fromJson: _stringFromAny) String get id; String get type; String get title; String get coverUrl;@JsonKey(readValue: _readPosterPath) String get posterPath; String get detailPoster; String get backdropPath; List<String> get backdropPaths; String get releaseDate; String get mediaType;@JsonKey(fromJson: _doubleFromAny) double? get rating; String get genreTitle; List<ScriptVideoGenre> get genreItems; List<ScriptVideoPerson> get peoples;@JsonKey(fromJson: _intFromAny) int? get duration; String get durationText; String get previewUrl; List<ScriptVideoTrailer> get trailers; String get videoUrl; String get link;@JsonKey(fromJson: _intFromAny) int? get episode; String get description; String get playerType; List<ScriptVideoItem> get childItems; List<ScriptVideoItem> get episodeItems; List<ScriptVideoItem> get relatedItems;
/// Create a copy of ScriptVideoItem
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ScriptVideoItemCopyWith<ScriptVideoItem> get copyWith => _$ScriptVideoItemCopyWithImpl<ScriptVideoItem>(this as ScriptVideoItem, _$identity);
/// Serializes this ScriptVideoItem to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ScriptVideoItem&&(identical(other.id, id) || other.id == id)&&(identical(other.type, type) || other.type == type)&&(identical(other.title, title) || other.title == title)&&(identical(other.coverUrl, coverUrl) || other.coverUrl == coverUrl)&&(identical(other.posterPath, posterPath) || other.posterPath == posterPath)&&(identical(other.detailPoster, detailPoster) || other.detailPoster == detailPoster)&&(identical(other.backdropPath, backdropPath) || other.backdropPath == backdropPath)&&const DeepCollectionEquality().equals(other.backdropPaths, backdropPaths)&&(identical(other.releaseDate, releaseDate) || other.releaseDate == releaseDate)&&(identical(other.mediaType, mediaType) || other.mediaType == mediaType)&&(identical(other.rating, rating) || other.rating == rating)&&(identical(other.genreTitle, genreTitle) || other.genreTitle == genreTitle)&&const DeepCollectionEquality().equals(other.genreItems, genreItems)&&const DeepCollectionEquality().equals(other.peoples, peoples)&&(identical(other.duration, duration) || other.duration == duration)&&(identical(other.durationText, durationText) || other.durationText == durationText)&&(identical(other.previewUrl, previewUrl) || other.previewUrl == previewUrl)&&const DeepCollectionEquality().equals(other.trailers, trailers)&&(identical(other.videoUrl, videoUrl) || other.videoUrl == videoUrl)&&(identical(other.link, link) || other.link == link)&&(identical(other.episode, episode) || other.episode == episode)&&(identical(other.description, description) || other.description == description)&&(identical(other.playerType, playerType) || other.playerType == playerType)&&const DeepCollectionEquality().equals(other.childItems, childItems)&&const DeepCollectionEquality().equals(other.episodeItems, episodeItems)&&const DeepCollectionEquality().equals(other.relatedItems, relatedItems));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([runtimeType,id,type,title,coverUrl,posterPath,detailPoster,backdropPath,const DeepCollectionEquality().hash(backdropPaths),releaseDate,mediaType,rating,genreTitle,const DeepCollectionEquality().hash(genreItems),const DeepCollectionEquality().hash(peoples),duration,durationText,previewUrl,const DeepCollectionEquality().hash(trailers),videoUrl,link,episode,description,playerType,const DeepCollectionEquality().hash(childItems),const DeepCollectionEquality().hash(episodeItems),const DeepCollectionEquality().hash(relatedItems)]);
@override
String toString() {
return 'ScriptVideoItem(id: $id, type: $type, title: $title, coverUrl: $coverUrl, posterPath: $posterPath, detailPoster: $detailPoster, backdropPath: $backdropPath, backdropPaths: $backdropPaths, releaseDate: $releaseDate, mediaType: $mediaType, rating: $rating, genreTitle: $genreTitle, genreItems: $genreItems, peoples: $peoples, duration: $duration, durationText: $durationText, previewUrl: $previewUrl, trailers: $trailers, videoUrl: $videoUrl, link: $link, episode: $episode, description: $description, playerType: $playerType, childItems: $childItems, episodeItems: $episodeItems, relatedItems: $relatedItems)';
}
}
/// @nodoc
abstract mixin class $ScriptVideoItemCopyWith<$Res> {
factory $ScriptVideoItemCopyWith(ScriptVideoItem value, $Res Function(ScriptVideoItem) _then) = _$ScriptVideoItemCopyWithImpl;
@useResult
$Res call({
@JsonKey(fromJson: _stringFromAny) String id, String type, String title, String coverUrl,@JsonKey(readValue: _readPosterPath) String posterPath, String detailPoster, String backdropPath, List<String> backdropPaths, String releaseDate, String mediaType,@JsonKey(fromJson: _doubleFromAny) double? rating, String genreTitle, List<ScriptVideoGenre> genreItems, List<ScriptVideoPerson> peoples,@JsonKey(fromJson: _intFromAny) int? duration, String durationText, String previewUrl, List<ScriptVideoTrailer> trailers, String videoUrl, String link,@JsonKey(fromJson: _intFromAny) int? episode, String description, String playerType, List<ScriptVideoItem> childItems, List<ScriptVideoItem> episodeItems, List<ScriptVideoItem> relatedItems
});
}
/// @nodoc
class _$ScriptVideoItemCopyWithImpl<$Res>
implements $ScriptVideoItemCopyWith<$Res> {
_$ScriptVideoItemCopyWithImpl(this._self, this._then);
final ScriptVideoItem _self;
final $Res Function(ScriptVideoItem) _then;
/// Create a copy of ScriptVideoItem
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? type = null,Object? title = null,Object? coverUrl = null,Object? posterPath = null,Object? detailPoster = null,Object? backdropPath = null,Object? backdropPaths = null,Object? releaseDate = null,Object? mediaType = null,Object? rating = freezed,Object? genreTitle = null,Object? genreItems = null,Object? peoples = null,Object? duration = freezed,Object? durationText = null,Object? previewUrl = null,Object? trailers = null,Object? videoUrl = null,Object? link = null,Object? episode = freezed,Object? description = null,Object? playerType = null,Object? childItems = null,Object? episodeItems = null,Object? relatedItems = null,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as String,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,coverUrl: null == coverUrl ? _self.coverUrl : coverUrl // ignore: cast_nullable_to_non_nullable
as String,posterPath: null == posterPath ? _self.posterPath : posterPath // ignore: cast_nullable_to_non_nullable
as String,detailPoster: null == detailPoster ? _self.detailPoster : detailPoster // ignore: cast_nullable_to_non_nullable
as String,backdropPath: null == backdropPath ? _self.backdropPath : backdropPath // ignore: cast_nullable_to_non_nullable
as String,backdropPaths: null == backdropPaths ? _self.backdropPaths : backdropPaths // ignore: cast_nullable_to_non_nullable
as List<String>,releaseDate: null == releaseDate ? _self.releaseDate : releaseDate // ignore: cast_nullable_to_non_nullable
as String,mediaType: null == mediaType ? _self.mediaType : mediaType // ignore: cast_nullable_to_non_nullable
as String,rating: freezed == rating ? _self.rating : rating // ignore: cast_nullable_to_non_nullable
as double?,genreTitle: null == genreTitle ? _self.genreTitle : genreTitle // ignore: cast_nullable_to_non_nullable
as String,genreItems: null == genreItems ? _self.genreItems : genreItems // ignore: cast_nullable_to_non_nullable
as List<ScriptVideoGenre>,peoples: null == peoples ? _self.peoples : peoples // ignore: cast_nullable_to_non_nullable
as List<ScriptVideoPerson>,duration: freezed == duration ? _self.duration : duration // ignore: cast_nullable_to_non_nullable
as int?,durationText: null == durationText ? _self.durationText : durationText // ignore: cast_nullable_to_non_nullable
as String,previewUrl: null == previewUrl ? _self.previewUrl : previewUrl // ignore: cast_nullable_to_non_nullable
as String,trailers: null == trailers ? _self.trailers : trailers // ignore: cast_nullable_to_non_nullable
as List<ScriptVideoTrailer>,videoUrl: null == videoUrl ? _self.videoUrl : videoUrl // ignore: cast_nullable_to_non_nullable
as String,link: null == link ? _self.link : link // ignore: cast_nullable_to_non_nullable
as String,episode: freezed == episode ? _self.episode : episode // ignore: cast_nullable_to_non_nullable
as int?,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String,playerType: null == playerType ? _self.playerType : playerType // ignore: cast_nullable_to_non_nullable
as String,childItems: null == childItems ? _self.childItems : childItems // ignore: cast_nullable_to_non_nullable
as List<ScriptVideoItem>,episodeItems: null == episodeItems ? _self.episodeItems : episodeItems // ignore: cast_nullable_to_non_nullable
as List<ScriptVideoItem>,relatedItems: null == relatedItems ? _self.relatedItems : relatedItems // ignore: cast_nullable_to_non_nullable
as List<ScriptVideoItem>,
));
}
}
/// Adds pattern-matching-related methods to [ScriptVideoItem].
extension ScriptVideoItemPatterns on ScriptVideoItem {
/// 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( _ScriptVideoItem value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ScriptVideoItem() 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( _ScriptVideoItem value) $default,){
final _that = this;
switch (_that) {
case _ScriptVideoItem():
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( _ScriptVideoItem value)? $default,){
final _that = this;
switch (_that) {
case _ScriptVideoItem() 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(@JsonKey(fromJson: _stringFromAny) String id, String type, String title, String coverUrl, @JsonKey(readValue: _readPosterPath) String posterPath, String detailPoster, String backdropPath, List<String> backdropPaths, String releaseDate, String mediaType, @JsonKey(fromJson: _doubleFromAny) double? rating, String genreTitle, List<ScriptVideoGenre> genreItems, List<ScriptVideoPerson> peoples, @JsonKey(fromJson: _intFromAny) int? duration, String durationText, String previewUrl, List<ScriptVideoTrailer> trailers, String videoUrl, String link, @JsonKey(fromJson: _intFromAny) int? episode, String description, String playerType, List<ScriptVideoItem> childItems, List<ScriptVideoItem> episodeItems, List<ScriptVideoItem> relatedItems)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ScriptVideoItem() when $default != null:
return $default(_that.id,_that.type,_that.title,_that.coverUrl,_that.posterPath,_that.detailPoster,_that.backdropPath,_that.backdropPaths,_that.releaseDate,_that.mediaType,_that.rating,_that.genreTitle,_that.genreItems,_that.peoples,_that.duration,_that.durationText,_that.previewUrl,_that.trailers,_that.videoUrl,_that.link,_that.episode,_that.description,_that.playerType,_that.childItems,_that.episodeItems,_that.relatedItems);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(@JsonKey(fromJson: _stringFromAny) String id, String type, String title, String coverUrl, @JsonKey(readValue: _readPosterPath) String posterPath, String detailPoster, String backdropPath, List<String> backdropPaths, String releaseDate, String mediaType, @JsonKey(fromJson: _doubleFromAny) double? rating, String genreTitle, List<ScriptVideoGenre> genreItems, List<ScriptVideoPerson> peoples, @JsonKey(fromJson: _intFromAny) int? duration, String durationText, String previewUrl, List<ScriptVideoTrailer> trailers, String videoUrl, String link, @JsonKey(fromJson: _intFromAny) int? episode, String description, String playerType, List<ScriptVideoItem> childItems, List<ScriptVideoItem> episodeItems, List<ScriptVideoItem> relatedItems) $default,) {final _that = this;
switch (_that) {
case _ScriptVideoItem():
return $default(_that.id,_that.type,_that.title,_that.coverUrl,_that.posterPath,_that.detailPoster,_that.backdropPath,_that.backdropPaths,_that.releaseDate,_that.mediaType,_that.rating,_that.genreTitle,_that.genreItems,_that.peoples,_that.duration,_that.durationText,_that.previewUrl,_that.trailers,_that.videoUrl,_that.link,_that.episode,_that.description,_that.playerType,_that.childItems,_that.episodeItems,_that.relatedItems);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(@JsonKey(fromJson: _stringFromAny) String id, String type, String title, String coverUrl, @JsonKey(readValue: _readPosterPath) String posterPath, String detailPoster, String backdropPath, List<String> backdropPaths, String releaseDate, String mediaType, @JsonKey(fromJson: _doubleFromAny) double? rating, String genreTitle, List<ScriptVideoGenre> genreItems, List<ScriptVideoPerson> peoples, @JsonKey(fromJson: _intFromAny) int? duration, String durationText, String previewUrl, List<ScriptVideoTrailer> trailers, String videoUrl, String link, @JsonKey(fromJson: _intFromAny) int? episode, String description, String playerType, List<ScriptVideoItem> childItems, List<ScriptVideoItem> episodeItems, List<ScriptVideoItem> relatedItems)? $default,) {final _that = this;
switch (_that) {
case _ScriptVideoItem() when $default != null:
return $default(_that.id,_that.type,_that.title,_that.coverUrl,_that.posterPath,_that.detailPoster,_that.backdropPath,_that.backdropPaths,_that.releaseDate,_that.mediaType,_that.rating,_that.genreTitle,_that.genreItems,_that.peoples,_that.duration,_that.durationText,_that.previewUrl,_that.trailers,_that.videoUrl,_that.link,_that.episode,_that.description,_that.playerType,_that.childItems,_that.episodeItems,_that.relatedItems);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _ScriptVideoItem implements ScriptVideoItem {
const _ScriptVideoItem({@JsonKey(fromJson: _stringFromAny) required this.id, this.type = 'link', this.title = '', this.coverUrl = '', @JsonKey(readValue: _readPosterPath) this.posterPath = '', this.detailPoster = '', this.backdropPath = '', final List<String> backdropPaths = const <String>[], this.releaseDate = '', this.mediaType = '', @JsonKey(fromJson: _doubleFromAny) this.rating, this.genreTitle = '', final List<ScriptVideoGenre> genreItems = const <ScriptVideoGenre>[], final List<ScriptVideoPerson> peoples = const <ScriptVideoPerson>[], @JsonKey(fromJson: _intFromAny) this.duration, this.durationText = '', this.previewUrl = '', final List<ScriptVideoTrailer> trailers = const <ScriptVideoTrailer>[], this.videoUrl = '', this.link = '', @JsonKey(fromJson: _intFromAny) this.episode, this.description = '', this.playerType = 'app', final List<ScriptVideoItem> childItems = const <ScriptVideoItem>[], final List<ScriptVideoItem> episodeItems = const <ScriptVideoItem>[], final List<ScriptVideoItem> relatedItems = const <ScriptVideoItem>[]}): _backdropPaths = backdropPaths,_genreItems = genreItems,_peoples = peoples,_trailers = trailers,_childItems = childItems,_episodeItems = episodeItems,_relatedItems = relatedItems;
factory _ScriptVideoItem.fromJson(Map<String, dynamic> json) => _$ScriptVideoItemFromJson(json);
@override@JsonKey(fromJson: _stringFromAny) final String id;
@override@JsonKey() final String type;
@override@JsonKey() final String title;
@override@JsonKey() final String coverUrl;
@override@JsonKey(readValue: _readPosterPath) final String posterPath;
@override@JsonKey() final String detailPoster;
@override@JsonKey() final String backdropPath;
final List<String> _backdropPaths;
@override@JsonKey() List<String> get backdropPaths {
if (_backdropPaths is EqualUnmodifiableListView) return _backdropPaths;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_backdropPaths);
}
@override@JsonKey() final String releaseDate;
@override@JsonKey() final String mediaType;
@override@JsonKey(fromJson: _doubleFromAny) final double? rating;
@override@JsonKey() final String genreTitle;
final List<ScriptVideoGenre> _genreItems;
@override@JsonKey() List<ScriptVideoGenre> get genreItems {
if (_genreItems is EqualUnmodifiableListView) return _genreItems;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_genreItems);
}
final List<ScriptVideoPerson> _peoples;
@override@JsonKey() List<ScriptVideoPerson> get peoples {
if (_peoples is EqualUnmodifiableListView) return _peoples;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_peoples);
}
@override@JsonKey(fromJson: _intFromAny) final int? duration;
@override@JsonKey() final String durationText;
@override@JsonKey() final String previewUrl;
final List<ScriptVideoTrailer> _trailers;
@override@JsonKey() List<ScriptVideoTrailer> get trailers {
if (_trailers is EqualUnmodifiableListView) return _trailers;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_trailers);
}
@override@JsonKey() final String videoUrl;
@override@JsonKey() final String link;
@override@JsonKey(fromJson: _intFromAny) final int? episode;
@override@JsonKey() final String description;
@override@JsonKey() final String playerType;
final List<ScriptVideoItem> _childItems;
@override@JsonKey() List<ScriptVideoItem> get childItems {
if (_childItems is EqualUnmodifiableListView) return _childItems;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_childItems);
}
final List<ScriptVideoItem> _episodeItems;
@override@JsonKey() List<ScriptVideoItem> get episodeItems {
if (_episodeItems is EqualUnmodifiableListView) return _episodeItems;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_episodeItems);
}
final List<ScriptVideoItem> _relatedItems;
@override@JsonKey() List<ScriptVideoItem> get relatedItems {
if (_relatedItems is EqualUnmodifiableListView) return _relatedItems;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_relatedItems);
}
/// Create a copy of ScriptVideoItem
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ScriptVideoItemCopyWith<_ScriptVideoItem> get copyWith => __$ScriptVideoItemCopyWithImpl<_ScriptVideoItem>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ScriptVideoItemToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ScriptVideoItem&&(identical(other.id, id) || other.id == id)&&(identical(other.type, type) || other.type == type)&&(identical(other.title, title) || other.title == title)&&(identical(other.coverUrl, coverUrl) || other.coverUrl == coverUrl)&&(identical(other.posterPath, posterPath) || other.posterPath == posterPath)&&(identical(other.detailPoster, detailPoster) || other.detailPoster == detailPoster)&&(identical(other.backdropPath, backdropPath) || other.backdropPath == backdropPath)&&const DeepCollectionEquality().equals(other._backdropPaths, _backdropPaths)&&(identical(other.releaseDate, releaseDate) || other.releaseDate == releaseDate)&&(identical(other.mediaType, mediaType) || other.mediaType == mediaType)&&(identical(other.rating, rating) || other.rating == rating)&&(identical(other.genreTitle, genreTitle) || other.genreTitle == genreTitle)&&const DeepCollectionEquality().equals(other._genreItems, _genreItems)&&const DeepCollectionEquality().equals(other._peoples, _peoples)&&(identical(other.duration, duration) || other.duration == duration)&&(identical(other.durationText, durationText) || other.durationText == durationText)&&(identical(other.previewUrl, previewUrl) || other.previewUrl == previewUrl)&&const DeepCollectionEquality().equals(other._trailers, _trailers)&&(identical(other.videoUrl, videoUrl) || other.videoUrl == videoUrl)&&(identical(other.link, link) || other.link == link)&&(identical(other.episode, episode) || other.episode == episode)&&(identical(other.description, description) || other.description == description)&&(identical(other.playerType, playerType) || other.playerType == playerType)&&const DeepCollectionEquality().equals(other._childItems, _childItems)&&const DeepCollectionEquality().equals(other._episodeItems, _episodeItems)&&const DeepCollectionEquality().equals(other._relatedItems, _relatedItems));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([runtimeType,id,type,title,coverUrl,posterPath,detailPoster,backdropPath,const DeepCollectionEquality().hash(_backdropPaths),releaseDate,mediaType,rating,genreTitle,const DeepCollectionEquality().hash(_genreItems),const DeepCollectionEquality().hash(_peoples),duration,durationText,previewUrl,const DeepCollectionEquality().hash(_trailers),videoUrl,link,episode,description,playerType,const DeepCollectionEquality().hash(_childItems),const DeepCollectionEquality().hash(_episodeItems),const DeepCollectionEquality().hash(_relatedItems)]);
@override
String toString() {
return 'ScriptVideoItem(id: $id, type: $type, title: $title, coverUrl: $coverUrl, posterPath: $posterPath, detailPoster: $detailPoster, backdropPath: $backdropPath, backdropPaths: $backdropPaths, releaseDate: $releaseDate, mediaType: $mediaType, rating: $rating, genreTitle: $genreTitle, genreItems: $genreItems, peoples: $peoples, duration: $duration, durationText: $durationText, previewUrl: $previewUrl, trailers: $trailers, videoUrl: $videoUrl, link: $link, episode: $episode, description: $description, playerType: $playerType, childItems: $childItems, episodeItems: $episodeItems, relatedItems: $relatedItems)';
}
}
/// @nodoc
abstract mixin class _$ScriptVideoItemCopyWith<$Res> implements $ScriptVideoItemCopyWith<$Res> {
factory _$ScriptVideoItemCopyWith(_ScriptVideoItem value, $Res Function(_ScriptVideoItem) _then) = __$ScriptVideoItemCopyWithImpl;
@override @useResult
$Res call({
@JsonKey(fromJson: _stringFromAny) String id, String type, String title, String coverUrl,@JsonKey(readValue: _readPosterPath) String posterPath, String detailPoster, String backdropPath, List<String> backdropPaths, String releaseDate, String mediaType,@JsonKey(fromJson: _doubleFromAny) double? rating, String genreTitle, List<ScriptVideoGenre> genreItems, List<ScriptVideoPerson> peoples,@JsonKey(fromJson: _intFromAny) int? duration, String durationText, String previewUrl, List<ScriptVideoTrailer> trailers, String videoUrl, String link,@JsonKey(fromJson: _intFromAny) int? episode, String description, String playerType, List<ScriptVideoItem> childItems, List<ScriptVideoItem> episodeItems, List<ScriptVideoItem> relatedItems
});
}
/// @nodoc
class __$ScriptVideoItemCopyWithImpl<$Res>
implements _$ScriptVideoItemCopyWith<$Res> {
__$ScriptVideoItemCopyWithImpl(this._self, this._then);
final _ScriptVideoItem _self;
final $Res Function(_ScriptVideoItem) _then;
/// Create a copy of ScriptVideoItem
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? type = null,Object? title = null,Object? coverUrl = null,Object? posterPath = null,Object? detailPoster = null,Object? backdropPath = null,Object? backdropPaths = null,Object? releaseDate = null,Object? mediaType = null,Object? rating = freezed,Object? genreTitle = null,Object? genreItems = null,Object? peoples = null,Object? duration = freezed,Object? durationText = null,Object? previewUrl = null,Object? trailers = null,Object? videoUrl = null,Object? link = null,Object? episode = freezed,Object? description = null,Object? playerType = null,Object? childItems = null,Object? episodeItems = null,Object? relatedItems = null,}) {
return _then(_ScriptVideoItem(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as String,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,coverUrl: null == coverUrl ? _self.coverUrl : coverUrl // ignore: cast_nullable_to_non_nullable
as String,posterPath: null == posterPath ? _self.posterPath : posterPath // ignore: cast_nullable_to_non_nullable
as String,detailPoster: null == detailPoster ? _self.detailPoster : detailPoster // ignore: cast_nullable_to_non_nullable
as String,backdropPath: null == backdropPath ? _self.backdropPath : backdropPath // ignore: cast_nullable_to_non_nullable
as String,backdropPaths: null == backdropPaths ? _self._backdropPaths : backdropPaths // ignore: cast_nullable_to_non_nullable
as List<String>,releaseDate: null == releaseDate ? _self.releaseDate : releaseDate // ignore: cast_nullable_to_non_nullable
as String,mediaType: null == mediaType ? _self.mediaType : mediaType // ignore: cast_nullable_to_non_nullable
as String,rating: freezed == rating ? _self.rating : rating // ignore: cast_nullable_to_non_nullable
as double?,genreTitle: null == genreTitle ? _self.genreTitle : genreTitle // ignore: cast_nullable_to_non_nullable
as String,genreItems: null == genreItems ? _self._genreItems : genreItems // ignore: cast_nullable_to_non_nullable
as List<ScriptVideoGenre>,peoples: null == peoples ? _self._peoples : peoples // ignore: cast_nullable_to_non_nullable
as List<ScriptVideoPerson>,duration: freezed == duration ? _self.duration : duration // ignore: cast_nullable_to_non_nullable
as int?,durationText: null == durationText ? _self.durationText : durationText // ignore: cast_nullable_to_non_nullable
as String,previewUrl: null == previewUrl ? _self.previewUrl : previewUrl // ignore: cast_nullable_to_non_nullable
as String,trailers: null == trailers ? _self._trailers : trailers // ignore: cast_nullable_to_non_nullable
as List<ScriptVideoTrailer>,videoUrl: null == videoUrl ? _self.videoUrl : videoUrl // ignore: cast_nullable_to_non_nullable
as String,link: null == link ? _self.link : link // ignore: cast_nullable_to_non_nullable
as String,episode: freezed == episode ? _self.episode : episode // ignore: cast_nullable_to_non_nullable
as int?,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String,playerType: null == playerType ? _self.playerType : playerType // ignore: cast_nullable_to_non_nullable
as String,childItems: null == childItems ? _self._childItems : childItems // ignore: cast_nullable_to_non_nullable
as List<ScriptVideoItem>,episodeItems: null == episodeItems ? _self._episodeItems : episodeItems // ignore: cast_nullable_to_non_nullable
as List<ScriptVideoItem>,relatedItems: null == relatedItems ? _self._relatedItems : relatedItems // ignore: cast_nullable_to_non_nullable
as List<ScriptVideoItem>,
));
}
}
/// @nodoc
mixin _$ScriptVideoResource {
String get name; String get description; String get url;@JsonKey(readValue: _readResourceHeaders) Map<String, String> get customHeaders; String get playerType;
/// Create a copy of ScriptVideoResource
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ScriptVideoResourceCopyWith<ScriptVideoResource> get copyWith => _$ScriptVideoResourceCopyWithImpl<ScriptVideoResource>(this as ScriptVideoResource, _$identity);
/// Serializes this ScriptVideoResource to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ScriptVideoResource&&(identical(other.name, name) || other.name == name)&&(identical(other.description, description) || other.description == description)&&(identical(other.url, url) || other.url == url)&&const DeepCollectionEquality().equals(other.customHeaders, customHeaders)&&(identical(other.playerType, playerType) || other.playerType == playerType));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,name,description,url,const DeepCollectionEquality().hash(customHeaders),playerType);
@override
String toString() {
return 'ScriptVideoResource(name: $name, description: $description, url: $url, customHeaders: $customHeaders, playerType: $playerType)';
}
}
/// @nodoc
abstract mixin class $ScriptVideoResourceCopyWith<$Res> {
factory $ScriptVideoResourceCopyWith(ScriptVideoResource value, $Res Function(ScriptVideoResource) _then) = _$ScriptVideoResourceCopyWithImpl;
@useResult
$Res call({
String name, String description, String url,@JsonKey(readValue: _readResourceHeaders) Map<String, String> customHeaders, String playerType
});
}
/// @nodoc
class _$ScriptVideoResourceCopyWithImpl<$Res>
implements $ScriptVideoResourceCopyWith<$Res> {
_$ScriptVideoResourceCopyWithImpl(this._self, this._then);
final ScriptVideoResource _self;
final $Res Function(ScriptVideoResource) _then;
/// Create a copy of ScriptVideoResource
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? name = null,Object? description = null,Object? url = null,Object? customHeaders = null,Object? playerType = null,}) {
return _then(_self.copyWith(
name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String,url: null == url ? _self.url : url // ignore: cast_nullable_to_non_nullable
as String,customHeaders: null == customHeaders ? _self.customHeaders : customHeaders // ignore: cast_nullable_to_non_nullable
as Map<String, String>,playerType: null == playerType ? _self.playerType : playerType // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// Adds pattern-matching-related methods to [ScriptVideoResource].
extension ScriptVideoResourcePatterns on ScriptVideoResource {
/// 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( _ScriptVideoResource value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ScriptVideoResource() 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( _ScriptVideoResource value) $default,){
final _that = this;
switch (_that) {
case _ScriptVideoResource():
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( _ScriptVideoResource value)? $default,){
final _that = this;
switch (_that) {
case _ScriptVideoResource() 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 name, String description, String url, @JsonKey(readValue: _readResourceHeaders) Map<String, String> customHeaders, String playerType)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ScriptVideoResource() when $default != null:
return $default(_that.name,_that.description,_that.url,_that.customHeaders,_that.playerType);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 name, String description, String url, @JsonKey(readValue: _readResourceHeaders) Map<String, String> customHeaders, String playerType) $default,) {final _that = this;
switch (_that) {
case _ScriptVideoResource():
return $default(_that.name,_that.description,_that.url,_that.customHeaders,_that.playerType);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 name, String description, String url, @JsonKey(readValue: _readResourceHeaders) Map<String, String> customHeaders, String playerType)? $default,) {final _that = this;
switch (_that) {
case _ScriptVideoResource() when $default != null:
return $default(_that.name,_that.description,_that.url,_that.customHeaders,_that.playerType);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _ScriptVideoResource implements ScriptVideoResource {
const _ScriptVideoResource({this.name = '', this.description = '', required this.url, @JsonKey(readValue: _readResourceHeaders) final Map<String, String> customHeaders = const <String, String>{}, this.playerType = 'app'}): _customHeaders = customHeaders;
factory _ScriptVideoResource.fromJson(Map<String, dynamic> json) => _$ScriptVideoResourceFromJson(json);
@override@JsonKey() final String name;
@override@JsonKey() final String description;
@override final String url;
final Map<String, String> _customHeaders;
@override@JsonKey(readValue: _readResourceHeaders) Map<String, String> get customHeaders {
if (_customHeaders is EqualUnmodifiableMapView) return _customHeaders;
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView(_customHeaders);
}
@override@JsonKey() final String playerType;
/// Create a copy of ScriptVideoResource
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ScriptVideoResourceCopyWith<_ScriptVideoResource> get copyWith => __$ScriptVideoResourceCopyWithImpl<_ScriptVideoResource>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ScriptVideoResourceToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ScriptVideoResource&&(identical(other.name, name) || other.name == name)&&(identical(other.description, description) || other.description == description)&&(identical(other.url, url) || other.url == url)&&const DeepCollectionEquality().equals(other._customHeaders, _customHeaders)&&(identical(other.playerType, playerType) || other.playerType == playerType));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,name,description,url,const DeepCollectionEquality().hash(_customHeaders),playerType);
@override
String toString() {
return 'ScriptVideoResource(name: $name, description: $description, url: $url, customHeaders: $customHeaders, playerType: $playerType)';
}
}
/// @nodoc
abstract mixin class _$ScriptVideoResourceCopyWith<$Res> implements $ScriptVideoResourceCopyWith<$Res> {
factory _$ScriptVideoResourceCopyWith(_ScriptVideoResource value, $Res Function(_ScriptVideoResource) _then) = __$ScriptVideoResourceCopyWithImpl;
@override @useResult
$Res call({
String name, String description, String url,@JsonKey(readValue: _readResourceHeaders) Map<String, String> customHeaders, String playerType
});
}
/// @nodoc
class __$ScriptVideoResourceCopyWithImpl<$Res>
implements _$ScriptVideoResourceCopyWith<$Res> {
__$ScriptVideoResourceCopyWithImpl(this._self, this._then);
final _ScriptVideoResource _self;
final $Res Function(_ScriptVideoResource) _then;
/// Create a copy of ScriptVideoResource
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? description = null,Object? url = null,Object? customHeaders = null,Object? playerType = null,}) {
return _then(_ScriptVideoResource(
name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String,url: null == url ? _self.url : url // ignore: cast_nullable_to_non_nullable
as String,customHeaders: null == customHeaders ? _self._customHeaders : customHeaders // ignore: cast_nullable_to_non_nullable
as Map<String, String>,playerType: null == playerType ? _self.playerType : playerType // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
mixin _$InstalledScriptWidget {
ScriptWidgetManifest get manifest; String get scriptSource; String get sourceUrl; bool get enabled; Map<String, Object?> get globalParams; DateTime get installedAt; DateTime get updatedAt;
/// Create a copy of InstalledScriptWidget
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$InstalledScriptWidgetCopyWith<InstalledScriptWidget> get copyWith => _$InstalledScriptWidgetCopyWithImpl<InstalledScriptWidget>(this as InstalledScriptWidget, _$identity);
/// Serializes this InstalledScriptWidget to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is InstalledScriptWidget&&(identical(other.manifest, manifest) || other.manifest == manifest)&&(identical(other.scriptSource, scriptSource) || other.scriptSource == scriptSource)&&(identical(other.sourceUrl, sourceUrl) || other.sourceUrl == sourceUrl)&&(identical(other.enabled, enabled) || other.enabled == enabled)&&const DeepCollectionEquality().equals(other.globalParams, globalParams)&&(identical(other.installedAt, installedAt) || other.installedAt == installedAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,manifest,scriptSource,sourceUrl,enabled,const DeepCollectionEquality().hash(globalParams),installedAt,updatedAt);
@override
String toString() {
return 'InstalledScriptWidget(manifest: $manifest, scriptSource: $scriptSource, sourceUrl: $sourceUrl, enabled: $enabled, globalParams: $globalParams, installedAt: $installedAt, updatedAt: $updatedAt)';
}
}
/// @nodoc
abstract mixin class $InstalledScriptWidgetCopyWith<$Res> {
factory $InstalledScriptWidgetCopyWith(InstalledScriptWidget value, $Res Function(InstalledScriptWidget) _then) = _$InstalledScriptWidgetCopyWithImpl;
@useResult
$Res call({
ScriptWidgetManifest manifest, String scriptSource, String sourceUrl, bool enabled, Map<String, Object?> globalParams, DateTime installedAt, DateTime updatedAt
});
$ScriptWidgetManifestCopyWith<$Res> get manifest;
}
/// @nodoc
class _$InstalledScriptWidgetCopyWithImpl<$Res>
implements $InstalledScriptWidgetCopyWith<$Res> {
_$InstalledScriptWidgetCopyWithImpl(this._self, this._then);
final InstalledScriptWidget _self;
final $Res Function(InstalledScriptWidget) _then;
/// Create a copy of InstalledScriptWidget
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? manifest = null,Object? scriptSource = null,Object? sourceUrl = null,Object? enabled = null,Object? globalParams = null,Object? installedAt = null,Object? updatedAt = null,}) {
return _then(_self.copyWith(
manifest: null == manifest ? _self.manifest : manifest // ignore: cast_nullable_to_non_nullable
as ScriptWidgetManifest,scriptSource: null == scriptSource ? _self.scriptSource : scriptSource // ignore: cast_nullable_to_non_nullable
as String,sourceUrl: null == sourceUrl ? _self.sourceUrl : sourceUrl // ignore: cast_nullable_to_non_nullable
as String,enabled: null == enabled ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable
as bool,globalParams: null == globalParams ? _self.globalParams : globalParams // ignore: cast_nullable_to_non_nullable
as Map<String, Object?>,installedAt: null == installedAt ? _self.installedAt : installedAt // ignore: cast_nullable_to_non_nullable
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
));
}
/// Create a copy of InstalledScriptWidget
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ScriptWidgetManifestCopyWith<$Res> get manifest {
return $ScriptWidgetManifestCopyWith<$Res>(_self.manifest, (value) {
return _then(_self.copyWith(manifest: value));
});
}
}
/// Adds pattern-matching-related methods to [InstalledScriptWidget].
extension InstalledScriptWidgetPatterns on InstalledScriptWidget {
/// 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( _InstalledScriptWidget value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _InstalledScriptWidget() 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( _InstalledScriptWidget value) $default,){
final _that = this;
switch (_that) {
case _InstalledScriptWidget():
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( _InstalledScriptWidget value)? $default,){
final _that = this;
switch (_that) {
case _InstalledScriptWidget() 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( ScriptWidgetManifest manifest, String scriptSource, String sourceUrl, bool enabled, Map<String, Object?> globalParams, DateTime installedAt, DateTime updatedAt)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _InstalledScriptWidget() when $default != null:
return $default(_that.manifest,_that.scriptSource,_that.sourceUrl,_that.enabled,_that.globalParams,_that.installedAt,_that.updatedAt);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( ScriptWidgetManifest manifest, String scriptSource, String sourceUrl, bool enabled, Map<String, Object?> globalParams, DateTime installedAt, DateTime updatedAt) $default,) {final _that = this;
switch (_that) {
case _InstalledScriptWidget():
return $default(_that.manifest,_that.scriptSource,_that.sourceUrl,_that.enabled,_that.globalParams,_that.installedAt,_that.updatedAt);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( ScriptWidgetManifest manifest, String scriptSource, String sourceUrl, bool enabled, Map<String, Object?> globalParams, DateTime installedAt, DateTime updatedAt)? $default,) {final _that = this;
switch (_that) {
case _InstalledScriptWidget() when $default != null:
return $default(_that.manifest,_that.scriptSource,_that.sourceUrl,_that.enabled,_that.globalParams,_that.installedAt,_that.updatedAt);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _InstalledScriptWidget implements InstalledScriptWidget {
const _InstalledScriptWidget({required this.manifest, required this.scriptSource, this.sourceUrl = '', this.enabled = true, final Map<String, Object?> globalParams = const <String, Object?>{}, required this.installedAt, required this.updatedAt}): _globalParams = globalParams;
factory _InstalledScriptWidget.fromJson(Map<String, dynamic> json) => _$InstalledScriptWidgetFromJson(json);
@override final ScriptWidgetManifest manifest;
@override final String scriptSource;
@override@JsonKey() final String sourceUrl;
@override@JsonKey() final bool enabled;
final Map<String, Object?> _globalParams;
@override@JsonKey() Map<String, Object?> get globalParams {
if (_globalParams is EqualUnmodifiableMapView) return _globalParams;
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView(_globalParams);
}
@override final DateTime installedAt;
@override final DateTime updatedAt;
/// Create a copy of InstalledScriptWidget
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$InstalledScriptWidgetCopyWith<_InstalledScriptWidget> get copyWith => __$InstalledScriptWidgetCopyWithImpl<_InstalledScriptWidget>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$InstalledScriptWidgetToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _InstalledScriptWidget&&(identical(other.manifest, manifest) || other.manifest == manifest)&&(identical(other.scriptSource, scriptSource) || other.scriptSource == scriptSource)&&(identical(other.sourceUrl, sourceUrl) || other.sourceUrl == sourceUrl)&&(identical(other.enabled, enabled) || other.enabled == enabled)&&const DeepCollectionEquality().equals(other._globalParams, _globalParams)&&(identical(other.installedAt, installedAt) || other.installedAt == installedAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,manifest,scriptSource,sourceUrl,enabled,const DeepCollectionEquality().hash(_globalParams),installedAt,updatedAt);
@override
String toString() {
return 'InstalledScriptWidget(manifest: $manifest, scriptSource: $scriptSource, sourceUrl: $sourceUrl, enabled: $enabled, globalParams: $globalParams, installedAt: $installedAt, updatedAt: $updatedAt)';
}
}
/// @nodoc
abstract mixin class _$InstalledScriptWidgetCopyWith<$Res> implements $InstalledScriptWidgetCopyWith<$Res> {
factory _$InstalledScriptWidgetCopyWith(_InstalledScriptWidget value, $Res Function(_InstalledScriptWidget) _then) = __$InstalledScriptWidgetCopyWithImpl;
@override @useResult
$Res call({
ScriptWidgetManifest manifest, String scriptSource, String sourceUrl, bool enabled, Map<String, Object?> globalParams, DateTime installedAt, DateTime updatedAt
});
@override $ScriptWidgetManifestCopyWith<$Res> get manifest;
}
/// @nodoc
class __$InstalledScriptWidgetCopyWithImpl<$Res>
implements _$InstalledScriptWidgetCopyWith<$Res> {
__$InstalledScriptWidgetCopyWithImpl(this._self, this._then);
final _InstalledScriptWidget _self;
final $Res Function(_InstalledScriptWidget) _then;
/// Create a copy of InstalledScriptWidget
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? manifest = null,Object? scriptSource = null,Object? sourceUrl = null,Object? enabled = null,Object? globalParams = null,Object? installedAt = null,Object? updatedAt = null,}) {
return _then(_InstalledScriptWidget(
manifest: null == manifest ? _self.manifest : manifest // ignore: cast_nullable_to_non_nullable
as ScriptWidgetManifest,scriptSource: null == scriptSource ? _self.scriptSource : scriptSource // ignore: cast_nullable_to_non_nullable
as String,sourceUrl: null == sourceUrl ? _self.sourceUrl : sourceUrl // ignore: cast_nullable_to_non_nullable
as String,enabled: null == enabled ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable
as bool,globalParams: null == globalParams ? _self._globalParams : globalParams // ignore: cast_nullable_to_non_nullable
as Map<String, Object?>,installedAt: null == installedAt ? _self.installedAt : installedAt // ignore: cast_nullable_to_non_nullable
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
));
}
/// Create a copy of InstalledScriptWidget
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ScriptWidgetManifestCopyWith<$Res> get manifest {
return $ScriptWidgetManifestCopyWith<$Res>(_self.manifest, (value) {
return _then(_self.copyWith(manifest: value));
});
}
}
/// @nodoc
mixin _$ScriptWidgetCatalogEntry {
String get id; String get title; String get description; String get requiredVersion; String get version; String get author; String get url;
/// Create a copy of ScriptWidgetCatalogEntry
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ScriptWidgetCatalogEntryCopyWith<ScriptWidgetCatalogEntry> get copyWith => _$ScriptWidgetCatalogEntryCopyWithImpl<ScriptWidgetCatalogEntry>(this as ScriptWidgetCatalogEntry, _$identity);
/// Serializes this ScriptWidgetCatalogEntry to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ScriptWidgetCatalogEntry&&(identical(other.id, id) || other.id == id)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.requiredVersion, requiredVersion) || other.requiredVersion == requiredVersion)&&(identical(other.version, version) || other.version == version)&&(identical(other.author, author) || other.author == author)&&(identical(other.url, url) || other.url == url));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,title,description,requiredVersion,version,author,url);
@override
String toString() {
return 'ScriptWidgetCatalogEntry(id: $id, title: $title, description: $description, requiredVersion: $requiredVersion, version: $version, author: $author, url: $url)';
}
}
/// @nodoc
abstract mixin class $ScriptWidgetCatalogEntryCopyWith<$Res> {
factory $ScriptWidgetCatalogEntryCopyWith(ScriptWidgetCatalogEntry value, $Res Function(ScriptWidgetCatalogEntry) _then) = _$ScriptWidgetCatalogEntryCopyWithImpl;
@useResult
$Res call({
String id, String title, String description, String requiredVersion, String version, String author, String url
});
}
/// @nodoc
class _$ScriptWidgetCatalogEntryCopyWithImpl<$Res>
implements $ScriptWidgetCatalogEntryCopyWith<$Res> {
_$ScriptWidgetCatalogEntryCopyWithImpl(this._self, this._then);
final ScriptWidgetCatalogEntry _self;
final $Res Function(ScriptWidgetCatalogEntry) _then;
/// Create a copy of ScriptWidgetCatalogEntry
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? title = null,Object? description = null,Object? requiredVersion = null,Object? version = null,Object? author = null,Object? url = null,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String,requiredVersion: null == requiredVersion ? _self.requiredVersion : requiredVersion // ignore: cast_nullable_to_non_nullable
as String,version: null == version ? _self.version : version // ignore: cast_nullable_to_non_nullable
as String,author: null == author ? _self.author : author // ignore: cast_nullable_to_non_nullable
as String,url: null == url ? _self.url : url // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// Adds pattern-matching-related methods to [ScriptWidgetCatalogEntry].
extension ScriptWidgetCatalogEntryPatterns on ScriptWidgetCatalogEntry {
/// 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( _ScriptWidgetCatalogEntry value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ScriptWidgetCatalogEntry() 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( _ScriptWidgetCatalogEntry value) $default,){
final _that = this;
switch (_that) {
case _ScriptWidgetCatalogEntry():
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( _ScriptWidgetCatalogEntry value)? $default,){
final _that = this;
switch (_that) {
case _ScriptWidgetCatalogEntry() 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 id, String title, String description, String requiredVersion, String version, String author, String url)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ScriptWidgetCatalogEntry() when $default != null:
return $default(_that.id,_that.title,_that.description,_that.requiredVersion,_that.version,_that.author,_that.url);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 id, String title, String description, String requiredVersion, String version, String author, String url) $default,) {final _that = this;
switch (_that) {
case _ScriptWidgetCatalogEntry():
return $default(_that.id,_that.title,_that.description,_that.requiredVersion,_that.version,_that.author,_that.url);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 id, String title, String description, String requiredVersion, String version, String author, String url)? $default,) {final _that = this;
switch (_that) {
case _ScriptWidgetCatalogEntry() when $default != null:
return $default(_that.id,_that.title,_that.description,_that.requiredVersion,_that.version,_that.author,_that.url);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _ScriptWidgetCatalogEntry implements ScriptWidgetCatalogEntry {
const _ScriptWidgetCatalogEntry({required this.id, required this.title, this.description = '', this.requiredVersion = '', this.version = '', this.author = '', required this.url});
factory _ScriptWidgetCatalogEntry.fromJson(Map<String, dynamic> json) => _$ScriptWidgetCatalogEntryFromJson(json);
@override final String id;
@override final String title;
@override@JsonKey() final String description;
@override@JsonKey() final String requiredVersion;
@override@JsonKey() final String version;
@override@JsonKey() final String author;
@override final String url;
/// Create a copy of ScriptWidgetCatalogEntry
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ScriptWidgetCatalogEntryCopyWith<_ScriptWidgetCatalogEntry> get copyWith => __$ScriptWidgetCatalogEntryCopyWithImpl<_ScriptWidgetCatalogEntry>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ScriptWidgetCatalogEntryToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ScriptWidgetCatalogEntry&&(identical(other.id, id) || other.id == id)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.requiredVersion, requiredVersion) || other.requiredVersion == requiredVersion)&&(identical(other.version, version) || other.version == version)&&(identical(other.author, author) || other.author == author)&&(identical(other.url, url) || other.url == url));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,title,description,requiredVersion,version,author,url);
@override
String toString() {
return 'ScriptWidgetCatalogEntry(id: $id, title: $title, description: $description, requiredVersion: $requiredVersion, version: $version, author: $author, url: $url)';
}
}
/// @nodoc
abstract mixin class _$ScriptWidgetCatalogEntryCopyWith<$Res> implements $ScriptWidgetCatalogEntryCopyWith<$Res> {
factory _$ScriptWidgetCatalogEntryCopyWith(_ScriptWidgetCatalogEntry value, $Res Function(_ScriptWidgetCatalogEntry) _then) = __$ScriptWidgetCatalogEntryCopyWithImpl;
@override @useResult
$Res call({
String id, String title, String description, String requiredVersion, String version, String author, String url
});
}
/// @nodoc
class __$ScriptWidgetCatalogEntryCopyWithImpl<$Res>
implements _$ScriptWidgetCatalogEntryCopyWith<$Res> {
__$ScriptWidgetCatalogEntryCopyWithImpl(this._self, this._then);
final _ScriptWidgetCatalogEntry _self;
final $Res Function(_ScriptWidgetCatalogEntry) _then;
/// Create a copy of ScriptWidgetCatalogEntry
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? title = null,Object? description = null,Object? requiredVersion = null,Object? version = null,Object? author = null,Object? url = null,}) {
return _then(_ScriptWidgetCatalogEntry(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String,requiredVersion: null == requiredVersion ? _self.requiredVersion : requiredVersion // ignore: cast_nullable_to_non_nullable
as String,version: null == version ? _self.version : version // ignore: cast_nullable_to_non_nullable
as String,author: null == author ? _self.author : author // ignore: cast_nullable_to_non_nullable
as String,url: null == url ? _self.url : url // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
mixin _$ScriptWidgetCatalog {
String get title; String get description; String get icon; List<ScriptWidgetCatalogEntry> get widgets;
/// Create a copy of ScriptWidgetCatalog
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ScriptWidgetCatalogCopyWith<ScriptWidgetCatalog> get copyWith => _$ScriptWidgetCatalogCopyWithImpl<ScriptWidgetCatalog>(this as ScriptWidgetCatalog, _$identity);
/// Serializes this ScriptWidgetCatalog to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ScriptWidgetCatalog&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.icon, icon) || other.icon == icon)&&const DeepCollectionEquality().equals(other.widgets, widgets));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,title,description,icon,const DeepCollectionEquality().hash(widgets));
@override
String toString() {
return 'ScriptWidgetCatalog(title: $title, description: $description, icon: $icon, widgets: $widgets)';
}
}
/// @nodoc
abstract mixin class $ScriptWidgetCatalogCopyWith<$Res> {
factory $ScriptWidgetCatalogCopyWith(ScriptWidgetCatalog value, $Res Function(ScriptWidgetCatalog) _then) = _$ScriptWidgetCatalogCopyWithImpl;
@useResult
$Res call({
String title, String description, String icon, List<ScriptWidgetCatalogEntry> widgets
});
}
/// @nodoc
class _$ScriptWidgetCatalogCopyWithImpl<$Res>
implements $ScriptWidgetCatalogCopyWith<$Res> {
_$ScriptWidgetCatalogCopyWithImpl(this._self, this._then);
final ScriptWidgetCatalog _self;
final $Res Function(ScriptWidgetCatalog) _then;
/// Create a copy of ScriptWidgetCatalog
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? title = null,Object? description = null,Object? icon = null,Object? widgets = null,}) {
return _then(_self.copyWith(
title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String,icon: null == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable
as String,widgets: null == widgets ? _self.widgets : widgets // ignore: cast_nullable_to_non_nullable
as List<ScriptWidgetCatalogEntry>,
));
}
}
/// Adds pattern-matching-related methods to [ScriptWidgetCatalog].
extension ScriptWidgetCatalogPatterns on ScriptWidgetCatalog {
/// 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( _ScriptWidgetCatalog value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ScriptWidgetCatalog() 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( _ScriptWidgetCatalog value) $default,){
final _that = this;
switch (_that) {
case _ScriptWidgetCatalog():
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( _ScriptWidgetCatalog value)? $default,){
final _that = this;
switch (_that) {
case _ScriptWidgetCatalog() 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 title, String description, String icon, List<ScriptWidgetCatalogEntry> widgets)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ScriptWidgetCatalog() when $default != null:
return $default(_that.title,_that.description,_that.icon,_that.widgets);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 title, String description, String icon, List<ScriptWidgetCatalogEntry> widgets) $default,) {final _that = this;
switch (_that) {
case _ScriptWidgetCatalog():
return $default(_that.title,_that.description,_that.icon,_that.widgets);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 title, String description, String icon, List<ScriptWidgetCatalogEntry> widgets)? $default,) {final _that = this;
switch (_that) {
case _ScriptWidgetCatalog() when $default != null:
return $default(_that.title,_that.description,_that.icon,_that.widgets);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _ScriptWidgetCatalog implements ScriptWidgetCatalog {
const _ScriptWidgetCatalog({required this.title, this.description = '', this.icon = '', final List<ScriptWidgetCatalogEntry> widgets = const <ScriptWidgetCatalogEntry>[]}): _widgets = widgets;
factory _ScriptWidgetCatalog.fromJson(Map<String, dynamic> json) => _$ScriptWidgetCatalogFromJson(json);
@override final String title;
@override@JsonKey() final String description;
@override@JsonKey() final String icon;
final List<ScriptWidgetCatalogEntry> _widgets;
@override@JsonKey() List<ScriptWidgetCatalogEntry> get widgets {
if (_widgets is EqualUnmodifiableListView) return _widgets;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_widgets);
}
/// Create a copy of ScriptWidgetCatalog
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ScriptWidgetCatalogCopyWith<_ScriptWidgetCatalog> get copyWith => __$ScriptWidgetCatalogCopyWithImpl<_ScriptWidgetCatalog>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ScriptWidgetCatalogToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ScriptWidgetCatalog&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.icon, icon) || other.icon == icon)&&const DeepCollectionEquality().equals(other._widgets, _widgets));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,title,description,icon,const DeepCollectionEquality().hash(_widgets));
@override
String toString() {
return 'ScriptWidgetCatalog(title: $title, description: $description, icon: $icon, widgets: $widgets)';
}
}
/// @nodoc
abstract mixin class _$ScriptWidgetCatalogCopyWith<$Res> implements $ScriptWidgetCatalogCopyWith<$Res> {
factory _$ScriptWidgetCatalogCopyWith(_ScriptWidgetCatalog value, $Res Function(_ScriptWidgetCatalog) _then) = __$ScriptWidgetCatalogCopyWithImpl;
@override @useResult
$Res call({
String title, String description, String icon, List<ScriptWidgetCatalogEntry> widgets
});
}
/// @nodoc
class __$ScriptWidgetCatalogCopyWithImpl<$Res>
implements _$ScriptWidgetCatalogCopyWith<$Res> {
__$ScriptWidgetCatalogCopyWithImpl(this._self, this._then);
final _ScriptWidgetCatalog _self;
final $Res Function(_ScriptWidgetCatalog) _then;
/// Create a copy of ScriptWidgetCatalog
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? title = null,Object? description = null,Object? icon = null,Object? widgets = null,}) {
return _then(_ScriptWidgetCatalog(
title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
as String,icon: null == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable
as String,widgets: null == widgets ? _self._widgets : widgets // ignore: cast_nullable_to_non_nullable
as List<ScriptWidgetCatalogEntry>,
));
}
}
/// @nodoc
mixin _$ScriptWidgetSubscription {
String get url; ScriptWidgetCatalog get catalog; DateTime get refreshedAt;
/// Create a copy of ScriptWidgetSubscription
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ScriptWidgetSubscriptionCopyWith<ScriptWidgetSubscription> get copyWith => _$ScriptWidgetSubscriptionCopyWithImpl<ScriptWidgetSubscription>(this as ScriptWidgetSubscription, _$identity);
/// Serializes this ScriptWidgetSubscription to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ScriptWidgetSubscription&&(identical(other.url, url) || other.url == url)&&(identical(other.catalog, catalog) || other.catalog == catalog)&&(identical(other.refreshedAt, refreshedAt) || other.refreshedAt == refreshedAt));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,url,catalog,refreshedAt);
@override
String toString() {
return 'ScriptWidgetSubscription(url: $url, catalog: $catalog, refreshedAt: $refreshedAt)';
}
}
/// @nodoc
abstract mixin class $ScriptWidgetSubscriptionCopyWith<$Res> {
factory $ScriptWidgetSubscriptionCopyWith(ScriptWidgetSubscription value, $Res Function(ScriptWidgetSubscription) _then) = _$ScriptWidgetSubscriptionCopyWithImpl;
@useResult
$Res call({
String url, ScriptWidgetCatalog catalog, DateTime refreshedAt
});
$ScriptWidgetCatalogCopyWith<$Res> get catalog;
}
/// @nodoc
class _$ScriptWidgetSubscriptionCopyWithImpl<$Res>
implements $ScriptWidgetSubscriptionCopyWith<$Res> {
_$ScriptWidgetSubscriptionCopyWithImpl(this._self, this._then);
final ScriptWidgetSubscription _self;
final $Res Function(ScriptWidgetSubscription) _then;
/// Create a copy of ScriptWidgetSubscription
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? url = null,Object? catalog = null,Object? refreshedAt = null,}) {
return _then(_self.copyWith(
url: null == url ? _self.url : url // ignore: cast_nullable_to_non_nullable
as String,catalog: null == catalog ? _self.catalog : catalog // ignore: cast_nullable_to_non_nullable
as ScriptWidgetCatalog,refreshedAt: null == refreshedAt ? _self.refreshedAt : refreshedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
));
}
/// Create a copy of ScriptWidgetSubscription
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ScriptWidgetCatalogCopyWith<$Res> get catalog {
return $ScriptWidgetCatalogCopyWith<$Res>(_self.catalog, (value) {
return _then(_self.copyWith(catalog: value));
});
}
}
/// Adds pattern-matching-related methods to [ScriptWidgetSubscription].
extension ScriptWidgetSubscriptionPatterns on ScriptWidgetSubscription {
/// 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( _ScriptWidgetSubscription value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ScriptWidgetSubscription() 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( _ScriptWidgetSubscription value) $default,){
final _that = this;
switch (_that) {
case _ScriptWidgetSubscription():
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( _ScriptWidgetSubscription value)? $default,){
final _that = this;
switch (_that) {
case _ScriptWidgetSubscription() 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 url, ScriptWidgetCatalog catalog, DateTime refreshedAt)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ScriptWidgetSubscription() when $default != null:
return $default(_that.url,_that.catalog,_that.refreshedAt);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 url, ScriptWidgetCatalog catalog, DateTime refreshedAt) $default,) {final _that = this;
switch (_that) {
case _ScriptWidgetSubscription():
return $default(_that.url,_that.catalog,_that.refreshedAt);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 url, ScriptWidgetCatalog catalog, DateTime refreshedAt)? $default,) {final _that = this;
switch (_that) {
case _ScriptWidgetSubscription() when $default != null:
return $default(_that.url,_that.catalog,_that.refreshedAt);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _ScriptWidgetSubscription implements ScriptWidgetSubscription {
const _ScriptWidgetSubscription({required this.url, required this.catalog, required this.refreshedAt});
factory _ScriptWidgetSubscription.fromJson(Map<String, dynamic> json) => _$ScriptWidgetSubscriptionFromJson(json);
@override final String url;
@override final ScriptWidgetCatalog catalog;
@override final DateTime refreshedAt;
/// Create a copy of ScriptWidgetSubscription
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ScriptWidgetSubscriptionCopyWith<_ScriptWidgetSubscription> get copyWith => __$ScriptWidgetSubscriptionCopyWithImpl<_ScriptWidgetSubscription>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ScriptWidgetSubscriptionToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ScriptWidgetSubscription&&(identical(other.url, url) || other.url == url)&&(identical(other.catalog, catalog) || other.catalog == catalog)&&(identical(other.refreshedAt, refreshedAt) || other.refreshedAt == refreshedAt));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,url,catalog,refreshedAt);
@override
String toString() {
return 'ScriptWidgetSubscription(url: $url, catalog: $catalog, refreshedAt: $refreshedAt)';
}
}
/// @nodoc
abstract mixin class _$ScriptWidgetSubscriptionCopyWith<$Res> implements $ScriptWidgetSubscriptionCopyWith<$Res> {
factory _$ScriptWidgetSubscriptionCopyWith(_ScriptWidgetSubscription value, $Res Function(_ScriptWidgetSubscription) _then) = __$ScriptWidgetSubscriptionCopyWithImpl;
@override @useResult
$Res call({
String url, ScriptWidgetCatalog catalog, DateTime refreshedAt
});
@override $ScriptWidgetCatalogCopyWith<$Res> get catalog;
}
/// @nodoc
class __$ScriptWidgetSubscriptionCopyWithImpl<$Res>
implements _$ScriptWidgetSubscriptionCopyWith<$Res> {
__$ScriptWidgetSubscriptionCopyWithImpl(this._self, this._then);
final _ScriptWidgetSubscription _self;
final $Res Function(_ScriptWidgetSubscription) _then;
/// Create a copy of ScriptWidgetSubscription
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? url = null,Object? catalog = null,Object? refreshedAt = null,}) {
return _then(_ScriptWidgetSubscription(
url: null == url ? _self.url : url // ignore: cast_nullable_to_non_nullable
as String,catalog: null == catalog ? _self.catalog : catalog // ignore: cast_nullable_to_non_nullable
as ScriptWidgetCatalog,refreshedAt: null == refreshedAt ? _self.refreshedAt : refreshedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
));
}
/// Create a copy of ScriptWidgetSubscription
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ScriptWidgetCatalogCopyWith<$Res> get catalog {
return $ScriptWidgetCatalogCopyWith<$Res>(_self.catalog, (value) {
return _then(_self.copyWith(catalog: value));
});
}
}
// dart format on