feat: 新增工作台模式、系统托盘,修复多平台兼容性问题
1. 新增工作台三栏布局模式,适配宽屏设备 2. 添加跨平台系统托盘支持,新增托盘图标资源 3. 修复工作台模式下导航返回异常问题 4. 统一JSON类型安全解析,替换硬类型转换 5. 增加macOS深度链接支持,统一渠道分发信息 6. 优化部分页面生命周期和状态加载逻辑 7. 移除废弃的nearby_connections依赖
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
// ============================================================
|
||||
// 闲言APP — 云端暂存记录模型
|
||||
// 创建时间: 2026-05-12
|
||||
// 更新时间: 2026-05-12
|
||||
// 更新时间: 2026-06-19
|
||||
// 作用: 云端暂存文件记录 — 上传/下载/过期/加密状态管理
|
||||
// 上次更新: v11.1.0 初始版本
|
||||
// 上次更新: 类型安全修复(int vs num): fromJson 时间戳使用 SafeJson.parseInt
|
||||
// ============================================================
|
||||
|
||||
import 'package:xianyan/core/utils/safe_json.dart';
|
||||
|
||||
enum CloudCacheUploadStatus {
|
||||
pending('pending', '待上传', '⏳'),
|
||||
encrypting('encrypting', '加密中', '🔐'),
|
||||
@@ -193,21 +195,21 @@ class CloudCacheRecord {
|
||||
json['downloadStatus'] as String? ?? 'none',
|
||||
),
|
||||
expiresAt: json['expiresAt'] != null
|
||||
? DateTime.fromMillisecondsSinceEpoch(json['expiresAt'] as int)
|
||||
? DateTime.fromMillisecondsSinceEpoch(SafeJson.parseInt(json['expiresAt']))
|
||||
: null,
|
||||
uploadedAt: json['uploadedAt'] != null
|
||||
? DateTime.fromMillisecondsSinceEpoch(json['uploadedAt'] as int)
|
||||
? DateTime.fromMillisecondsSinceEpoch(SafeJson.parseInt(json['uploadedAt']))
|
||||
: null,
|
||||
downloadedAt: json['downloadedAt'] != null
|
||||
? DateTime.fromMillisecondsSinceEpoch(json['downloadedAt'] as int)
|
||||
? DateTime.fromMillisecondsSinceEpoch(SafeJson.parseInt(json['downloadedAt']))
|
||||
: null,
|
||||
ownerId: json['ownerId'] as String? ?? '',
|
||||
targetId: json['targetId'] as String?,
|
||||
createdAt: json['createdAt'] != null
|
||||
? DateTime.fromMillisecondsSinceEpoch(json['createdAt'] as int)
|
||||
? DateTime.fromMillisecondsSinceEpoch(SafeJson.parseInt(json['createdAt']))
|
||||
: DateTime.now(),
|
||||
updatedAt: json['updatedAt'] != null
|
||||
? DateTime.fromMillisecondsSinceEpoch(json['updatedAt'] as int)
|
||||
? DateTime.fromMillisecondsSinceEpoch(SafeJson.parseInt(json['updatedAt']))
|
||||
: null,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
// ============================================================
|
||||
// 闲言APP — 传输任务模型
|
||||
// 创建时间: 2026-05-09
|
||||
// 更新时间: 2026-05-12
|
||||
// 更新时间: 2026-06-19
|
||||
// 作用: 文件传输助手传输任务数据模型 — 进度/速度/状态/校验/断点续传
|
||||
// 上次更新: v11.0.0 新增断点续传字段(fileId/totalChunks/receivedChunks/retryCount等)
|
||||
// 上次更新: 类型安全修复(int vs num): receivedChunks 列表元素使用 SafeJson.parseInt
|
||||
// ============================================================
|
||||
|
||||
import 'package:xianyan/core/utils/safe_json.dart';
|
||||
import 'transfer_enums.dart';
|
||||
import 'transfer_device.dart';
|
||||
|
||||
@@ -288,7 +289,7 @@ class TransferTask {
|
||||
chunkSize: (json['chunkSize'] as num?)?.toInt() ?? 65536,
|
||||
totalChunks: (json['totalChunks'] as num?)?.toInt(),
|
||||
receivedChunks: (json['receivedChunks'] as List<dynamic>?)
|
||||
?.map((e) => e as int)
|
||||
?.map((e) => SafeJson.parseInt(e))
|
||||
.toSet(),
|
||||
retryCount: (json['retryCount'] as num?)?.toInt() ?? 0,
|
||||
maxRetries: (json['maxRetries'] as num?)?.toInt() ?? 3,
|
||||
|
||||
Reference in New Issue
Block a user