主要变更: 1. 移除摇一摇相关功能代码与依赖 2. 新增自定义频道导入与管理功能 3. 优化iOS/macOS平台配置与适配 4. 重构路由转场逻辑为原生Cupertino风格 5. 修复设备发现与文件传输相关bug 6. 调整深色模式默认值为纯黑AMOLED 7. 新增运行模式标签与Spotlight搜索优化 8. 清理废弃的本地化字符串与设置项
610 lines
30 KiB
Dart
610 lines
30 KiB
Dart
// 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 'custom_channel.dart';
|
|
|
|
// **************************************************************************
|
|
// FreezedGenerator
|
|
// **************************************************************************
|
|
|
|
// dart format off
|
|
T _$identity<T>(T value) => value;
|
|
|
|
/// @nodoc
|
|
mixin _$ChannelSource {
|
|
|
|
String get id; String get channelId; SourceType get type; String get url; String get filePath; DataFormat get format; FileDataFormat get fileFormat; Map<String, String> get fieldMap; String get requestFreq; bool get cacheEnabled; int get cacheTtl; bool get autoRefresh; bool get dedupEnabled; DateTime? get lastFetchAt; String get status; DateTime? get createdAt;
|
|
/// Create a copy of ChannelSource
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$ChannelSourceCopyWith<ChannelSource> get copyWith => _$ChannelSourceCopyWithImpl<ChannelSource>(this as ChannelSource, _$identity);
|
|
|
|
/// Serializes this ChannelSource to a JSON map.
|
|
Map<String, dynamic> toJson();
|
|
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is ChannelSource&&(identical(other.id, id) || other.id == id)&&(identical(other.channelId, channelId) || other.channelId == channelId)&&(identical(other.type, type) || other.type == type)&&(identical(other.url, url) || other.url == url)&&(identical(other.filePath, filePath) || other.filePath == filePath)&&(identical(other.format, format) || other.format == format)&&(identical(other.fileFormat, fileFormat) || other.fileFormat == fileFormat)&&const DeepCollectionEquality().equals(other.fieldMap, fieldMap)&&(identical(other.requestFreq, requestFreq) || other.requestFreq == requestFreq)&&(identical(other.cacheEnabled, cacheEnabled) || other.cacheEnabled == cacheEnabled)&&(identical(other.cacheTtl, cacheTtl) || other.cacheTtl == cacheTtl)&&(identical(other.autoRefresh, autoRefresh) || other.autoRefresh == autoRefresh)&&(identical(other.dedupEnabled, dedupEnabled) || other.dedupEnabled == dedupEnabled)&&(identical(other.lastFetchAt, lastFetchAt) || other.lastFetchAt == lastFetchAt)&&(identical(other.status, status) || other.status == status)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(runtimeType,id,channelId,type,url,filePath,format,fileFormat,const DeepCollectionEquality().hash(fieldMap),requestFreq,cacheEnabled,cacheTtl,autoRefresh,dedupEnabled,lastFetchAt,status,createdAt);
|
|
|
|
@override
|
|
String toString() {
|
|
return 'ChannelSource(id: $id, channelId: $channelId, type: $type, url: $url, filePath: $filePath, format: $format, fileFormat: $fileFormat, fieldMap: $fieldMap, requestFreq: $requestFreq, cacheEnabled: $cacheEnabled, cacheTtl: $cacheTtl, autoRefresh: $autoRefresh, dedupEnabled: $dedupEnabled, lastFetchAt: $lastFetchAt, status: $status, createdAt: $createdAt)';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $ChannelSourceCopyWith<$Res> {
|
|
factory $ChannelSourceCopyWith(ChannelSource value, $Res Function(ChannelSource) _then) = _$ChannelSourceCopyWithImpl;
|
|
@useResult
|
|
$Res call({
|
|
String id, String channelId, SourceType type, String url, String filePath, DataFormat format, FileDataFormat fileFormat, Map<String, String> fieldMap, String requestFreq, bool cacheEnabled, int cacheTtl, bool autoRefresh, bool dedupEnabled, DateTime? lastFetchAt, String status, DateTime? createdAt
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
/// @nodoc
|
|
class _$ChannelSourceCopyWithImpl<$Res>
|
|
implements $ChannelSourceCopyWith<$Res> {
|
|
_$ChannelSourceCopyWithImpl(this._self, this._then);
|
|
|
|
final ChannelSource _self;
|
|
final $Res Function(ChannelSource) _then;
|
|
|
|
/// Create a copy of ChannelSource
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? channelId = null,Object? type = null,Object? url = null,Object? filePath = null,Object? format = null,Object? fileFormat = null,Object? fieldMap = null,Object? requestFreq = null,Object? cacheEnabled = null,Object? cacheTtl = null,Object? autoRefresh = null,Object? dedupEnabled = null,Object? lastFetchAt = freezed,Object? status = null,Object? createdAt = freezed,}) {
|
|
return _then(_self.copyWith(
|
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
|
as String,channelId: null == channelId ? _self.channelId : channelId // ignore: cast_nullable_to_non_nullable
|
|
as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
|
as SourceType,url: null == url ? _self.url : url // ignore: cast_nullable_to_non_nullable
|
|
as String,filePath: null == filePath ? _self.filePath : filePath // ignore: cast_nullable_to_non_nullable
|
|
as String,format: null == format ? _self.format : format // ignore: cast_nullable_to_non_nullable
|
|
as DataFormat,fileFormat: null == fileFormat ? _self.fileFormat : fileFormat // ignore: cast_nullable_to_non_nullable
|
|
as FileDataFormat,fieldMap: null == fieldMap ? _self.fieldMap : fieldMap // ignore: cast_nullable_to_non_nullable
|
|
as Map<String, String>,requestFreq: null == requestFreq ? _self.requestFreq : requestFreq // ignore: cast_nullable_to_non_nullable
|
|
as String,cacheEnabled: null == cacheEnabled ? _self.cacheEnabled : cacheEnabled // ignore: cast_nullable_to_non_nullable
|
|
as bool,cacheTtl: null == cacheTtl ? _self.cacheTtl : cacheTtl // ignore: cast_nullable_to_non_nullable
|
|
as int,autoRefresh: null == autoRefresh ? _self.autoRefresh : autoRefresh // ignore: cast_nullable_to_non_nullable
|
|
as bool,dedupEnabled: null == dedupEnabled ? _self.dedupEnabled : dedupEnabled // ignore: cast_nullable_to_non_nullable
|
|
as bool,lastFetchAt: freezed == lastFetchAt ? _self.lastFetchAt : lastFetchAt // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
|
as String,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,
|
|
));
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/// Adds pattern-matching-related methods to [ChannelSource].
|
|
extension ChannelSourcePatterns on ChannelSource {
|
|
/// 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( _ChannelSource value)? $default,{required TResult orElse(),}){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _ChannelSource() 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( _ChannelSource value) $default,){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _ChannelSource():
|
|
return $default(_that);}
|
|
}
|
|
/// A variant of `map` that fallback to returning `null`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _ChannelSource value)? $default,){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _ChannelSource() 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 channelId, SourceType type, String url, String filePath, DataFormat format, FileDataFormat fileFormat, Map<String, String> fieldMap, String requestFreq, bool cacheEnabled, int cacheTtl, bool autoRefresh, bool dedupEnabled, DateTime? lastFetchAt, String status, DateTime? createdAt)? $default,{required TResult orElse(),}) {final _that = this;
|
|
switch (_that) {
|
|
case _ChannelSource() when $default != null:
|
|
return $default(_that.id,_that.channelId,_that.type,_that.url,_that.filePath,_that.format,_that.fileFormat,_that.fieldMap,_that.requestFreq,_that.cacheEnabled,_that.cacheTtl,_that.autoRefresh,_that.dedupEnabled,_that.lastFetchAt,_that.status,_that.createdAt);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 channelId, SourceType type, String url, String filePath, DataFormat format, FileDataFormat fileFormat, Map<String, String> fieldMap, String requestFreq, bool cacheEnabled, int cacheTtl, bool autoRefresh, bool dedupEnabled, DateTime? lastFetchAt, String status, DateTime? createdAt) $default,) {final _that = this;
|
|
switch (_that) {
|
|
case _ChannelSource():
|
|
return $default(_that.id,_that.channelId,_that.type,_that.url,_that.filePath,_that.format,_that.fileFormat,_that.fieldMap,_that.requestFreq,_that.cacheEnabled,_that.cacheTtl,_that.autoRefresh,_that.dedupEnabled,_that.lastFetchAt,_that.status,_that.createdAt);}
|
|
}
|
|
/// 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 channelId, SourceType type, String url, String filePath, DataFormat format, FileDataFormat fileFormat, Map<String, String> fieldMap, String requestFreq, bool cacheEnabled, int cacheTtl, bool autoRefresh, bool dedupEnabled, DateTime? lastFetchAt, String status, DateTime? createdAt)? $default,) {final _that = this;
|
|
switch (_that) {
|
|
case _ChannelSource() when $default != null:
|
|
return $default(_that.id,_that.channelId,_that.type,_that.url,_that.filePath,_that.format,_that.fileFormat,_that.fieldMap,_that.requestFreq,_that.cacheEnabled,_that.cacheTtl,_that.autoRefresh,_that.dedupEnabled,_that.lastFetchAt,_that.status,_that.createdAt);case _:
|
|
return null;
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
@JsonSerializable()
|
|
|
|
class _ChannelSource implements ChannelSource {
|
|
const _ChannelSource({required this.id, required this.channelId, required this.type, this.url = '', this.filePath = '', this.format = DataFormat.hitokoto, this.fileFormat = FileDataFormat.json, final Map<String, String> fieldMap = const {}, this.requestFreq = '5min', this.cacheEnabled = true, this.cacheTtl = 300, this.autoRefresh = true, this.dedupEnabled = true, this.lastFetchAt, this.status = 'active', this.createdAt}): _fieldMap = fieldMap;
|
|
factory _ChannelSource.fromJson(Map<String, dynamic> json) => _$ChannelSourceFromJson(json);
|
|
|
|
@override final String id;
|
|
@override final String channelId;
|
|
@override final SourceType type;
|
|
@override@JsonKey() final String url;
|
|
@override@JsonKey() final String filePath;
|
|
@override@JsonKey() final DataFormat format;
|
|
@override@JsonKey() final FileDataFormat fileFormat;
|
|
final Map<String, String> _fieldMap;
|
|
@override@JsonKey() Map<String, String> get fieldMap {
|
|
if (_fieldMap is EqualUnmodifiableMapView) return _fieldMap;
|
|
// ignore: implicit_dynamic_type
|
|
return EqualUnmodifiableMapView(_fieldMap);
|
|
}
|
|
|
|
@override@JsonKey() final String requestFreq;
|
|
@override@JsonKey() final bool cacheEnabled;
|
|
@override@JsonKey() final int cacheTtl;
|
|
@override@JsonKey() final bool autoRefresh;
|
|
@override@JsonKey() final bool dedupEnabled;
|
|
@override final DateTime? lastFetchAt;
|
|
@override@JsonKey() final String status;
|
|
@override final DateTime? createdAt;
|
|
|
|
/// Create a copy of ChannelSource
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
_$ChannelSourceCopyWith<_ChannelSource> get copyWith => __$ChannelSourceCopyWithImpl<_ChannelSource>(this, _$identity);
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
return _$ChannelSourceToJson(this, );
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ChannelSource&&(identical(other.id, id) || other.id == id)&&(identical(other.channelId, channelId) || other.channelId == channelId)&&(identical(other.type, type) || other.type == type)&&(identical(other.url, url) || other.url == url)&&(identical(other.filePath, filePath) || other.filePath == filePath)&&(identical(other.format, format) || other.format == format)&&(identical(other.fileFormat, fileFormat) || other.fileFormat == fileFormat)&&const DeepCollectionEquality().equals(other._fieldMap, _fieldMap)&&(identical(other.requestFreq, requestFreq) || other.requestFreq == requestFreq)&&(identical(other.cacheEnabled, cacheEnabled) || other.cacheEnabled == cacheEnabled)&&(identical(other.cacheTtl, cacheTtl) || other.cacheTtl == cacheTtl)&&(identical(other.autoRefresh, autoRefresh) || other.autoRefresh == autoRefresh)&&(identical(other.dedupEnabled, dedupEnabled) || other.dedupEnabled == dedupEnabled)&&(identical(other.lastFetchAt, lastFetchAt) || other.lastFetchAt == lastFetchAt)&&(identical(other.status, status) || other.status == status)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(runtimeType,id,channelId,type,url,filePath,format,fileFormat,const DeepCollectionEquality().hash(_fieldMap),requestFreq,cacheEnabled,cacheTtl,autoRefresh,dedupEnabled,lastFetchAt,status,createdAt);
|
|
|
|
@override
|
|
String toString() {
|
|
return 'ChannelSource(id: $id, channelId: $channelId, type: $type, url: $url, filePath: $filePath, format: $format, fileFormat: $fileFormat, fieldMap: $fieldMap, requestFreq: $requestFreq, cacheEnabled: $cacheEnabled, cacheTtl: $cacheTtl, autoRefresh: $autoRefresh, dedupEnabled: $dedupEnabled, lastFetchAt: $lastFetchAt, status: $status, createdAt: $createdAt)';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class _$ChannelSourceCopyWith<$Res> implements $ChannelSourceCopyWith<$Res> {
|
|
factory _$ChannelSourceCopyWith(_ChannelSource value, $Res Function(_ChannelSource) _then) = __$ChannelSourceCopyWithImpl;
|
|
@override @useResult
|
|
$Res call({
|
|
String id, String channelId, SourceType type, String url, String filePath, DataFormat format, FileDataFormat fileFormat, Map<String, String> fieldMap, String requestFreq, bool cacheEnabled, int cacheTtl, bool autoRefresh, bool dedupEnabled, DateTime? lastFetchAt, String status, DateTime? createdAt
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
/// @nodoc
|
|
class __$ChannelSourceCopyWithImpl<$Res>
|
|
implements _$ChannelSourceCopyWith<$Res> {
|
|
__$ChannelSourceCopyWithImpl(this._self, this._then);
|
|
|
|
final _ChannelSource _self;
|
|
final $Res Function(_ChannelSource) _then;
|
|
|
|
/// Create a copy of ChannelSource
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? channelId = null,Object? type = null,Object? url = null,Object? filePath = null,Object? format = null,Object? fileFormat = null,Object? fieldMap = null,Object? requestFreq = null,Object? cacheEnabled = null,Object? cacheTtl = null,Object? autoRefresh = null,Object? dedupEnabled = null,Object? lastFetchAt = freezed,Object? status = null,Object? createdAt = freezed,}) {
|
|
return _then(_ChannelSource(
|
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
|
as String,channelId: null == channelId ? _self.channelId : channelId // ignore: cast_nullable_to_non_nullable
|
|
as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
|
as SourceType,url: null == url ? _self.url : url // ignore: cast_nullable_to_non_nullable
|
|
as String,filePath: null == filePath ? _self.filePath : filePath // ignore: cast_nullable_to_non_nullable
|
|
as String,format: null == format ? _self.format : format // ignore: cast_nullable_to_non_nullable
|
|
as DataFormat,fileFormat: null == fileFormat ? _self.fileFormat : fileFormat // ignore: cast_nullable_to_non_nullable
|
|
as FileDataFormat,fieldMap: null == fieldMap ? _self._fieldMap : fieldMap // ignore: cast_nullable_to_non_nullable
|
|
as Map<String, String>,requestFreq: null == requestFreq ? _self.requestFreq : requestFreq // ignore: cast_nullable_to_non_nullable
|
|
as String,cacheEnabled: null == cacheEnabled ? _self.cacheEnabled : cacheEnabled // ignore: cast_nullable_to_non_nullable
|
|
as bool,cacheTtl: null == cacheTtl ? _self.cacheTtl : cacheTtl // ignore: cast_nullable_to_non_nullable
|
|
as int,autoRefresh: null == autoRefresh ? _self.autoRefresh : autoRefresh // ignore: cast_nullable_to_non_nullable
|
|
as bool,dedupEnabled: null == dedupEnabled ? _self.dedupEnabled : dedupEnabled // ignore: cast_nullable_to_non_nullable
|
|
as bool,lastFetchAt: freezed == lastFetchAt ? _self.lastFetchAt : lastFetchAt // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
|
as String,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,
|
|
));
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/// @nodoc
|
|
mixin _$CustomChannel {
|
|
|
|
String get id; String get name; String get icon; bool get isEnabled; int get totalCount; bool get isMerged; List<ChannelSource> get sources; DateTime? get createdAt; DateTime? get updatedAt;
|
|
/// Create a copy of CustomChannel
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$CustomChannelCopyWith<CustomChannel> get copyWith => _$CustomChannelCopyWithImpl<CustomChannel>(this as CustomChannel, _$identity);
|
|
|
|
/// Serializes this CustomChannel to a JSON map.
|
|
Map<String, dynamic> toJson();
|
|
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is CustomChannel&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.isEnabled, isEnabled) || other.isEnabled == isEnabled)&&(identical(other.totalCount, totalCount) || other.totalCount == totalCount)&&(identical(other.isMerged, isMerged) || other.isMerged == isMerged)&&const DeepCollectionEquality().equals(other.sources, sources)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(runtimeType,id,name,icon,isEnabled,totalCount,isMerged,const DeepCollectionEquality().hash(sources),createdAt,updatedAt);
|
|
|
|
@override
|
|
String toString() {
|
|
return 'CustomChannel(id: $id, name: $name, icon: $icon, isEnabled: $isEnabled, totalCount: $totalCount, isMerged: $isMerged, sources: $sources, createdAt: $createdAt, updatedAt: $updatedAt)';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $CustomChannelCopyWith<$Res> {
|
|
factory $CustomChannelCopyWith(CustomChannel value, $Res Function(CustomChannel) _then) = _$CustomChannelCopyWithImpl;
|
|
@useResult
|
|
$Res call({
|
|
String id, String name, String icon, bool isEnabled, int totalCount, bool isMerged, List<ChannelSource> sources, DateTime? createdAt, DateTime? updatedAt
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
/// @nodoc
|
|
class _$CustomChannelCopyWithImpl<$Res>
|
|
implements $CustomChannelCopyWith<$Res> {
|
|
_$CustomChannelCopyWithImpl(this._self, this._then);
|
|
|
|
final CustomChannel _self;
|
|
final $Res Function(CustomChannel) _then;
|
|
|
|
/// Create a copy of CustomChannel
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = null,Object? icon = null,Object? isEnabled = null,Object? totalCount = null,Object? isMerged = null,Object? sources = null,Object? createdAt = freezed,Object? updatedAt = freezed,}) {
|
|
return _then(_self.copyWith(
|
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
|
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
|
as String,icon: null == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable
|
|
as String,isEnabled: null == isEnabled ? _self.isEnabled : isEnabled // ignore: cast_nullable_to_non_nullable
|
|
as bool,totalCount: null == totalCount ? _self.totalCount : totalCount // ignore: cast_nullable_to_non_nullable
|
|
as int,isMerged: null == isMerged ? _self.isMerged : isMerged // ignore: cast_nullable_to_non_nullable
|
|
as bool,sources: null == sources ? _self.sources : sources // ignore: cast_nullable_to_non_nullable
|
|
as List<ChannelSource>,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,
|
|
));
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/// Adds pattern-matching-related methods to [CustomChannel].
|
|
extension CustomChannelPatterns on CustomChannel {
|
|
/// 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( _CustomChannel value)? $default,{required TResult orElse(),}){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _CustomChannel() 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( _CustomChannel value) $default,){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _CustomChannel():
|
|
return $default(_that);}
|
|
}
|
|
/// A variant of `map` that fallback to returning `null`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _CustomChannel value)? $default,){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _CustomChannel() 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 name, String icon, bool isEnabled, int totalCount, bool isMerged, List<ChannelSource> sources, DateTime? createdAt, DateTime? updatedAt)? $default,{required TResult orElse(),}) {final _that = this;
|
|
switch (_that) {
|
|
case _CustomChannel() when $default != null:
|
|
return $default(_that.id,_that.name,_that.icon,_that.isEnabled,_that.totalCount,_that.isMerged,_that.sources,_that.createdAt,_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( String id, String name, String icon, bool isEnabled, int totalCount, bool isMerged, List<ChannelSource> sources, DateTime? createdAt, DateTime? updatedAt) $default,) {final _that = this;
|
|
switch (_that) {
|
|
case _CustomChannel():
|
|
return $default(_that.id,_that.name,_that.icon,_that.isEnabled,_that.totalCount,_that.isMerged,_that.sources,_that.createdAt,_that.updatedAt);}
|
|
}
|
|
/// 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 name, String icon, bool isEnabled, int totalCount, bool isMerged, List<ChannelSource> sources, DateTime? createdAt, DateTime? updatedAt)? $default,) {final _that = this;
|
|
switch (_that) {
|
|
case _CustomChannel() when $default != null:
|
|
return $default(_that.id,_that.name,_that.icon,_that.isEnabled,_that.totalCount,_that.isMerged,_that.sources,_that.createdAt,_that.updatedAt);case _:
|
|
return null;
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
@JsonSerializable()
|
|
|
|
class _CustomChannel extends CustomChannel {
|
|
const _CustomChannel({required this.id, required this.name, this.icon = '📋', this.isEnabled = true, this.totalCount = 0, this.isMerged = false, final List<ChannelSource> sources = const [], this.createdAt, this.updatedAt}): _sources = sources,super._();
|
|
factory _CustomChannel.fromJson(Map<String, dynamic> json) => _$CustomChannelFromJson(json);
|
|
|
|
@override final String id;
|
|
@override final String name;
|
|
@override@JsonKey() final String icon;
|
|
@override@JsonKey() final bool isEnabled;
|
|
@override@JsonKey() final int totalCount;
|
|
@override@JsonKey() final bool isMerged;
|
|
final List<ChannelSource> _sources;
|
|
@override@JsonKey() List<ChannelSource> get sources {
|
|
if (_sources is EqualUnmodifiableListView) return _sources;
|
|
// ignore: implicit_dynamic_type
|
|
return EqualUnmodifiableListView(_sources);
|
|
}
|
|
|
|
@override final DateTime? createdAt;
|
|
@override final DateTime? updatedAt;
|
|
|
|
/// Create a copy of CustomChannel
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
_$CustomChannelCopyWith<_CustomChannel> get copyWith => __$CustomChannelCopyWithImpl<_CustomChannel>(this, _$identity);
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
return _$CustomChannelToJson(this, );
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _CustomChannel&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.isEnabled, isEnabled) || other.isEnabled == isEnabled)&&(identical(other.totalCount, totalCount) || other.totalCount == totalCount)&&(identical(other.isMerged, isMerged) || other.isMerged == isMerged)&&const DeepCollectionEquality().equals(other._sources, _sources)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(runtimeType,id,name,icon,isEnabled,totalCount,isMerged,const DeepCollectionEquality().hash(_sources),createdAt,updatedAt);
|
|
|
|
@override
|
|
String toString() {
|
|
return 'CustomChannel(id: $id, name: $name, icon: $icon, isEnabled: $isEnabled, totalCount: $totalCount, isMerged: $isMerged, sources: $sources, createdAt: $createdAt, updatedAt: $updatedAt)';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class _$CustomChannelCopyWith<$Res> implements $CustomChannelCopyWith<$Res> {
|
|
factory _$CustomChannelCopyWith(_CustomChannel value, $Res Function(_CustomChannel) _then) = __$CustomChannelCopyWithImpl;
|
|
@override @useResult
|
|
$Res call({
|
|
String id, String name, String icon, bool isEnabled, int totalCount, bool isMerged, List<ChannelSource> sources, DateTime? createdAt, DateTime? updatedAt
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
/// @nodoc
|
|
class __$CustomChannelCopyWithImpl<$Res>
|
|
implements _$CustomChannelCopyWith<$Res> {
|
|
__$CustomChannelCopyWithImpl(this._self, this._then);
|
|
|
|
final _CustomChannel _self;
|
|
final $Res Function(_CustomChannel) _then;
|
|
|
|
/// Create a copy of CustomChannel
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? name = null,Object? icon = null,Object? isEnabled = null,Object? totalCount = null,Object? isMerged = null,Object? sources = null,Object? createdAt = freezed,Object? updatedAt = freezed,}) {
|
|
return _then(_CustomChannel(
|
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
|
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
|
as String,icon: null == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable
|
|
as String,isEnabled: null == isEnabled ? _self.isEnabled : isEnabled // ignore: cast_nullable_to_non_nullable
|
|
as bool,totalCount: null == totalCount ? _self.totalCount : totalCount // ignore: cast_nullable_to_non_nullable
|
|
as int,isMerged: null == isMerged ? _self.isMerged : isMerged // ignore: cast_nullable_to_non_nullable
|
|
as bool,sources: null == sources ? _self._sources : sources // ignore: cast_nullable_to_non_nullable
|
|
as List<ChannelSource>,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,
|
|
));
|
|
}
|
|
|
|
|
|
}
|
|
|
|
// dart format on
|