主要变更: 1. 移除摇一摇相关功能代码与依赖 2. 新增自定义频道导入与管理功能 3. 优化iOS/macOS平台配置与适配 4. 重构路由转场逻辑为原生Cupertino风格 5. 修复设备发现与文件传输相关bug 6. 调整深色模式默认值为纯黑AMOLED 7. 新增运行模式标签与Spotlight搜索优化 8. 清理废弃的本地化字符串与设置项
108 lines
3.9 KiB
Dart
108 lines
3.9 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'custom_channel.dart';
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
_ChannelSource _$ChannelSourceFromJson(Map<String, dynamic> json) =>
|
|
_ChannelSource(
|
|
id: json['id'] as String,
|
|
channelId: json['channel_id'] as String,
|
|
type: $enumDecode(_$SourceTypeEnumMap, json['type']),
|
|
url: json['url'] as String? ?? '',
|
|
filePath: json['file_path'] as String? ?? '',
|
|
format:
|
|
$enumDecodeNullable(_$DataFormatEnumMap, json['format']) ??
|
|
DataFormat.hitokoto,
|
|
fileFormat:
|
|
$enumDecodeNullable(_$FileDataFormatEnumMap, json['file_format']) ??
|
|
FileDataFormat.json,
|
|
fieldMap:
|
|
(json['field_map'] as Map<String, dynamic>?)?.map(
|
|
(k, e) => MapEntry(k, e as String),
|
|
) ??
|
|
const {},
|
|
requestFreq: json['request_freq'] as String? ?? '5min',
|
|
cacheEnabled: json['cache_enabled'] as bool? ?? true,
|
|
cacheTtl: (json['cache_ttl'] as num?)?.toInt() ?? 300,
|
|
autoRefresh: json['auto_refresh'] as bool? ?? true,
|
|
dedupEnabled: json['dedup_enabled'] as bool? ?? true,
|
|
lastFetchAt: json['last_fetch_at'] == null
|
|
? null
|
|
: DateTime.parse(json['last_fetch_at'] as String),
|
|
status: json['status'] as String? ?? 'active',
|
|
createdAt: json['created_at'] == null
|
|
? null
|
|
: DateTime.parse(json['created_at'] as String),
|
|
);
|
|
|
|
Map<String, dynamic> _$ChannelSourceToJson(_ChannelSource instance) =>
|
|
<String, dynamic>{
|
|
'id': instance.id,
|
|
'channel_id': instance.channelId,
|
|
'type': _$SourceTypeEnumMap[instance.type]!,
|
|
'url': instance.url,
|
|
'file_path': instance.filePath,
|
|
'format': _$DataFormatEnumMap[instance.format]!,
|
|
'file_format': _$FileDataFormatEnumMap[instance.fileFormat]!,
|
|
'field_map': instance.fieldMap,
|
|
'request_freq': instance.requestFreq,
|
|
'cache_enabled': instance.cacheEnabled,
|
|
'cache_ttl': instance.cacheTtl,
|
|
'auto_refresh': instance.autoRefresh,
|
|
'dedup_enabled': instance.dedupEnabled,
|
|
'last_fetch_at': ?instance.lastFetchAt?.toIso8601String(),
|
|
'status': instance.status,
|
|
'created_at': ?instance.createdAt?.toIso8601String(),
|
|
};
|
|
|
|
const _$SourceTypeEnumMap = {SourceType.url: 'url', SourceType.file: 'file'};
|
|
|
|
const _$DataFormatEnumMap = {
|
|
DataFormat.hitokoto: 'hitokoto',
|
|
DataFormat.xianyanV1: 'xianyanV1',
|
|
DataFormat.custom: 'custom',
|
|
};
|
|
|
|
const _$FileDataFormatEnumMap = {
|
|
FileDataFormat.json: 'json',
|
|
FileDataFormat.csv: 'csv',
|
|
FileDataFormat.xml: 'xml',
|
|
};
|
|
|
|
_CustomChannel _$CustomChannelFromJson(Map<String, dynamic> json) =>
|
|
_CustomChannel(
|
|
id: json['id'] as String,
|
|
name: json['name'] as String,
|
|
icon: json['icon'] as String? ?? '📋',
|
|
isEnabled: json['is_enabled'] as bool? ?? true,
|
|
totalCount: (json['total_count'] as num?)?.toInt() ?? 0,
|
|
isMerged: json['is_merged'] as bool? ?? false,
|
|
sources:
|
|
(json['sources'] as List<dynamic>?)
|
|
?.map((e) => ChannelSource.fromJson(e as Map<String, dynamic>))
|
|
.toList() ??
|
|
const [],
|
|
createdAt: json['created_at'] == null
|
|
? null
|
|
: DateTime.parse(json['created_at'] as String),
|
|
updatedAt: json['updated_at'] == null
|
|
? null
|
|
: DateTime.parse(json['updated_at'] as String),
|
|
);
|
|
|
|
Map<String, dynamic> _$CustomChannelToJson(_CustomChannel instance) =>
|
|
<String, dynamic>{
|
|
'id': instance.id,
|
|
'name': instance.name,
|
|
'icon': instance.icon,
|
|
'is_enabled': instance.isEnabled,
|
|
'total_count': instance.totalCount,
|
|
'is_merged': instance.isMerged,
|
|
'sources': instance.sources,
|
|
'created_at': ?instance.createdAt?.toIso8601String(),
|
|
'updated_at': ?instance.updatedAt?.toIso8601String(),
|
|
};
|