371 Commits
Author SHA1 Message Date
Vicky a3f3481f4f feat: phase1 UI prep — 设备ID系统传递 + 国家本地化展示 + 继续观看直进播放页
设备标识: Android SSAID/ iOS IDFV 原生通道 → Dart DeviceIdProvider
国家解析: 注册/登录从后端 IP → 国家/语言/时区/币种 自动落库
账号资料: 全部本地化展示 (account_display.dart)
我的页: 继续观看卡片点击直接进播放页
2026-10-27 15:45:20 +08:00
Vicky 1b19513efb feat(core): 设备号改用系统标识,重装不再变成新游客
- Android 读 SSAID、iOS 读 IDFV,均免权限,由原生通道提供,不引插件
- 取不到时回退本地 UUIDv4,替代原来 32 位随机 + 时间戳的拼接
2026-10-27 14:15:50 +08:00
Vicky 935de13343 refactor(core): 平台上报收敛为单个请求头
去掉 device_info_plus 依赖与机型/系统版本,只保留 X-Client-Platform。
2026-10-27 14:00:19 +08:00
Vicky 01a3b0101e chore(merge): 合并客户端设备画像上报 2026-10-27 13:54:29 +08:00
Vicky d6df5fbe5f feat(core): 请求头统一上报设备系统与机型
- 新增 DeviceProfileReader,首次读取后缓存,插件不可用时安全降级
- 拦截器为所有请求补 X-Client-Platform / Os / Model,匿名请求同样携带
2026-10-27 13:54:28 +08:00
Vicky 929b7f72f8 chore(merge): 合并右侧操作栏顺序统一 2026-10-27 13:35:41 +08:00
Vicky e028ca40b1 fix(ui): 统一播放页右侧操作栏顺序为收藏-点赞-评论-分享
与推荐页操作栏保持一致,同步更新布局断言。
2026-10-27 13:35:41 +08:00
Zhou Weidong d206465ee1 fix(recommend): 首屏不再兜出重试空态 2026-10-27 11:24:21 +08:00
Zhou Weidong 9117bf58b8 fix(ui): 拆分媒体骨架底色,恢复可见度 2026-10-27 11:16:24 +08:00
Zhou Weidong bd826a9236 fix(ui): 骨架屏扫光收窄压淡 2026-10-27 11:12:31 +08:00
Zhou Weidong a5dbae7fff fix(ui): 骨架屏改为逐卡片扫光 2026-10-27 11:08:43 +08:00
Zhou Weidong 00405d2e3b fix(ui): 收敛骨架屏亮度 2026-10-27 10:49:30 +08:00
Zhou Weidong 72dcb92aca fix(following): 收紧取消追剧确认弹窗 2026-10-27 10:34:07 +08:00
Zhou Weidong 8d511933df fix(mine): 支持未登录展示互动计数 2026-10-27 10:26:11 +08:00
Zhou Weidong 06a2f6d7c0 fix(following): 支持未登录追剧与历史 2026-10-27 10:13:27 +08:00
Zhou Weidong 0d785bf1f8 feat(library): 支持设备追剧与观看历史 2026-10-27 09:54:51 +08:00
Zhou Weidong 4c3acb047c fix(player): 收紧推荐页互动栏间距 2026-10-27 09:37:00 +08:00
Zhou Weidong d3dbc9f8dc fix(favorite): 统一收藏状态与互动图标 2026-10-27 09:31:48 +08:00
Zhou Weidong 4b97f89c0b fix(recommend): 延后推荐数据刷新 2026-10-27 09:19:18 +08:00
Zhou Weidong 6be024f86f test(flutter): 收敛异步配置与分页测试 2026-10-26 22:49:27 +08:00
Zhou Weidong 6512808506 test(ui): 更新主题导航与布局断言 2026-10-26 22:49:23 +08:00
Zhou Weidong 2d65cd3006 test(auth): 更新登录失败提示断言 2026-10-26 22:49:21 +08:00
Zhou Weidong 391b01e9d0 fix(theater): 修复新剧卡片与榜单溢出 2026-10-26 22:49:13 +08:00
Zhou Weidong d4ce3a5d8b fix(home): 修复目录错误态被占位层遮挡 2026-10-26 22:49:10 +08:00
Zhou Weidong bf47c065c9 fix(ui): 修复继续观看卡片纵向溢出 2026-10-26 22:49:07 +08:00
Zhou Weidong c6b3ca9311 fix(auth): 禁止刷新接口递归重试 2026-10-26 22:49:04 +08:00
Zhou Weidong a3d50eb935 feat(interaction): 支持游客点赞收藏评论 2026-10-26 22:33:14 +08:00
Zhou Weidong 188811fde6 feat(player): 切集刷新互动计数统计 2026-10-26 21:40:39 +08:00
Zhou Weidong 37353dac15 fix(player): 观看全集进入后自动播放 2026-10-26 21:25:38 +08:00
Zhou Weidong 350d16db75 fix(player): 修正缓冲态与首帧时间闪现 2026-10-26 21:13:55 +08:00
Zhou Weidong 0f27daf664 chore(merge): 合并播放器切集与双击点赞优化 2026-10-26 19:24:49 +08:00
Zhou Weidong afdc4af2f2 chore(player): 移除飘心毫秒调试文字 2026-10-26 19:21:24 +08:00
Zhou Weidong 1b50a73bfc fix(player): 修复首次双击点赞状态刷新 2026-10-26 19:17:14 +08:00
Zhou Weidong 978c309cd7 fix(player): 改用墙钟驱动飘心动画 2026-10-26 19:07:56 +08:00
Zhou Weidong c0f65042e6 fix(player): 修正飘心Overlay生命周期 2026-10-26 19:00:37 +08:00
Zhou Weidong a7d01e0306 test(player): 增加飘心像素定位回归 2026-10-26 18:57:04 +08:00
Zhou Weidong ed2cf4c18c fix(player): 使用根Overlay承载飘心 2026-10-26 18:54:05 +08:00
Zhou Weidong db3e153409 fix(player): 使用根Overlay承载飘心 2026-10-26 18:49:36 +08:00
Zhou Weidong 810ca5bf9d fix(player): 延长飘心并显示毫秒计时 2026-10-26 18:48:12 +08:00
Zhou Weidong 84b24775d6 fix(player): 恢复develop飘心实现 2026-10-26 18:38:59 +08:00
Zhou Weidong 9039b27c7f fix(player): 使用根Overlay渲染飘心 2026-10-26 18:35:30 +08:00
Zhou Weidong 30b43878ab fix(player): 使用根Overlay渲染飘心 2026-10-26 18:29:48 +08:00
Zhou Weidong e7afd316f8 fix(player): 放慢随机飘心并验证完整时长 2026-10-26 18:24:19 +08:00
Zhou Weidong f3dd4a9b5c fix(player): 恢复随机飘心粒子模型 2026-10-26 18:19:39 +08:00
Zhou Weidong 94b37ef00f fix(player): 优化双击飘心轨迹 2026-10-26 18:16:06 +08:00
Zhou Weidong bea50ab32f fix(player): 调整双击飘心动画 2026-10-26 18:11:01 +08:00
Zhou Weidong 63296d2a92 fix(player): 恢复独立播放页双击点赞 2026-10-26 18:06:55 +08:00
Zhou Weidong b291044acc fix(player): 收敛播放页入口加载态 2026-10-26 17:56:40 +08:00
Zhou Weidong ee4e573f4f fix(player): 播放页改为非阻塞加载 2026-10-26 17:43:57 +08:00
Zhou Weidong e8f192ccf8 fix(player): 顶层抓帧淡出揭幕 2026-10-26 17:31:59 +08:00
Zhou Weidong c8ec481fc9 fix(player): 预解码观看全集首帧 2026-10-26 17:27:43 +08:00
Zhou Weidong 1fc8c4924e fix(player): 调整观看全集淡入时长 2026-10-26 17:21:52 +08:00
Zhou Weidong 55fc2796a9 fix(player): 观看全集复用抓帧首屏 2026-10-26 17:20:24 +08:00
Zhou Weidong 4d3d067f77 fix(player): 规范预热回收日志并抓帧过渡 2026-10-26 17:13:56 +08:00
Zhou Weidong bb2c729a7e fix(player): 隔离播放资源所有权并修复黑屏 2026-10-26 17:03:19 +08:00
Zhou Weidong 54eb5a60a8 fix(player): 修复返回首页黑屏并恢复预热 2026-10-26 16:45:00 +08:00
Zhou Weidong 6667330ce0 fix(player): 分离首页与播放页播放上下文 2026-10-26 16:37:37 +08:00
Zhou Weidong 440188f261 fix(player): 修复切集返回推荐页黑屏 2026-10-26 16:20:31 +08:00
Zhou Weidong 9d2d3b97a1 fix(player): 独立全屏路由复用播放会话 2026-10-26 16:08:15 +08:00
Zhou Weidong 23e80dd637 fix(player): 复用播放会话进入全屏 2026-10-26 15:55:46 +08:00
Zhou Weidong ab4c246675 fix(player): 保持推荐页返回时播放状态 2026-10-26 15:44:28 +08:00
Zhou Weidong 2a32dec183 fix(player): 持久化竖滑播放画面层 2026-10-26 15:34:24 +08:00
Zhou Weidong 5dafc68775 test(player): 覆盖 feed 高清首帧解析 2026-10-26 15:20:45 +08:00
Zhou Weidong 80c962a95c fix(player): 收紧图片与快速切集资源占用 2026-10-26 15:10:02 +08:00
Zhou Weidong 2fef7470e0 fix(player): 使用高清首帧并稳定切集占位 2026-10-26 14:58:00 +08:00
Zhou Weidong 0cb0ab0613 fix(player): 重构单层过渡并阻止锁定集串播 2026-10-26 14:41:18 +08:00
Zhou Weidong 70d8e0f982 fix(player): 使用雪碧图预热首帧兜底 2026-10-26 14:21:52 +08:00
Zhou Weidong 48b4e67d34 fix(player): 预热直出并与视频统一封面布局 2026-10-26 14:12:42 +08:00
Zhou Weidong a3a79f7068 fix(player): 修正封面比例与首帧切换闪烁 2026-10-26 14:07:36 +08:00
Zhou Weidong 04f034817c fix(player): 优化封面过渡与换集起播 2026-10-26 14:01:42 +08:00
Zhou Weidong 516593499c fix(player): 修复竖滑上一集不自动播放 2026-10-26 13:43:43 +08:00
Zhou Weidong df36890b48 chore(analyze): 清理静态检查告警 2026-10-26 13:43:38 +08:00
Zhou Weidong 222bacdeeb fix(player): 优化上下滑切集黑屏 2026-10-26 13:15:56 +08:00
Zhou Weidong b83b5799e3 chore(merge): 合并 iOS 无线数据选择框触发 2026-10-26 09:35:29 +08:00
Zhou Weidong d4ae8f427f fix(ios): 用系统网络请求唤起无线数据选择
Flutter 的接口请求不会触发系统选择框,进入前台后补一次 URLSession 请求。
2026-10-26 09:35:29 +08:00
Zhou Weidong 98d7debfb5 chore(merge): 合并 iOS 无线数据询问 2026-10-25 21:23:26 +08:00
Zhou Weidong b5e9deb4bd feat(ios): 首次启动询问无线数据权限
iOS 在首个接口请求前等待系统无线数据选择,避免未授权时请求被静默拒绝。
2026-10-25 21:23:25 +08:00
Zhou Weidong 47df002d8e chore(merge): 合并客户端多语言筛选与注销原因修正 2026-10-24 17:22:57 +08:00
Zhou Weidong 4f1feeadbd fix(app): 注销原因对齐到输入框顶部 2026-10-24 17:20:24 +08:00
Zhou Weidong 8b50b5bd06 feat(app): 客户端展示多语言并支持筛选分页 2026-10-24 17:20:24 +08:00
Zhou Weidong 8481611372 chore(merge): 合并错误码三语文案 2026-10-23 13:05:29 +08:00
Zhou Weidong b1e95b370c feat(app): 按错误码展示中英印尼文案 2026-10-23 13:05:29 +08:00
Zhou Weidong 0ef0d46919 chore(merge): 合并未使用注销原因清理 2026-10-23 12:45:30 +08:00
Zhou Weidong b4d38f8e10 refactor(app): 删除未使用的注销原因组件 2026-10-23 12:45:30 +08:00
Zhou Weidong c034627fdb chore(merge): 合并播放协议搜索与空状态 2026-10-23 12:38:47 +08:00
Zhou Weidong ef29fc5f15 feat(app): 完善播放协议搜索与空状态 2026-10-23 12:38:47 +08:00
Zhou Weidong 671e0ce143 merge: 将远程 main 同步到 develop 2026-10-23 08:09:24 +08:00
Zhou Weidong 0f1f64a09f merge: 将 release/v1.0.0 同步到 main 2026-10-23 03:22:26 +08:00
Zhou Weidong d29ae20491 merge: 将客户端调整同步到 release/v1.0.0 2026-10-23 03:21:53 +08:00
Zhou Weidong 12e08a89a4 fix(player): 提高解锁金币标签对比度 2026-10-23 03:18:24 +08:00
Zhou Weidong e0ba54f23b fix(cover): 封面占位改为品牌标识 2026-10-23 03:18:24 +08:00
Zhou Weidong 5043d6c25b fix(l10n): 缩短印尼语全部短剧文案 2026-10-23 03:18:24 +08:00
Zhou Weidong ab6800aba2 fix(search): 避免键盘顶起搜索页 2026-10-23 03:18:24 +08:00
Zhou Weidong f8500bbaca fix(player): 完善进度预览清屏与下拉刷新 2026-10-23 03:18:24 +08:00
Zhou Weidong 9b1afbdb36 feat(recommend): 剧单更多进入两列详情页 2026-10-23 03:18:24 +08:00
Zhou Weidong f4cf7bc2dd fix(home): 调整榜单版式并去掉二级分类 2026-10-23 03:18:24 +08:00
Zhou Weidong 60489d6dca fix(ios): 修复逐帧请求头编译失败 2026-10-23 03:18:23 +08:00
Zhou Weidong 44d3bcba18 style(empty): 放大空状态图标并降低亮度 2026-10-23 01:10:59 +08:00
Zhou Weidong f206977ad8 fix(config): 开发服务地址改为当前局域网 2026-10-23 01:10:59 +08:00
Zhou Weidong f3d64f6fb5 fix(auth): 登录页靠上排列并支持外部失焦 2026-10-23 01:10:59 +08:00
Zhou Weidong 6318ca24ec feat(splash): 缩短开屏停留并统一开屏图 2026-10-23 01:06:07 +08:00
Zhou Weidong b513ac0a9c merge: 调整品牌开屏与纯黑原生启动 2026-10-22 23:15:36 +08:00
Zhou Weidong 25d90e1383 feat: 调整品牌开屏与纯黑原生启动 2026-10-22 23:15:27 +08:00
Zhou Weidong 7804809d83 merge: 开屏后直接展示首页骨架 2026-10-22 23:11:13 +08:00
Zhou Weidong 5f278a3510 feat: 开屏后直接展示首页骨架 2026-10-22 23:11:03 +08:00
Zhou Weidong 56d7abc6b1 merge: 保留系统开屏并更新品牌素材 2026-10-22 23:04:31 +08:00
Zhou Weidong 345cc2ad28 feat: 保留系统开屏并更新品牌素材 2026-10-22 23:04:23 +08:00
Zhou Weidong 41bd4683c3 merge: 更新 App 图标与开屏素材 2026-10-22 22:59:14 +08:00
Zhou Weidong d868ce9336 feat: 更新 App 图标与开屏素材 2026-10-22 22:59:07 +08:00
Zhou Weidong 928ac1de19 merge: 增加搜索结果下拉刷新 2026-10-22 22:53:01 +08:00
Zhou Weidong 6b3d870c93 feat: 增加搜索结果下拉刷新 2026-10-22 22:52:50 +08:00
Zhou Weidong 281f13a810 merge: 调整搜索结果两列布局 2026-10-22 22:50:55 +08:00
Zhou Weidong 8637f5da21 style: 调整搜索结果两列布局 2026-10-22 22:50:47 +08:00
Zhou Weidong 0319f8a6a8 merge: 统一首页与推荐搜索入口 2026-10-22 22:48:29 +08:00
Zhou Weidong 9aa797504b feat: 统一首页与推荐搜索入口 2026-10-22 22:48:21 +08:00
Zhou Weidong 933333b0fe merge: 使用点击序号防止双击误暂停 2026-10-22 22:39:30 +08:00
Zhou Weidong bbc759473c fix: 使用点击序号防止双击误暂停 2026-10-22 22:39:21 +08:00
Zhou Weidong 9ddd7fc833 merge: 修复播放器重复暂停手势 2026-10-22 22:34:26 +08:00
Zhou Weidong 5794dd4e4d fix: 修复播放器重复暂停手势 2026-10-22 22:34:18 +08:00
Zhou Weidong 76c4b528d3 merge: 修正双击点赞与心形联动 2026-10-22 22:30:11 +08:00
Zhou Weidong 68ccfa21c0 fix: 修正双击点赞与心形联动 2026-10-22 22:30:01 +08:00
Zhou Weidong 78d0166eb7 merge: 增加播放器双击点赞与飘心 2026-10-22 22:25:22 +08:00
Zhou Weidong 4140c4eb50 feat: 增加播放器双击点赞与飘心 2026-10-22 22:25:14 +08:00
Zhou Weidong e2cc409e5a merge: 重做首页热播榜布局 2026-10-22 22:20:01 +08:00
Zhou Weidong 9b83283689 feat: 重做首页热播榜布局 2026-10-22 22:19:55 +08:00
Zhou Weidong db8433ace3 merge: 统一下拉与加载指示器 2026-10-22 22:07:21 +08:00
Zhou Weidong 6f1da5aa39 style: 统一下拉与加载指示器 2026-10-22 22:07:13 +08:00
Zhou Weidong 397483d339 merge: 统一全站深色视觉 2026-10-22 22:01:45 +08:00
Zhou Weidong 37e35f4b47 style: 统一全站深色视觉 2026-10-22 22:01:36 +08:00
Zhou Weidong 86aa7e0f4f merge: 增加推荐剧单渐变背景 2026-10-22 21:52:20 +08:00
Zhou Weidong 604ab60b63 style: 增加推荐剧单渐变背景 2026-10-22 21:52:13 +08:00
Zhou Weidong 0b3f362093 merge: 修正我的 UID 行高度 2026-10-22 21:49:54 +08:00
Zhou Weidong 19acbb2278 fix: 修正我的 UID 行高度 2026-10-22 21:49:47 +08:00
Zhou Weidong ce3ecc4d21 merge: 收紧我的用户区信息间距 2026-10-22 21:46:57 +08:00
Zhou Weidong c604cc1333 style: 收紧我的用户区信息间距 2026-10-22 21:46:49 +08:00
Zhou Weidong e7367e99be merge: 补充我的页内容区块 2026-10-22 21:44:36 +08:00
Zhou Weidong 9953c955e3 feat: 补充我的页内容区块 2026-10-22 21:44:03 +08:00
Zhou Weidong 7971ac18fc merge: 增强我的页渐变与图标配色 2026-10-22 21:38:55 +08:00
Zhou Weidong a81bec4d47 style: 增强我的页渐变与图标配色 2026-10-22 21:38:49 +08:00
Zhou Weidong 647f6afd77 merge: 改造我的页渐变与图标网格 2026-10-22 21:35:20 +08:00
Zhou Weidong 9785a1baf3 feat: 改造我的页渐变与图标网格 2026-10-22 21:35:14 +08:00
Zhou Weidong e70ca03c03 merge: 调整继续观看按钮样式 2026-10-22 21:28:41 +08:00
Zhou Weidong 95fb2ff882 style: 调整继续观看按钮样式 2026-10-22 21:28:36 +08:00
Zhou Weidong b6e5f808d6 merge: 优化追剧页切换与编辑按钮 2026-10-22 21:26:01 +08:00
Zhou Weidong 3f3dc9263c fix: 优化追剧页切换与编辑按钮 2026-10-22 21:25:55 +08:00
Zhou Weidong f67b8bd514 merge: 调整追剧加号颜色 2026-10-22 21:21:58 +08:00
Zhou Weidong 4d304cb549 style: 调整追剧加号颜色 2026-10-22 21:21:52 +08:00
Zhou Weidong 201d58e8f4 merge: 调整追剧加号卡片顺序 2026-10-22 21:20:12 +08:00
Zhou Weidong 091ea358bd fix: 调整追剧加号卡片顺序 2026-10-22 21:20:06 +08:00
Zhou Weidong af828d2c46 merge: 播放历史单列列表 2026-10-22 21:18:08 +08:00
Zhou Weidong c14d89ffce feat: 调整播放历史为单列列表 2026-10-22 21:18:02 +08:00
Zhou Weidong b185200e8c merge: 追剧页双列表与三列卡片 2026-10-22 21:14:31 +08:00
Zhou Weidong 2fac46f248 feat: 改造追剧页双列表与三列卡片 2026-10-22 21:14:23 +08:00
Zhou Weidong cffb68809c merge: 更正筛选按钮所属页面 2026-10-22 21:06:00 +08:00
Zhou Weidong 13d70fcef2 fix(recommend): 更正筛选按钮所属页面 2026-10-22 21:05:51 +08:00
Zhou Weidong bf20e44b85 merge: 移除二级标签筛选按钮 2026-10-22 21:02:40 +08:00
Zhou Weidong 9cf1efc316 fix(home): 移除二级标签筛选按钮 2026-10-22 21:02:29 +08:00
Zhou Weidong 3655d94869 merge: 修正窄筛选行横向居中 2026-10-22 20:59:14 +08:00
Zhou Weidong 196ce69a12 fix(recommend): 修正窄筛选行横向居中 2026-10-22 20:59:02 +08:00
Zhou Weidong c7a0e277f2 merge: 统一全部短剧筛选左对齐 2026-10-22 20:56:53 +08:00
Zhou Weidong 57c9e6b477 fix(recommend): 统一全部短剧筛选左对齐 2026-10-22 20:56:45 +08:00
Zhou Weidong 64bc1997ba merge: 修正筛选左起始与横向滑动 2026-10-22 20:53:16 +08:00
Zhou Weidong 21bb716af4 fix(recommend): 修正筛选左起始与横向滑动 2026-10-22 20:53:07 +08:00
Zhou Weidong a40adbb99a merge: 按截图重做全部短剧筛选区 2026-10-22 20:50:03 +08:00
Zhou Weidong d79e200650 style(recommend): 按截图重做全部短剧筛选区 2026-10-22 20:49:54 +08:00
Zhou Weidong 3b9ff8a306 merge: 对齐全部短剧筛选行 2026-10-22 20:46:21 +08:00
Zhou Weidong af4d918938 fix(recommend): 对齐全部短剧筛选行 2026-10-22 20:46:13 +08:00
Zhou Weidong 3289012f64 merge: 固定全部短剧筛选区并统一间距 2026-10-22 20:43:22 +08:00
Zhou Weidong e147002e00 fix(recommend): 固定全部短剧筛选区并统一间距 2026-10-22 20:43:15 +08:00
Zhou Weidong 099d05064e merge: 重排全部短剧筛选与网格 2026-10-22 20:39:09 +08:00
Zhou Weidong 4eb411ef28 style(recommend): 重排全部短剧筛选与网格 2026-10-22 20:39:00 +08:00
Zhou Weidong 14885d9efa merge: 支持横向切换三个内容页 2026-10-22 20:35:06 +08:00
Zhou Weidong 17faa749b2 feat(recommend): 支持横向切换三个内容页 2026-10-22 20:34:58 +08:00
Zhou Weidong 5fce65ac57 merge: 修正标题与观看全集跳转 2026-10-22 20:31:48 +08:00
Zhou Weidong 357492acb2 fix(recommend): 修正标题与观看全集跳转 2026-10-22 20:31:41 +08:00
Zhou Weidong 23799353b5 merge: 修复进度条拖动树稳定性 2026-10-22 20:27:07 +08:00
Zhou Weidong cf6d12b7c8 fix(player): 修复进度条拖动树稳定性 2026-10-22 20:26:58 +08:00
Zhou Weidong 5af6caea6e merge: 修正进度条按下与拖动状态 2026-10-22 20:23:32 +08:00
Zhou Weidong d66ff13d0f fix(player): 修正进度条按下与拖动状态 2026-10-22 20:23:24 +08:00
Zhou Weidong 7599da1d40 merge: 收窄拖动清屏范围并提升灵敏度 2026-10-22 20:19:29 +08:00
Zhou Weidong 04f1f5a73f fix(recommend): 收窄拖动清屏范围并提升灵敏度 2026-10-22 20:19:21 +08:00
Zhou Weidong f5721592f7 merge: 收窄观看全集按钮 2026-10-22 20:16:22 +08:00
Zhou Weidong 5abee5f69a style(recommend): 收窄观看全集按钮 2026-10-22 20:16:13 +08:00
Zhou Weidong 3690fb1bc4 merge: 修正进度拖动与底栏联动 2026-10-22 20:15:14 +08:00
Zhou Weidong 2765343340 fix(recommend): 修正进度拖动与底栏联动 2026-10-22 20:15:07 +08:00
Zhou Weidong afe7a49ef0 merge: 恢复进度拖动前浮层状态 2026-10-22 20:08:53 +08:00
Zhou Weidong b6666290ba fix(recommend): 恢复进度拖动前浮层状态 2026-10-22 20:08:45 +08:00
Zhou Weidong c478eebb0e merge: 修正进度取消状态更新编译错误 2026-10-22 20:04:51 +08:00
Zhou Weidong d731b36c1f fix(recommend): 修正进度取消状态更新编译错误 2026-10-22 20:04:43 +08:00
Zhou Weidong ac4a800b78 merge: 稳定进度拖动与清屏状态 2026-10-22 20:02:02 +08:00
Zhou Weidong 30b55afdd4 fix(recommend): 稳定进度拖动与清屏状态 2026-10-22 20:01:54 +08:00
Zhou Weidong 76c4f1d411 merge: 精简底部信息并优化进度拖动 2026-10-22 19:55:16 +08:00
Zhou Weidong d66ac8327e fix(recommend): 精简底部信息并优化进度拖动 2026-10-22 19:55:07 +08:00
Zhou Weidong ccda41b15b merge: 修正热播信息行与操作栏位置 2026-10-22 19:46:52 +08:00
Zhou Weidong 0c06a6dccd fix(recommend): 修正热播信息行与操作栏位置 2026-10-22 19:46:44 +08:00
Zhou Weidong 8737937875 merge: 对齐沉浸式推荐页视觉布局 2026-10-22 19:42:33 +08:00
Zhou Weidong 5dd3492aea feat(recommend): 对齐沉浸式推荐页视觉布局 2026-10-22 19:42:22 +08:00
Zhou Weidong 77689a3eaa merge: 再次加宽首页胶片带素材 2026-10-22 19:34:07 +08:00
Zhou Weidong b22ac6ab04 chore(home): 再次加宽首页胶片带素材 2026-10-22 19:34:00 +08:00
Zhou Weidong 2fdff34ed0 merge: 加宽首页胶片带素材 2026-10-22 19:32:25 +08:00
Zhou Weidong f9e9334934 chore(home): 加宽首页胶片带素材 2026-10-22 19:32:20 +08:00
Zhou Weidong 856a825a74 merge: 更新首页胶片带导航素材 2026-10-22 19:31:01 +08:00
Zhou Weidong df960f84ea chore(home): 更新首页胶片带导航素材 2026-10-22 19:30:52 +08:00
Zhou Weidong bfe1a2f9e8 merge: 放大底部导航图标与文字 2026-10-22 19:30:11 +08:00
Zhou Weidong fd2b0dbf23 style(home): 放大底部导航图标与文字 2026-10-22 19:30:03 +08:00
Zhou Weidong 5860302ce7 merge: 首页图标区分实心选中态 2026-10-22 19:29:18 +08:00
Zhou Weidong 4592b5dfba feat(home): 首页图标区分实心选中态 2026-10-22 19:29:12 +08:00
Zhou Weidong 6a10992812 merge: 更新首页导航摄影机素材 2026-10-22 19:26:36 +08:00
Zhou Weidong 8ae2ed4d93 chore(home): 更新首页导航摄影机素材 2026-10-22 19:26:31 +08:00
Zhou Weidong b1963a718e merge: 使用胶片盘图片导航图标 2026-10-22 19:24:40 +08:00
Zhou Weidong f47e4dd298 feat(home): 使用胶片盘图片导航图标 2026-10-22 19:24:34 +08:00
Zhou Weidong c24518c1a4 merge: 更换底部首页导航图标 2026-10-22 19:22:09 +08:00
Zhou Weidong 97e2db1b7b feat(home): 更换底部首页导航图标 2026-10-22 19:22:01 +08:00
Zhou Weidong bd4bdf8aea merge: 修正二级筛选按钮右对齐 2026-10-22 19:19:56 +08:00
Zhou Weidong 38643e7fde fix(home): 修正二级筛选按钮右对齐 2026-10-22 19:19:50 +08:00
Zhou Weidong 2cfa655750 merge: 修正 ChangeNotifier 监听生命周期 2026-10-22 19:14:41 +08:00
Zhou Weidong 8936c3d6eb fix(client): 修正 ChangeNotifier 监听生命周期 2026-10-22 19:14:35 +08:00
Zhou Weidong 4291031ace merge: 优化短剧列表下拉刷新体验 2026-10-22 19:11:36 +08:00
Zhou Weidong 7945f3ffed fix(home): 优化短剧列表下拉刷新体验 2026-10-22 19:11:30 +08:00
Zhou Weidong f69a27bb80 merge: 修复分类分页控制器初始化 2026-10-22 19:07:41 +08:00
Zhou Weidong d6f1cf2a2c fix(home): 修复分类分页控制器初始化 2026-10-22 19:07:32 +08:00
Zhou Weidong 6c1f3b9eae merge: 支持滑动切换首页分类 2026-10-22 19:06:05 +08:00
Zhou Weidong 5282194ca5 feat(home): 支持滑动切换首页分类 2026-10-22 19:05:55 +08:00
Zhou Weidong b921f79a71 merge: 更新搜索栏图标比例与间距 2026-10-22 19:03:52 +08:00
Zhou Weidong 4fa9d36b45 assets(home): 更新搜索栏图标比例与间距 2026-10-22 19:03:42 +08:00
Zhou Weidong 024f5f3736 merge: 统一搜索栏图标视觉比例 2026-10-22 19:00:08 +08:00
Zhou Weidong 403cce0e3b assets(home): 统一搜索栏图标视觉比例 2026-10-22 18:59:58 +08:00
Zhou Weidong ae8546fcf9 merge: 收紧二级标签间距 2026-10-22 18:59:19 +08:00
Zhou Weidong 5a4e910554 fix(home): 收紧二级标签间距 2026-10-22 18:59:11 +08:00
Zhou Weidong 147662d085 merge: 添加搜索栏皇冠与礼物图标 2026-10-22 18:58:11 +08:00
Zhou Weidong 714e5caec3 assets(home): 添加搜索栏皇冠与礼物图标 2026-10-22 18:58:03 +08:00
Zhou Weidong c1d4b61936 merge: 使用图片渲染搜索栏入口 2026-10-22 18:52:51 +08:00
Zhou Weidong 953ddec587 fix(home): 使用图片渲染搜索栏入口 2026-10-22 18:52:43 +08:00
Zhou Weidong afd8927a9f merge: 放大搜索栏右侧图标 2026-10-22 18:48:29 +08:00
Zhou Weidong 8feede1763 fix(home): 放大搜索栏右侧图标 2026-10-22 18:48:20 +08:00
Zhou Weidong f4e5af19fe merge: 调整搜索栏右侧入口样式 2026-10-22 18:46:27 +08:00
Zhou Weidong 909762ac3b fix(home): 调整搜索栏右侧入口样式 2026-10-22 18:46:19 +08:00
Zhou Weidong acae05d354 merge: 修复样式常量与测试类型错误 2026-10-22 18:43:11 +08:00
Zhou Weidong ba0ce2f8c0 fix(home): 修复样式常量与测试类型错误 2026-10-22 18:43:02 +08:00
Zhou Weidong 62cb4d9809 merge: 稳定二级标签切换布局 2026-10-22 18:41:05 +08:00
Zhou Weidong b3ea85df41 fix(home): 稳定二级标签切换布局 2026-10-22 18:40:56 +08:00
Zhou Weidong 76296f2be0 merge: 对齐二级筛选图标中心线 2026-10-22 18:38:48 +08:00
Zhou Weidong 4304727ffd fix(home): 对齐二级筛选图标中心线 2026-10-22 18:38:41 +08:00
Zhou Weidong 8ac781bb5e merge: 重绘二级筛选三线图标 2026-10-22 18:37:22 +08:00
Zhou Weidong 448010115f fix(home): 重绘二级筛选三线图标 2026-10-22 18:37:16 +08:00
Zhou Weidong 8197abd55d merge: 调整二级筛选按钮尺寸 2026-10-22 18:36:35 +08:00
Zhou Weidong c6f3e3fa68 fix(home): 调整二级筛选按钮尺寸 2026-10-22 18:36:30 +08:00
Zhou Weidong 368fbe7ef1 merge: 调整短剧封面比例 2026-10-22 18:34:17 +08:00
Zhou Weidong 91f4de01a1 fix(home): 调整短剧封面比例 2026-10-22 18:34:11 +08:00
Zhou Weidong 3886c577eb merge: 调整封面播放量图标与位置 2026-10-22 18:33:38 +08:00
Zhou Weidong 0e7dcf4739 fix(home): 调整封面播放量图标与位置 2026-10-22 18:33:31 +08:00
Zhou Weidong f20e7ba7c5 merge: 调整封面播放量与状态角标 2026-10-22 18:31:09 +08:00
Zhou Weidong 8375d8b255 fix(home): 收紧封面状态角标 2026-10-22 18:31:03 +08:00
Zhou Weidong 972e542e5c fix(home): 调整封面播放量位置 2026-10-22 18:30:33 +08:00
Zhou Weidong e11f55777e merge: 调整一级分类未选字号 2026-10-22 18:29:28 +08:00
Zhou Weidong 325f7c1f5d fix(home): 调整一级分类未选字号 2026-10-22 18:29:22 +08:00
Zhou Weidong da69a058b4 merge: 优化二级标签选中样式 2026-10-22 18:28:51 +08:00
Zhou Weidong 1adcc16727 fix(home): 优化二级标签选中样式 2026-10-22 18:28:44 +08:00
Zhou Weidong 5da836dded merge: 调整播放量行内展示 2026-10-22 18:28:00 +08:00
Zhou Weidong f7782aef14 fix(home): 调整播放量行内展示 2026-10-22 18:27:55 +08:00
Zhou Weidong c9fce7745e merge: 修正封面角标与题材标签 2026-10-22 18:26:59 +08:00
Zhou Weidong e16faa258a fix(home): 修正封面角标与题材标签 2026-10-22 18:26:52 +08:00
Zhou Weidong 3abf69e886 merge: 收紧首页顶部区间距 2026-10-22 18:23:44 +08:00
Zhou Weidong ce310afa89 fix(home): 收紧首页顶部区间距 2026-10-22 18:23:37 +08:00
Zhou Weidong d3fdb3c631 merge: 收紧短剧卡片间距 2026-10-22 18:22:52 +08:00
Zhou Weidong 9543d850c8 fix(home): 收紧短剧卡片间距 2026-10-22 18:22:46 +08:00
Zhou Weidong 81dd33e8c7 merge: 调整首页分类与卡片标签样式 2026-10-22 18:22:11 +08:00
Zhou Weidong 4f6116896f fix(home): 调整首页分类与卡片标签样式 2026-10-22 18:22:05 +08:00
Zhou Weidong 7446431511 merge: 修正首页分类与卡片布局 2026-10-22 18:14:40 +08:00
Zhou Weidong aa4870cce6 fix(home): 修正首页分类与卡片布局 2026-10-22 18:14:33 +08:00
Zhou Weidong 10477562d4 merge: 对齐短剧列表字号与间距 2026-10-22 18:06:09 +08:00
Zhou Weidong d7a59e5a27 style(client): 对齐短剧列表字号与间距 2026-10-22 18:06:03 +08:00
Zhou Weidong d03dcf162e merge: 移除全局两侧悬浮元素 2026-10-22 17:58:51 +08:00
Zhou Weidong 9cf832b318 refactor(navigation): 移除全局两侧悬浮元素 2026-10-22 17:58:43 +08:00
Zhou Weidong 5cead7ce00 merge: 重排我的页并新增迷你播放器 2026-10-22 17:45:05 +08:00
Zhou Weidong 79bdef4b43 docs(mine): 回填我的页改版记录 2026-10-22 17:44:59 +08:00
Zhou Weidong cbc6d80cd4 feat(mine): 重排我的页并新增迷你播放器 2026-10-22 17:44:48 +08:00
Zhou Weidong 5aa8170951 merge: 修正推荐子页内容映射 2026-10-22 17:37:03 +08:00
Zhou Weidong d06967c6ab fix(recommend): 修正推荐子页内容映射 2026-10-22 17:36:58 +08:00
Zhou Weidong af6b9bb3db merge: 追剧页新增三栏与双列网格 2026-10-22 17:32:17 +08:00
Zhou Weidong 97e3f4fc47 feat(following): 新增追剧三栏与双列网格 2026-10-22 17:32:09 +08:00
Zhou Weidong 73380ee090 merge: 推荐页新增分区流与全部短剧 2026-10-22 17:23:41 +08:00
Zhou Weidong f9aec827cf docs(recommend): 回填推荐页改版记录 2026-10-22 17:23:36 +08:00
Zhou Weidong f1b5418954 feat(recommend): 新增分区流全部短剧与剧单 2026-10-22 17:23:22 +08:00
Zhou Weidong 0ef2438100 merge: 统一我的页深色视觉风格 2026-10-22 17:07:32 +08:00
Zhou Weidong e40f4779c0 docs(mine): 回填我的页视觉统一记录 2026-10-22 17:07:27 +08:00
Zhou Weidong 83129acae4 feat(mine): 统一我的页深色视觉风格 2026-10-22 17:07:09 +08:00
Zhou Weidong 47bf6458e8 merge: 首页切换三列探索网格 2026-10-22 17:04:08 +08:00
Zhou Weidong 1bb227e083 docs(home): 回填首页网格改版记录 2026-10-22 17:04:03 +08:00
Zhou Weidong dd96792e33 feat(home): 首页改为三列探索网格 2026-10-22 17:03:45 +08:00
Zhou Weidong 6dea9d479e merge: 对齐四 Tab 底栏布局规格 2026-10-22 16:38:29 +08:00
Zhou Weidong 5362f97744 docs(nav): 回填底栏布局规格记录 2026-10-22 16:38:25 +08:00
Zhou Weidong 81787dc3aa style(nav): 对齐四 Tab 底栏布局规格 2026-10-22 16:38:14 +08:00
Zhou Weidong 667fdc5f0a merge: 合并四 Tab 底部导航 2026-10-22 16:21:39 +08:00
Zhou Weidong 729c226c95 docs(nav): 回填四 Tab 底部导航记录 2026-10-22 16:21:30 +08:00
Zhou Weidong 91e869d589 feat(nav): 底部导航改为首页推荐追剧我的 2026-10-22 16:21:05 +08:00
Zhou Weidong ec3cb8f163 merge: 客户端切换深色视觉风格 2026-10-22 13:49:38 +08:00
Zhou Weidong 4bc04fd8ae style(theme): 客户端切换深色视觉风格 2026-10-22 13:49:20 +08:00
Zhou Weidong 295c21513c merge: 观看历史改用分页契约 2026-10-22 13:21:36 +08:00
Zhou Weidong 5b2d8445dc refactor(watch): 观看历史改用分页契约 2026-10-22 13:21:27 +08:00
Zhou Weidong 1924b8626f chore(merge): 修复我的收藏与观看历史列表不显示 2026-10-22 13:10:03 +08:00
Zhou Weidong a48433f01d fix(profile): 修复我的收藏与观看历史列表不显示 2026-10-22 13:09:55 +08:00
Zhou Weidong f2ae0c70b6 merge: 收藏卡片展示简介 2026-10-22 12:45:31 +08:00
Zhou Weidong 57f3029018 feat(library): 收藏卡片展示简介 2026-10-22 12:45:27 +08:00
Zhou Weidong 9093700a04 merge: 优化观看历史标题加载 2026-10-22 12:43:06 +08:00
Zhou Weidong 78114fa46d fix(library): 优化观看历史标题加载 2026-10-22 12:42:58 +08:00
Zhou Weidong abfca7a3be merge: 收藏与观看历史支持分页 2026-10-22 12:34:39 +08:00
Zhou Weidong 235b50598a feat(library): 收藏与观看历史支持分页 2026-10-22 12:34:27 +08:00
Zhou Weidong 63d3b0f7ca merge: 增加 Android Studio 调试 HTTP 日志 2026-10-22 12:16:02 +08:00
Zhou Weidong 7a588898fa feat(debug): 增加 HTTP 请求响应日志 2026-10-22 12:15:51 +08:00
Zhou Weidong dc4b60270d merge: 合并进度条雪碧图预览 2026-10-22 11:40:30 +08:00
Zhou Weidong 12b733d111 feat(player): 进度条拖动预览改用雪碧图 2026-10-22 11:40:23 +08:00
Zhou Weidong 89a94f85c2 merge: 合并进度条画面预览 2026-10-22 11:03:25 +08:00
Zhou Weidong 51c56d884b feat(player): 增加进度条拖动画面预览 2026-10-22 11:03:17 +08:00
Zhou Weidong d06dce9753 merge: 合并播放入口无缓冲提示 2026-10-22 10:47:28 +08:00
Zhou Weidong 7ad4681049 fix(player): 收敛播放入口缓冲提示 2026-10-22 10:47:16 +08:00
Zhou Weidong f302b396b7 merge: 合并 Seek 播放位置修复 2026-10-22 10:41:12 +08:00
Zhou Weidong 5268adc999 fix(player): 记住拖动后的实际播放位置 2026-10-22 10:41:01 +08:00
Zhou Weidong 47ca21406a merge: 合并播放位置连续性修复 2026-10-22 10:28:07 +08:00
Zhou Weidong 759a02375a fix(player): 修复详情往返播放位置丢失 2026-10-22 10:27:58 +08:00
Zhou Weidong fe49c6d8b2 merge: 合并屏幕常亮与自动续播 2026-10-22 10:17:53 +08:00
Zhou Weidong a25c500371 feat(player): 保持屏幕常亮并自动恢复播放 2026-10-22 10:17:43 +08:00
Zhou Weidong 5bf10221a8 merge: 合并播放器加载与锁定进度条优化 2026-10-22 10:09:44 +08:00
Zhou Weidong 623c184243 fix(player): 优化加载指示器与锁定进度条 2026-10-22 10:09:33 +08:00
Zhou Weidong 7b068e8eb4 merge: 合并登录异常居中吐司 2026-10-22 09:58:08 +08:00
Zhou Weidong d076c57283 fix(auth): 登录异常改为居中吐司 2026-10-22 09:57:57 +08:00
Zhou Weidong 11e37a92b5 merge: 合并登录异常居中弹窗 2026-10-22 09:50:15 +08:00
Zhou Weidong b0002abf82 feat(auth): 登录异常改为居中弹窗 2026-10-22 09:50:00 +08:00
Vicky a1c0af3f00 merge: 将 release/v1.0.0 同步到 main 2026-10-21 20:07:35 +08:00
Vicky b5bfc1d7b2 merge: 将 develop 同步到 release/v1.0.0 2026-10-21 20:07:30 +08:00
Zhou Weidong 9b78e43702 merge: 合并 K98.3 视频控制器释放修复 2026-10-21 20:00:34 +08:00
Zhou Weidong f3ec12e3c3 fix(player): 修复切换频道时复用已释放的视频控制器 2026-10-21 20:00:15 +08:00
Zhou Weidong 45a53180d9 merge: 合并 K98.2 feed 更新构建期修复 2026-10-21 19:45:54 +08:00
Zhou Weidong d227ac69fb fix(home): 修复 feed 更新触发的 build 期 setState 2026-10-21 19:45:38 +08:00
Zhou Weidong 862b7e92dd merge: 合并 K98.1 列表直达播放页 2026-10-21 19:33:36 +08:00
Zhou Weidong 8b53adc2be feat(library): 收藏与观看记录直接进入播放页 2026-10-21 19:33:22 +08:00
Zhou Weidong ecdff54f2e merge: 合并 K98 登录键盘避让 2026-10-21 19:27:21 +08:00
Zhou Weidong 6c2f77926b fix(auth): 登录注册与手机号登录键盘避让 2026-10-21 19:26:46 +08:00
Vicky 1d2ba93e48 merge: 同步 release 剔除 x86_64 到 main 2026-10-21 19:13:33 +08:00
Vicky c08df9af40 merge: 同步 release 剔除 x86_64 到 release/v1.0.0 2026-10-21 19:13:28 +08:00
Zhou Weidong 86588d7faa build(android): release 包显式剔除 x86_64 原生库 2026-10-21 19:13:27 +08:00
Vicky be166f5856 merge: 同步生产包 ABI 约束到 main 2026-10-21 19:10:11 +08:00
Vicky e531c78997 merge: 同步生产包 ABI 约束到 release/v1.0.0 2026-10-21 19:10:10 +08:00
Zhou Weidong 91a622733c build(android): 生产包 abiFilters 仅保留 arm64-v8a 与 armeabi-v7a 2026-10-21 19:10:05 +08:00
Vicky 8ed6cd9fd6 merge: 同步生产打包单包说明到 main 2026-10-21 19:07:03 +08:00
Vicky c1d55b91a2 merge: 同步生产打包单包说明到 release/v1.0.0 2026-10-21 19:06:57 +08:00
Zhou Weidong 08980ff09b docs(readme): 生产包合并 arm64-v8a 与 armeabi-v7a 单包输出 2026-10-21 19:06:56 +08:00
Vicky 3dcfa02372 merge: 同步 README 生产打包说明到 main 2026-10-21 19:03:06 +08:00
Vicky b6826f7483 merge: 同步 README 生产打包说明到 release/v1.0.0 2026-10-21 19:03:01 +08:00
Zhou Weidong 30a6bcccfc docs(readme): 记录 Android 生产打包只保留 arm64-v8a 与 armeabi-v7a 2026-10-21 19:02:57 +08:00
Vicky cd3d84cf9a merge: 将 release/v1.0.0 同步到 main 2026-10-21 18:58:26 +08:00
Vicky 010ce326ea merge: 将 develop 同步到 release/v1.0.0 2026-10-21 18:58:12 +08:00
Zhou Weidong a42d3a26ac merge: 合并 K97.1 剧场搜索框圆角调整 2026-10-21 18:55:00 +08:00
Zhou Weidong c278503d0e fix(theater): 减小剧场搜索框圆角 2026-10-21 18:54:49 +08:00
Zhou Weidong 76f347cc35 merge: 合并 K97 iOS 评论键盘避让 2026-10-21 18:47:04 +08:00
Zhou Weidong 349ea12404 fix(comment): 修复 iOS 评论输入弹窗键盘避让 2026-10-21 18:46:43 +08:00
Zhou Weidong dfc33027d8 merge: 合并 K96 剧场分类分页 2026-10-21 18:24:28 +08:00
Zhou Weidong 13a14f3e85 feat(theater): 剧场分类列表服务端分页 2026-10-21 18:24:14 +08:00
Zhou Weidong f8769f2e1d Revert "merge: 合并 K95.2 首切频道封面过渡"
This reverts commit a2a491d056, reversing
changes made to 838ca2ce2a.
2026-10-21 18:07:25 +08:00
Zhou Weidong a2a491d056 merge: 合并 K95.2 首切频道封面过渡 2026-10-21 18:06:17 +08:00
Zhou Weidong c9adf8b399 fix(home): 频道切换用封面过渡 2026-10-21 18:06:09 +08:00
Zhou Weidong 2577797772 merge: 将 C3 埋点同步到 main 2026-10-21 09:09:34 +08:00
Zhou Weidong 05e2952815 merge: 将 C3 埋点同步到 release/v1.0.0 2026-10-21 09:07:42 +08:00
Zhou Weidong 6ae9e8e043 merge: 将 release/v1.0.0 同步到 main 2026-10-20 22:26:48 +08:00
Zhou Weidong 182b7e3ac2 merge: 将 develop 同步到 release/v1.0.0 2026-10-20 22:23:32 +08:00
Zhou Weidong 8bb365db2a merge: 将 release/v1.0.0 合入 main 2026-10-20 20:38:58 +08:00
Zhou Weidong 0cb57d084d merge: 将 develop 合入 release/v1.0.0
# Conflicts:
#	lib/core/config/app_config.dart
#	lib/main.dart
#	test/config/server_endpoint_test.dart
2026-10-20 20:36:43 +08:00
jianghaifeng 5c174b007c Merge pull request 'Release/v1.0.0' (#1) from release/v1.0.0 into main
Reviewed-on: #1
2026-10-19 13:42:16 +00:00
Zhou Weidong 35364c949a chore(release): 合并 develop 到 release/v1.0.0 2026-10-19 21:39:21 +08:00
Zhou Weidong 814b2c0b7b chore(config): 默认服务地址改为公网 39.162.50.99:8081 2026-10-19 21:12:16 +08:00
Zhou Weidong 3d0e0804ca fix(app): 修复视频播放明文HTTP与双网络访问切换 2026-10-19 18:37:38 +08:00
387 changed files with 36207 additions and 5390 deletions

No files matched your search

+21
View File
@@ -135,6 +135,27 @@ flutter run -d <device> \
--dart-define=API_BASE_URL=http://127.0.0.1:8081 --dart-define=API_BASE_URL=http://127.0.0.1:8081
``` ```
## 生产打包(Android)
生产包只包含以下两个 ABI,**打成一个 APK**,不做 split:
| ABI | 适用设备 |
| --- | --- |
| `arm64-v8a` | 现代手机(64 位) |
| `armeabi-v7a` | 老 32 位机 |
```bash
flutter build apk --release --target-platform android-arm64,android-arm
# 产出单个:build/app/outputs/flutter-apk/app-release.apk(约 37MB)
```
说明:
- `android/app/build.gradle.kts` 的 `release` 已配置 `abiFilters`,只保留 `arm64-v8a` 与 `armeabi-v7a`,插件也不会再带入 `x86_64` 原生库。
- `x86_64` 只用于模拟器,不进入生产包。
- 不要直接运行 `flutter build apk --release`:默认会编译三套原生库,包体约 57MB。
- 只有需要进一步压缩单机下载体积时,才考虑 `--split-per-abi` 出分架构包(arm64 约 21MB、armv7 约 19MB),默认不用。
## 门禁 ## 门禁
```bash ```bash
+11
View File
@@ -29,6 +29,10 @@ android {
buildTypes { buildTypes {
release { release {
// 生产包只保留 arm64-v8a 与 armeabi-v7a,避免插件带入 x86_64 原生库
ndk {
abiFilters += listOf("arm64-v8a", "armeabi-v7a")
}
// TODO: Add your own signing config for the release build. // TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works. // Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.getByName("debug") signingConfig = signingConfigs.getByName("debug")
@@ -42,6 +46,13 @@ kotlin {
} }
} }
// 生产包不允许出现 x86_64:部分插件 AAR 会带入少量 x86_64 原生库,这里显式剔除。
androidComponents {
onVariants(selector().withBuildType("release")) { variant ->
variant.packaging.jniLibs.excludes.add("lib/x86_64/**")
}
}
flutter { flutter {
source = "../.." source = "../.."
} }
+9 -8
View File
@@ -1,7 +1,7 @@
<!-- Author: fruit.com.cn --> <!-- Author: fruit.com.cn -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission
android:name="android.permission.INTERNET"/>
<application <application
android:label="FruitShorts" android:label="FruitShorts"
android:name="${applicationName}" android:name="${applicationName}"
@@ -23,9 +23,8 @@
while the Flutter UI initializes. After that, this theme continues while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. --> to determine the Window background behind the Flutter UI. -->
<meta-data <meta-data
android:name="io.flutter.embedding.android.NormalTheme" android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" android:resource="@style/NormalTheme"/>
/>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
@@ -35,7 +34,7 @@
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data <meta-data
android:name="flutterEmbedding" android:name="flutterEmbedding"
android:value="2" /> android:value="2"/>
</application> </application>
<!-- Required to query activities that can process text, see: <!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and https://developer.android.com/training/package-visibility and
@@ -44,8 +43,10 @@
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. --> In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries> <queries>
<intent> <intent>
<action android:name="android.intent.action.PROCESS_TEXT"/> <action
<data android:mimeType="text/plain"/> android:name="android.intent.action.PROCESS_TEXT"/>
<data
android:mimeType="text/plain"/>
</intent> </intent>
</queries> </queries>
</manifest> </manifest>
@@ -4,23 +4,49 @@ package com.stormg.lumadrama
import android.content.Intent import android.content.Intent
import android.app.PictureInPictureParams import android.app.PictureInPictureParams
import android.content.Context
import android.content.res.Configuration import android.content.res.Configuration
import android.graphics.Bitmap
import android.media.MediaMetadataRetriever
import android.net.Uri
import android.os.Build import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.provider.Settings
import android.telephony.TelephonyManager
import android.util.Rational import android.util.Rational
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.view.WindowManager
import androidx.core.view.ViewCompat import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat import androidx.core.view.WindowInsetsCompat
import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel
import java.io.ByteArrayOutputStream
import java.util.Locale
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import java.util.concurrent.atomic.AtomicBoolean
class MainActivity : FlutterActivity() { class MainActivity : FlutterActivity() {
private val shareRequestCode = 9041 private val shareRequestCode = 9041
private val thumbnailExecutor: ExecutorService = Executors.newSingleThreadExecutor()
private val thumbnailHandler = Handler(Looper.getMainLooper())
private var pendingShare: MethodChannel.Result? = null private var pendingShare: MethodChannel.Result? = null
private var pipChannel: MethodChannel? = null private var pipChannel: MethodChannel? = null
private var keyboardChannel: MethodChannel? = null private var keyboardChannel: MethodChannel? = null
private var thumbnailChannel: MethodChannel? = null
private var imeInset = 0 private var imeInset = 0
override fun onCreate(savedInstanceState: Bundle?) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
splashScreen.setOnExitAnimationListener { screen -> screen.remove() }
}
super.onCreate(savedInstanceState)
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}
override fun configureFlutterEngine(flutterEngine: FlutterEngine) { override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine) super.configureFlutterEngine(flutterEngine)
pipChannel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "com.stormg.lumadrama/pip") pipChannel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "com.stormg.lumadrama/pip")
@@ -43,6 +69,23 @@ class MainActivity : FlutterActivity() {
result.success(false) result.success(false)
} }
} }
// 设备标识:SSAID 免权限,卸载重装不变,避免客户端自己生成的 id 每次重装都变
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "com.stormg.lumadrama/device")
.setMethodCallHandler { call, result ->
when (call.method) {
"ssaid" -> {
val value = try {
Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID)
} catch (_: Exception) {
null
}
result.success(value)
}
// 设备区域:注册时作为服务端 IP 解析失败后的兜底
"region" -> result.success(currentRegion())
else -> result.notImplemented()
}
}
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "com.stormg.lumadrama/share") MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "com.stormg.lumadrama/share")
.setMethodCallHandler { call, result -> .setMethodCallHandler { call, result ->
if (call.method != "shareText") { if (call.method != "shareText") {
@@ -79,6 +122,47 @@ class MainActivity : FlutterActivity() {
emitImeInset(inset) emitImeInset(inset)
result.success(inset) result.success(inset)
} }
thumbnailChannel = MethodChannel(
flutterEngine.dartExecutor.binaryMessenger,
"com.stormg.lumadrama/thumbnail"
)
thumbnailChannel?.setMethodCallHandler { call, result ->
if (call.method != "frame") {
result.notImplemented()
return@setMethodCallHandler
}
val timeMs = (call.argument<Number>("timeMs"))?.toLong()
if (timeMs == null) {
result.success(null)
return@setMethodCallHandler
}
val localPath = call.argument<String>("localPath").orEmpty()
val remoteUrl = call.argument<String>("url").orEmpty()
val rawHeaders = call.argument<Map<*, *>>("headers")
val headers = rawHeaders?.entries
?.associate { it.key.toString() to it.value.toString() }
.orEmpty()
val responded = AtomicBoolean(false)
val task = thumbnailExecutor.submit {
val bytes = renderThumbnail(
timeMs = timeMs,
localPath = localPath,
remoteUrl = remoteUrl,
headers = headers
)
thumbnailHandler.post {
if (responded.compareAndSet(false, true)) {
result.success(bytes)
}
}
}
thumbnailHandler.postDelayed({
if (responded.compareAndSet(false, true)) {
task.cancel(true)
result.success(null)
}
}, thumbnailTimeoutMs)
}
val decorView = window.decorView val decorView = window.decorView
ViewCompat.setOnApplyWindowInsetsListener(decorView) { view, insets -> ViewCompat.setOnApplyWindowInsetsListener(decorView) { view, insets ->
emitImeInset(insets.getInsets(WindowInsetsCompat.Type.ime()).bottom) emitImeInset(insets.getInsets(WindowInsetsCompat.Type.ime()).bottom)
@@ -93,12 +177,87 @@ class MainActivity : FlutterActivity() {
?.bottom ?.bottom
?: 0 ?: 0
/** 网络运营商国家优先,其次 SIM 卡,最后系统语言;都拿不到返回空串。 */
private fun currentRegion(): String {
return try {
val telephony = getSystemService(Context.TELEPHONY_SERVICE) as? TelephonyManager
val localeCountry = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
resources.configuration.locales.get(0).country
} else {
@Suppress("DEPRECATION")
resources.configuration.locale.country
}
val candidates = listOfNotNull(
telephony?.networkCountryIso,
telephony?.simCountryIso,
localeCountry
)
candidates.firstOrNull { it.isNotBlank() }?.uppercase(Locale.ROOT) ?: ""
} catch (_: Exception) {
// 个别 ROM 读运营商信息会抛 SecurityException,别让注册流程卡住
""
}
}
private fun emitImeInset(value: Int) { private fun emitImeInset(value: Int) {
if (value == imeInset) return if (value == imeInset) return
imeInset = value imeInset = value
keyboardChannel?.invokeMethod("insetsChanged", value) keyboardChannel?.invokeMethod("insetsChanged", value)
} }
private fun renderThumbnail(
timeMs: Long,
localPath: String,
remoteUrl: String,
headers: Map<String, String>
): ByteArray? {
val retriever = MediaMetadataRetriever()
var frame: Bitmap? = null
var scaled: Bitmap? = null
return try {
when {
localPath.isNotEmpty() -> retriever.setDataSource(normalizeLocalPath(localPath))
remoteUrl.isNotEmpty() -> retriever.setDataSource(remoteUrl, headers)
else -> return null
}
frame = retriever.getFrameAtTime(
timeMs * 1000,
MediaMetadataRetriever.OPTION_CLOSEST_SYNC
)
val source = frame ?: return null
scaled = if (source.width > thumbnailMaxWidth) {
val targetHeight = (source.height * thumbnailMaxWidth / source.width)
.coerceAtLeast(1)
Bitmap.createScaledBitmap(
source,
thumbnailMaxWidth,
targetHeight,
true
)
} else {
source
}
val outputBitmap = scaled ?: source
val output = ByteArrayOutputStream()
val compressed = outputBitmap.compress(
Bitmap.CompressFormat.JPEG,
thumbnailJpegQuality,
output
)
if (!compressed) return null
output.toByteArray()
} catch (_: Exception) {
null
} finally {
if (scaled != null && scaled !== frame) scaled.recycle()
frame?.recycle()
retriever.release()
}
}
private fun normalizeLocalPath(path: String): String =
if (path.startsWith("file:")) Uri.parse(path).path ?: path else path
override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean, newConfig: Configuration) { override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean, newConfig: Configuration) {
super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig) super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig)
pipChannel?.invokeMethod("onPipChanged", isInPictureInPictureMode) pipChannel?.invokeMethod("onPipChanged", isInPictureInPictureMode)
@@ -117,6 +276,16 @@ class MainActivity : FlutterActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView, null) ViewCompat.setOnApplyWindowInsetsListener(window.decorView, null)
keyboardChannel?.setMethodCallHandler(null) keyboardChannel?.setMethodCallHandler(null)
keyboardChannel = null keyboardChannel = null
thumbnailChannel?.setMethodCallHandler(null)
thumbnailChannel = null
thumbnailHandler.removeCallbacksAndMessages(null)
thumbnailExecutor.shutdownNow()
super.onDestroy() super.onDestroy()
} }
companion object {
private const val thumbnailMaxWidth = 240
private const val thumbnailJpegQuality = 70
private const val thumbnailTimeoutMs = 1500L
}
} }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Author: fruit.com.cn -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/splash_background" /> <item android:drawable="@color/splash_background" />
<item>
<bitmap
android:gravity="center"
android:src="@drawable/splash_screen" />
</item>
</layer-list> </layer-list>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Author: fruit.com.cn -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/splash_background" /> <item android:drawable="@color/splash_background" />
<item>
<bitmap
android:gravity="center"
android:src="@drawable/splash_screen" />
</item>
</layer-list> </layer-list>
Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 B

After

Width:  |  Height:  |  Size: 69 B

@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Author: fruit.com.cn -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/splash_background" />
<item> <item>
<bitmap android:gravity="fill" android:src="@drawable/background"/> <bitmap
</item> android:gravity="center"
<item> android:src="@drawable/splash_screen" />
<bitmap android:gravity="center" android:src="@drawable/splash"/>
</item> </item>
</layer-list> </layer-list>
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Author: fruit.com.cn --> <!-- Author: fruit.com.cn -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/splash_background" /> <item android:drawable="@color/splash_background" />
<item>
<bitmap
android:gravity="center"
android:src="@drawable/splash_screen" />
</item>
</layer-list> </layer-list>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 B

After

Width:  |  Height:  |  Size: 69 B

@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Author: fruit.com.cn -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/splash_background" />
<item> <item>
<bitmap android:gravity="fill" android:src="@drawable/background"/> <bitmap
</item> android:gravity="center"
<item> android:src="@drawable/splash_screen" />
<bitmap android:gravity="center" android:src="@drawable/splash"/>
</item> </item>
</layer-list> </layer-list>
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/> <background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/> <foreground>
<inset
android:drawable="@drawable/ic_launcher_foreground"
android:inset="16%" />
</foreground>
</adaptive-icon> </adaptive-icon>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

@@ -1,11 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Author: fruit.com.cn --> <!-- Author: fruit.com.cn -->
<resources> <resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">@drawable/launch_background</item> <item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:windowSplashScreenBackground">@color/splash_background</item> <item name="android:forceDarkAllowed">false</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item> <item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowSplashScreenBackground">#000000</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/splash_brand</item>
<item name="android:windowSplashScreenAnimationDuration">0</item>
</style> </style>
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar"> <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">@color/splash_background</item> <item name="android:windowBackground">@color/splash_background</item>
@@ -1,11 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Author: fruit.com.cn --> <!-- Author: fruit.com.cn -->
<resources> <resources>
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar"> <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">@drawable/launch_background</item> <item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:windowSplashScreenBackground">@color/splash_background</item> <item name="android:forceDarkAllowed">false</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item> <item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowSplashScreenBackground">#000000</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/splash_brand</item>
<item name="android:windowSplashScreenAnimationDuration">0</item>
</style> </style>
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar"> <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">@color/splash_background</item> <item name="android:windowBackground">@color/splash_background</item>
+2 -1
View File
@@ -2,5 +2,6 @@
<!-- Author: fruit.com.cn --> <!-- Author: fruit.com.cn -->
<resources> <resources>
<color name="splash_background">#1F1B16</color> <color name="splash_background">#000000</color>
<color name="ic_launcher_background">#FF6B2C</color>
</resources> </resources>
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 42 KiB

@@ -0,0 +1,28 @@
# ReelShort 客户端深色视觉改造
## 目标
- 深色设为默认且唯一主题,页面、卡片、浮层、播放器和底部导航保持一致。
- 色板收敛到 `AppColors`,主题组件配置收敛到 `AppTheme`。
- 保持现有布局、信息结构、路由、业务逻辑和文案不变。
## 结果
- 背景 `#0B1020`、卡片 `#151B2E`、浮层 `#1C2436`、分割线白色 6%。
- 主文字白色 92%、次文字 64%、禁用 38%。
- 主色 `#FF6B2C`,辅助链接色 `#22D3EE`。
- 卡片 12、按钮/输入框 10、标签 6,阴影关闭,组件使用分割线分层。
- 页面级透明、遮罩、阴影、媒体底、玻璃面和渐变全部映射到 AppColors 语义 token。
- 系统栏统一浅色图标,AppBar 与底部导航使用深色表面。
## 验证
- 主题 token、对比度、系统栏、圆角与关键页 smoke 测试。
- `dart analyze lib test`
- `flutter test --no-pub`
- `flutter build apk --debug`
## 约束
- 不提交 `pubspec.lock` 漂移。
- 不启停服务、不操作真机。
@@ -0,0 +1,24 @@
# Android Studio 调试 HTTP 日志
## 目标
- 仅在调试构建中输出 Dio 请求、响应与异常日志。
- Android Studio Run 控制台通过 `debugPrint` 展示,logcat 标签保持 `flutter`。
- Authorization 脱敏,X-Device-Id 保留,二进制响应只显示字节数。
- 单条请求体或响应体最多 3000 字符。
## 实现步骤
1. 新增 `NetworkLogInterceptor`,支持注入日志回调并保留请求耗时。
2. 在 Envelope 解包前暂存原始 bytes;日志拦截器追加到拦截链末尾后读取暂存值。
3. 在 `ApiClient` 注册调试拦截器,`kDebugMode` 与常量开关同时满足时才输出。
4. 以 fake adapter 补单测,覆盖行格式、脱敏、UTF-8、截断、非 JSON 与二进制。
5. 运行 `dart analyze lib test` 和 `flutter test`,更新 PROGRESS 留痕。
## 风险与约束
- `ResponseType.bytes` 不能直接 `toString`,响应体统一 `utf8.decode`。
- Dio 响应拦截器按 FIFO 执行;链尾日志通过 Envelope 暂存的原始 bytes 读取,
避免拿到已解包后的 `data`。
- release/profile 通过 `kDebugMode` 短路,不输出任何 HTTP 日志。
- 不新增依赖,不提交现有 `pubspec.lock` 改动,不启停服务、不操作真机。
@@ -0,0 +1,20 @@
# 收藏卡片简介
## 目标
- 收藏卡片在标题/标签下方显示后端 `synopsis`,最多 2 行并省略溢出。
- 空白简介不创建文本节点、不占高度,不显示 `null/undefined`。
- 保持封面 80x106 和现有卡片高度,不引入布局溢出。
## 实现
1. `_FavoriteCard` 对 synopsis 做 trim 后条件渲染。
2. 简介使用 `Flexible` 占据标题、标签与底部统计之间的剩余空间,
`maxLines: 2`、`TextOverflow.ellipsis`、次要文案色和字号。
3. 无简介时继续使用原 Spacer,保持原布局。
4. widget 测试覆盖有简介、空简介和卡片高度稳定性。
## 约束
- 不改接口、后端、收藏分页。
- 不新增依赖,不提交现有 `pubspec.lock`,不启停服务、不操作真机。
@@ -0,0 +1,31 @@
# 屏幕常亮与前台自动续播
## 目标
- Android 与 iOS 前台保持屏幕常亮,不引入插件或依赖。
- 用户主动暂停后切后台再回前台,在播放器与票据状态安全时自动续播。
- 锁定、blocked、票据失败、错误态及浮层遮挡场景不得强制起播。
## 实施步骤
1. Android `MainActivity.onCreate` 添加 `FLAG_KEEP_SCREEN_ON`,保留现有渠道逻辑。
2. iOS `AppDelegate` 设置 `UIApplication.shared.isIdleTimerDisabled = true`。
3. 为 `PlaybackSession` 增加无浮层、路线可见且 active 播放器可用的恢复判断。
4. 调整 `PlayerLogic.onLifecycle`,在现有 PiP 复位和过期票据刷新流程后安全设置播放意图。
5. 补用户暂停恢复、锁定/票据失败不恢复、后台保存并暂停测试。
6. 执行 `dart analyze lib test` 与 `flutter test --no-pub`,回填 PROGRESS 后提交合并。
## 风险 / 待确认
- 真机常亮和生命周期行为由 PM 验收,本次不启停服务、不操作设备。
- PiP 继续沿用现有可见性策略,不额外修改后台播放行为。
## 执行结果
- Android 主 Activity 已添加 `FLAG_KEEP_SCREEN_ON`,未改动 Flutter 渠道与 PiP 逻辑。
- iOS AppDelegate 已设置 `UIApplication.shared.isIdleTimerDisabled = true`。
- 用户主动暂停后回前台可安全恢复;过期票据会等待重取完成后再恢复。
- locked、blocked、票据错误、会话错误、解锁/浮层遮挡和 PiP 场景均不会强制续播。
- 后台仍先保存进度并暂停。
- `dart analyze lib test` 零告警,`flutter test --no-pub` 580 项全过。
- 未启停服务,未操作真机。
@@ -0,0 +1,31 @@
# 收藏与观看历史分页 UI
## 目标
- `/app/favorites` 与 `/app/watch/recent` 按 `PageResult{total,list}` 分页接入。
- 收藏页、观看历史页支持首屏、触底加载、无更多、刷新、失败重试和总数展示。
- 观看记录直接使用后端 `dramaTitle/dramaCover/episodeNumber`,缺失时安全兜底。
## 实现步骤
1. 新增通用 `PageResult<T>`,更新 LibraryApi、WatchApi、Repository 与内存替身。
2. FavoriteController、WatchRecordsController 增加分页状态、请求代次、dramaId 去重。
3. 页面通过滚动通知触发 `loadMore`,复用下拉刷新并增加通用分页 footer。
4. 观看卡片优先渲染接口字段,标题为空时用本地化“第 N 集”,封面为空显示占位。
5. 补 API、Controller 和 widget 测试,运行 analyze 与全量 flutter test。
## 风险与约束
- 刷新期间保持旧列表,成功后原子替换并回到第 1 页;失败保留旧数据。
- loadMore 与 refresh 通过请求代次隔离,旧响应不得覆盖新列表。
- 空页立即停止加载;`loaded >= total` 后不再请求。
- 不新增依赖、不提交现有 `pubspec.lock`,不启停服务、不操作真机。
## 2026-10-22 范围修订
- 分页协议和 Controller 分页状态保持不改。
- 观看历史优先使用后端 `dramaTitle/dramaCover/episodeNumber`,只有标题为空时才预取详情。
- 标题为空且详情也未返回标题时,用本地化“第 N 集”兜底。
- 有标题的条目点击播放时再按需加载详情,不在列表加载阶段产生 N+1。
- 使用当前真实后端校验第 1/2 页请求参数、total 与 list;若运行实例仍忽略分页,
只在 PROGRESS 记录证据,不做前端全量兜底。
@@ -0,0 +1,28 @@
# 登录异常居中弹窗
## 目标
- 邮箱登录、邮箱注册及手机号 OTP 登录的提交异常改为屏幕居中弹窗。
- 本地表单校验继续使用现有内联字段错误,不触发弹窗。
## 实施步骤
1. 新增 `lib/core/widgets/centered_error_dialog.dart`,统一弹窗样式、遮罩关闭和确认按钮。
2. 补充登录失败、注册失败、确认按钮的中英文印尼语文案并重新生成 l10n。
3. 调整邮箱认证页:接口异常展示居中弹窗,提交 busy 在展示弹窗前复位。
4. 调整手机号弹窗:OTP 发送和验证码登录/注册异常展示居中弹窗,成功 SnackBar 保持不变。
5. 补接口异常、注册标题、本地校验不弹窗和手机号两条异常路径测试。
6. 执行 `dart analyze lib test` 与 `flutter test --no-pub`,回填 PROGRESS 后提交合并。
## 风险 / 待确认
- 同级 FruitServer 的 `INBOX.md` 当前顶部为已处理 K100,未找到本需求条目;以用户消息中的完整需求为准。
- 现有主工作区处于 `feature/payment-iap` 且有未提交 `pubspec.lock`,本次使用独立 worktree,不触碰该文件。
## 执行结果
- 已新增居中错误弹窗组件及三语言文案,邮箱登录/注册和手机号 OTP/验证码提交异常均改为弹窗。
- 本地字段校验仍走原内联错误;异常展示前提交 busy 已复位。
- 接口异常、注册标题、未知异常网络文案、遮罩关闭、确认关闭、本地校验不弹窗均有测试覆盖。
- `dart analyze lib test` 零告警,`flutter test --no-pub` 570 项全过。
- 未启停服务,未操作真机。
@@ -0,0 +1,29 @@
# 登录异常居中吐司
## 目标
- 将上一版认证异常 AlertDialog 替换为无交互的屏幕居中吐司。
- 吐司淡入展示约 2 秒后自动淡出,不遮罩、不拦截手势。
- 同一时刻只存在一个吐司,新消息替换旧消息。
## 实施步骤
1. 删除 `centered_error_dialog.dart`,新增 `centered_toast.dart`。
2. 认证页和手机号弹窗异常路径改用 `showCenteredToast`,保留 busy 复位和成功 SnackBar。
3. 清理不再使用的认证错误标题与确认按钮 l10n 键,重新生成 AppLocalizations。
4. 更新认证测试为吐司断言,并补单例替换、自动消失测试。
5. 执行 `dart analyze lib test` 与 `flutter test --no-pub`,回填 PROGRESS 后提交合并。
## 风险 / 待确认
- 吐司使用 root Overlay,认证路由退出时仍会按自身计时器自动清理。
- 测试必须 pump 超过展示和淡出时长,确保不遗留 Timer 或 OverlayEntry。
## 执行结果
- 已删除 AlertDialog 组件,新增 OverlayEntry 居中吐司。
- 邮箱和手机号异常改用吐司;busy 复位、成功 SnackBar 和本地内联校验保持不变。
- 已清理三个不再使用的 l10n 键并重新生成 AppLocalizations。
- 覆盖单例替换、点击穿透、自动消失、接口异常和本地校验不弹吐司。
- `dart analyze lib test` 零告警,`flutter test --no-pub` 573 项全过。
- 未启停服务,未操作真机。
@@ -0,0 +1,21 @@
# 播放入口无缓冲提示
## 目标
- 未初始化进度条显示静态 inactive 轨道,不出现流动加载高光。
- 仅真实 buffering 持续超过 350ms 时显示白色高光。
- 起播定位阶段不叠加 session 居中 loading;只有 ticket loading 居中显示。
- 同集返回复用 controller;重建时 initialize→seek→play。
## 实施步骤
1. 调整 SeekProgressBar 与 _FeedProgressBar 的初始化/缓冲状态判断。
2. 删除 PlayerView 的 session loading 居中圈,仅保留 ticket loading。
3. preparePlayer 统一通过 VideoPlayerPort.seekTo 定位缓存位置。
4. 更新进度条、全屏入口、详情返回和重建顺序测试。
5. 执行 `dart analyze lib test` 与 `flutter test --no-pub`,回填 PROGRESS 后提交合并。
## 风险 / 待确认
- 真实持续网络卡顿仍保留缓冲高光。
- 锁定集继续沿用静态空轨道和禁用 seek 行为。
@@ -0,0 +1,32 @@
# 播放位置连续性
## 目标
- 首页进入详情、详情返回首页、详情再进播放器时保持同一集同一秒。
- 新增进程内最近播放位置缓存,优先于服务端旧记录。
- 跨剧、跨集不串位;锁定/票据失败不因缓存强行起播;进程重启仍回服务端。
## 实施步骤
1. 新增 `PlaybackPositionCache`,按 episodeId 保存 dramaId/position/duration/updatedAt。
2. App Provider 注入单一缓存实例,PlayerPage 与详情页共享。
3. PlayerLogic 进度监听、saveCurrentProgress 写入缓存;loadResumePoint 优先命中缓存。
4. preparePlayer 对每个待准备集按 dramaId 校验缓存,并继续使用现有位置钳位。
5. 详情页续看状态优先使用该剧最新缓存,未命中再请求服务端。
6. 补缓存、缓存命中不请求服务端、跨剧隔离、服务端回落和详情返回位置测试。
7. 执行 `dart analyze lib test` 与 `flutter test --no-pub`,回填 PROGRESS 后提交合并。
## 风险 / 待确认
- 缓存仅保存在进程内,App 重启后自动回落到服务端观看记录。
- 片尾附近继续复用现有 `clampResumePosition` 完成保护。
## 执行结果
- 新增进程内按集缓存并通过 Provider 全局共享,详情页与播放器共用。
- 进度监听、`saveCurrentProgress` 和进入详情前会写入缓存。
- `loadResumePoint` 优先缓存,未命中或跨剧时才请求服务端。
- 详情页继续观看与 CTA 优先进缓存集;返回首页保持原播放器与位置。
- 已覆盖缓存读写/过期、跨剧隔离、缓存命中去网络、服务端回落和详情往返。
- `dart analyze lib test` 零告警,`flutter test --no-pub` 589 项全过。
- 未启停服务,未操作真机。
@@ -0,0 +1,21 @@
# Seek 后播放位置保持
## 目标
- 拖动进度条后,缓存与观看记录立即使用 seek 完成后的真实位置。
- 拖动后立即进详情/离开也不会回退到旧进度。
- 越界位置 clamp,锁定/票据失败不写无效缓存。
## 实施步骤
1. 增加播放位置 clamp 纯函数,缓存写入统一限制在 `0..duration`。
2. VideoPlayerPort 暴露 seek 方法,PlayerLogic 等待 seek 完成后再读取 controller。
3. PlayerLogic 统一当前播放快照,监听、缓存和上报共用同一份 position/duration。
4. 增加 pending seek 屏障,saveCurrentProgress 与离开路径等待 seek 和上报完成。
5. 补 seek 缓存、越界 clamp、seek 后进详情并返回测试。
6. 执行 `dart analyze lib test` 与 `flutter test --no-pub`,回填 PROGRESS 后提交合并。
## 风险 / 待确认
- 片尾与完成逻辑继续沿用现有 controller/播放器行为。
- 缓存仅在进程内,不改变服务端观看记录契约。
@@ -0,0 +1,30 @@
# 播放器 loading 与锁定进度条调整
## 目标
- 播放器票据与 session loading 圈统一为 24×24、线宽 2。
- 缓冲/加载进度高光改为白色。
- 未解锁剧集显示静态 inactive 轨道,不进入 loading,不允许拖动 seek。
## 实施步骤
1. 更新 `LoadingProgressTrack` 默认高光颜色,并补颜色断言。
2. 为 `SeekProgressBar`、`PlayerOverlayData`、`HomeFeedOverlay` 和 `_FeedProgressBar` 增加 locked 状态。
3. `PlayerPage` 使用 `logic.session.isLocked || episode.locked` 传入两个浮层。
4. 缩小 `player-ticket-loading` 与 `player-session-loading` 的尺寸和线宽。
5. 补首页/全屏锁定态、缓冲高光和两个 loading 指示器尺寸测试。
6. 执行 `dart analyze lib test` 与 `flutter test --no-pub`,回填 PROGRESS 后提交合并。
## 风险 / 待确认
- 锁定态只影响进度条 UI 与手势,不改播放、解锁或接口逻辑。
- 首页浮层锁定线沿用当前 `Colors.white24` inactive 色,避免改变非锁定轨道样式。
## 执行结果
- 两个播放器 loading 圈均为 24×24、线宽 2、主色不变。
- loading 高光默认改为白色,普通轨道与首页 white24 轨道颜色未变。
- 首页与全屏播放器均按剧集锁定态渲染静态空轨道并禁用 seek。
- 已覆盖锁定轨道高度、无 loading、无拖动 seek、loading 指示器尺寸和高光颜色。
- `dart analyze lib test` 零告警,`flutter test --no-pub` 576 项全过。
- 未启停服务,未操作真机。
@@ -0,0 +1,62 @@
# 播放器进度拖动画面预览
## 目标
首页 feed 与全屏播放器的进度条在拖动时显示当前时间点的视频画面缩略图、
当前时间与总时长;松手立即隐藏并提交 seek。缩略图未返回或失败时显示短剧
封面,不出现空白闪烁或错误文案。
## 性能红线
1. 拖动期间主线程无卡顿;图片解码和原生取帧不得阻塞 UI 线程。
2. 原生取帧并发数不超过 1。
3. 预览图最大宽度 240px。
4. Dart 内存 LRU 缓存不超过 24 帧。
5. 不新增 pub 依赖。
6. 不改后端契约。
## 实现
### 缩略图服务
- 新增 `PlaybackThumbnailService`,公开入口按 `episodeId + position` 取
`ByteData`,底层通过
`MethodChannel('com.stormg.lumadrama/thumbnail')` 调用原生。
- 时间按 1 秒分桶;同一 bucket 的在途请求合流。
- 最多 24 帧 LRU;成功和失败结果都做过期控制,避免旧拖动位置覆盖当前预览。
- 全局单飞;拖动期间只保留最新 bucket,尚未开始的旧请求直接丢弃。
- 拖动停顿 120ms 后最多预取相邻一个 bucket,松手取消尚未开始的请求。
- 原生异常、缺失实现和超过 1.5 秒无结果统一返回 `null`。
### 原生取帧
- Android 使用 `MediaMetadataRetriever`,优先本地下载路径,其次签名 URL;
`OPTION_CLOSEST_SYNC` 取帧,最大宽 240px,JPEG 质量 70,单线程 Executor,
完成后立即 release。
- iOS 使用 `AVAssetImageGenerator`,应用画面方向,最大尺寸约 240x426,
合理时间容差,后台串行队列生成 JPEG。
- 两端均保证只回调一次;失败或 1.5 秒超时返回 `null`,不向 UI 抛异常。
### UI
- 新增 `ScrubPreviewCard`:宽 120dp、圆角 8、白色 1px 描边,显示
`当前时间 / 总时长`;沿拖动点水平跟随并做安全边距 clamp。
- 首页 `_FeedProgressBar` 与全屏 `SeekProgressBar` 共用该卡片。
- 封面始终铺在卡片底层;`Image.memory` 仅在帧到达后覆盖,并限制
`cacheWidth: 240`。
- 开始拖动请求当前 bucket,拖动更新只保留最新位置;松手立即隐藏卡片并取消
未开始请求。
- `PlayerPage` 持有页面级服务,dispose 时清空缓存,避免跨页面串集。
## 测试
- 单测:bucket、LRU 淘汰、同 bucket 合流、过期请求丢弃、松手取消、
相邻 bucket 防抖、异常/超时回落。
- Widget:拖动显示预览卡片和时间、松手消失、无缩略图显示封面。
- 门禁:`dart analyze lib test` 与 `flutter test --no-pub`。
## 非目标
- 不改服务端接口或持久化策略。
- 不新增第三方依赖。
- 不启停服务、不操作真机;原生取帧实际效果由 PM 真机验收。
@@ -0,0 +1,46 @@
# 雪碧图 VTT 拖动预览
## 目标
将进度条拖动预览主链路改为服务端雪碧图 + WebVTT 局部裁剪,原生取帧只作为降级:
1. `Episode` 与 `PlayTicket` 解析 `thumbnailsUrl`。
2. VTT 只拉取/解析一次,内存缓存 10 分钟。
3. cue 使用起止时间 + 相对 sprite 文件名 + `xywh`,按 position 二分选择。
4. sprite 图最多缓存 2 张 `ui.Image`,拖动帧只绘制 sourceRect。
5. 无 VTT、空轴或图片失败时回退现有 `PlaybackThumbnailService`,再回退封面。
## 性能红线
- 拖动帧禁止网络请求与图片解码,只允许 cue 二分查找和 `RawImage.sourceRect` 绘制。
- VTT 每个 URL 只解析一次;sprite 解码不在 build/build paint 中执行。
- sprite ui.Image LRU 上限 2 张,页面 dispose 清空。
- 解码 sprite 最长边超过 2048px 时按比例缩小后常驻。
- 签名 `thumbnailsUrl` 不写入任何持久化缓存。
## 实施
- 新增 `SpriteThumbnailAxisService`:
- Dio 拉取 VTT,403 清缓存后重试一次;
- 解析和选 cue 为纯函数,解析失败返回空轴;
- 播放器就绪时预取当前 cue 及相邻 sprite;
- LRU2 sprite 缓存和 10 分钟 VTT 缓存。
- `PlayerPage` 持有页面级服务,按当前选中集预取,dispose 时清空。
- `ScrubPreviewCard` 优先读取已缓存 sprite frame,显示 `RawImage` 裁剪;
VTT 未就绪时暂显封面,轴为空/不可用后启动本地取帧,全部失败保留封面。
- 首页 feed 和全屏播放器都把 `thumbnailsUrl` 传到预览卡片。
- 不新增 pub 依赖、不改后端契约。
## 测试
- VTT 解析:时间、xywh、多 sprite 文件。
- cue 选择:命中、越界最近邻。
- sprite LRU 最多 2 张。
- 回退状态判定。
- Widget:sprite 裁剪且不触发本地取帧;无 URL 回退本地;全部失败显示封面。
- 门禁:`dart analyze lib test`、`flutter test --no-pub`。
## 风险
- 真实网络 VTT/sprite 可访问性和签名过期由 PM 真机验收。
- 本次不启动服务、不操作真机、不修改 Web/FruitServer。
File diff suppressed because it is too large. Load diff
+4
View File
@@ -11,6 +11,7 @@
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
8C4E1A022F9A4B1000C636F3 /* WirelessDataPrompt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C4E1A012F9A4B1000C636F3 /* WirelessDataPrompt.swift */; };
7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; }; 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; };
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
@@ -49,6 +50,7 @@
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
8C4E1A012F9A4B1000C636F3 /* WirelessDataPrompt.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WirelessDataPrompt.swift; sourceTree = "<group>"; };
7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; }; 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = "<group>"; }; 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
@@ -122,6 +124,7 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
8C4E1A012F9A4B1000C636F3 /* WirelessDataPrompt.swift */,
7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */, 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
); );
@@ -282,6 +285,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
8C4E1A022F9A4B1000C636F3 /* WirelessDataPrompt.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */, 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */,
); );
+142 -1
View File
@@ -1,5 +1,26 @@
import Flutter import Flutter
import UIKit import UIKit
import AVFoundation
private let thumbnailHTTPHeaderFieldsKey = "AVURLAssetHTTPHeaderFieldsKey"
private final class ThumbnailResponseGate {
private let lock = NSLock()
private var completed = false
func send(_ result: @escaping FlutterResult, data: Data?) {
lock.lock()
if completed {
lock.unlock()
return
}
completed = true
lock.unlock()
DispatchQueue.main.async {
result(data)
}
}
}
/// Keeps the system LaunchScreen as the only splash. Flutter would otherwise /// Keeps the system LaunchScreen as the only splash. Flutter would otherwise
/// instantiate that storyboard again and the icon appears a second time. /// instantiate that storyboard again and the icon appears a second time.
@@ -10,21 +31,39 @@ final class RunnerFlutterViewController: FlutterViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = UIColor(red: 16.0 / 255.0, green: 12.0 / 255.0, blue: 10.0 / 255.0, alpha: 1) view.backgroundColor = .black
} }
} }
@main @main
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { @objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
private let wirelessDataPrompt = WirelessDataPrompt()
private let thumbnailQueue = DispatchQueue(
label: "com.stormg.lumadrama.thumbnail",
qos: .userInitiated
)
override func application( override func application(
_ application: UIApplication, _ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool { ) -> Bool {
UIApplication.shared.isIdleTimerDisabled = true
return super.application(application, didFinishLaunchingWithOptions: launchOptions) return super.application(application, didFinishLaunchingWithOptions: launchOptions)
} }
override func applicationDidBecomeActive(_ application: UIApplication) {
super.applicationDidBecomeActive(application)
requestWirelessDataPrompt()
}
func requestWirelessDataPrompt() {
wirelessDataPrompt.requestSystemPrompt()
}
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
registerWirelessDataChannel(engineBridge)
registerDeviceIdChannel(engineBridge)
let channel = FlutterMethodChannel( let channel = FlutterMethodChannel(
name: "com.stormg.lumadrama/share", name: "com.stormg.lumadrama/share",
binaryMessenger: engineBridge.applicationRegistrar.messenger() binaryMessenger: engineBridge.applicationRegistrar.messenger()
@@ -43,5 +82,107 @@ final class RunnerFlutterViewController: FlutterViewController {
activity.completionWithItemsHandler = { _, _, _, _ in result(nil) } activity.completionWithItemsHandler = { _, _, _, _ in result(nil) }
controller.present(activity, animated: true) controller.present(activity, animated: true)
} }
let thumbnailChannel = FlutterMethodChannel(
name: "com.stormg.lumadrama/thumbnail",
binaryMessenger: engineBridge.applicationRegistrar.messenger()
)
thumbnailChannel.setMethodCallHandler { [weak self] call, result in
guard call.method == "frame" else {
result(FlutterMethodNotImplemented)
return
}
guard let self,
let arguments = call.arguments as? [String: Any],
let timeNumber = arguments["timeMs"] as? NSNumber else {
result(nil)
return
}
let localPath = arguments["localPath"] as? String ?? ""
let remoteUrl = arguments["url"] as? String ?? ""
let headers = arguments["headers"] as? [String: String] ?? [:]
let assetUrl: URL?
if !localPath.isEmpty {
assetUrl = localPath.hasPrefix("file:")
? URL(string: localPath)
: URL(fileURLWithPath: localPath)
} else if !remoteUrl.isEmpty {
assetUrl = URL(string: remoteUrl)
} else {
assetUrl = nil
}
guard let assetUrl else {
result(nil)
return
}
let options: [String: Any]? = headers.isEmpty
? nil
: [thumbnailHTTPHeaderFieldsKey: headers]
let asset = AVURLAsset(url: assetUrl, options: options)
let generator = AVAssetImageGenerator(asset: asset)
generator.appliesPreferredTrackTransform = true
generator.maximumSize = CGSize(width: 240, height: 426)
generator.requestedTimeToleranceBefore = CMTime(seconds: 0.5, preferredTimescale: 600)
generator.requestedTimeToleranceAfter = CMTime(seconds: 0.5, preferredTimescale: 600)
let time = CMTime(value: timeNumber.int64Value, timescale: 1000)
let gate = ThumbnailResponseGate()
self.thumbnailQueue.async {
do {
let image = try generator.copyCGImage(at: time, actualTime: nil)
let data = UIImage(cgImage: image).jpegData(compressionQuality: 0.7)
gate.send(result, data: data)
} catch {
gate.send(result, data: nil)
}
}
DispatchQueue.global(qos: .userInitiated).asyncAfter(
deadline: .now() + 1.5
) {
gate.send(result, data: nil)
}
}
}
/// 设备标识:IDFV 免权限,卸载本 App 不变,避免客户端自生成的 id 每次重装都变。
/// 同通道顺带提供设备区域(ISO-2),注册时作为服务端 IP 解析失败后的兜底。
private func registerDeviceIdChannel(_ engineBridge: FlutterImplicitEngineBridge) {
let channel = FlutterMethodChannel(
name: "com.stormg.lumadrama/device",
binaryMessenger: engineBridge.applicationRegistrar.messenger()
)
channel.setMethodCallHandler { call, result in
switch call.method {
case "idfv":
result(UIDevice.current.identifierForVendor?.uuidString)
case "region":
if #available(iOS 16.0, *) {
result(Locale.current.region?.identifier)
} else {
result(Locale.current.regionCode)
}
default:
result(FlutterMethodNotImplemented)
}
}
}
private func registerWirelessDataChannel(_ engineBridge: FlutterImplicitEngineBridge) {
let channel = FlutterMethodChannel(
name: WirelessDataPrompt.channelName,
binaryMessenger: engineBridge.applicationRegistrar.messenger()
)
channel.setMethodCallHandler { [weak self] call, result in
guard call.method == WirelessDataPrompt.awaitDecisionMethod else {
result(FlutterMethodNotImplemented)
return
}
guard let self else {
result(nil)
return
}
self.wirelessDataPrompt.awaitDecision(result)
}
} }
} }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 907 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 907 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 B

After

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 24 KiB

@@ -16,18 +16,13 @@
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" image="LaunchBackground" translatesAutoresizingMaskIntoConstraints="NO" id="tWc-Dq-wcI"/> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4"/>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4"></imageView>
</subviews> </subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0" green="0" blue="0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="3T2-ad-Qdv"/> <constraint firstItem="YRO-k0-Ey4" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="3T2-ad-Qdv"/>
<constraint firstItem="tWc-Dq-wcI" firstAttribute="bottom" secondItem="Ze5-6b-2t3" secondAttribute="bottom" id="RPx-PI-7Xg"/>
<constraint firstItem="tWc-Dq-wcI" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="SdS-ul-q2q"/>
<constraint firstAttribute="trailing" secondItem="tWc-Dq-wcI" secondAttribute="trailing" id="Swv-Gf-Rwn"/>
<constraint firstAttribute="trailing" secondItem="YRO-k0-Ey4" secondAttribute="trailing" id="TQA-XW-tRk"/> <constraint firstAttribute="trailing" secondItem="YRO-k0-Ey4" secondAttribute="trailing" id="TQA-XW-tRk"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="bottom" secondItem="Ze5-6b-2t3" secondAttribute="bottom" id="duK-uY-Gun"/> <constraint firstItem="YRO-k0-Ey4" firstAttribute="bottom" secondItem="Ze5-6b-2t3" secondAttribute="bottom" id="duK-uY-Gun"/>
<constraint firstItem="tWc-Dq-wcI" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="kV7-tw-vXt"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="xPn-NY-SIU"/> <constraint firstItem="YRO-k0-Ey4" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="xPn-NY-SIU"/>
</constraints> </constraints>
</view> </view>
@@ -38,7 +33,6 @@
</scene> </scene>
</scenes> </scenes>
<resources> <resources>
<image name="LaunchImage" width="1152" height="1152"/> <image name="LaunchImage" width="390" height="844"/>
<image name="LaunchBackground" width="1" height="1"/>
</resources> </resources>
</document> </document>
+98 -96
View File
@@ -1,109 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>FruitShorts</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>FruitShorts</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict> <dict>
<key>NSAllowsArbitraryLoads</key> <key>CADisableMinimumFrameDurationOnPhone</key>
<true/> <true/>
<key>NSAllowsLocalNetworking</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>FruitShorts</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>FruitShorts</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSExceptionDomains</key> <key>NSAppTransportSecurity</key>
<dict> <dict>
<key>127.0.0.1</key> <key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsLocalNetworking</key>
<true/>
<key>NSExceptionDomains</key>
<dict> <dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key> <key>127.0.0.1</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>192.168.31.187</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>39.162.50.99</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
<key>NSLocalNetworkUsageDescription</key>
<string>开发阶段需要访问同一局域网内的短剧内容服务。</string>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict> <dict>
<key>UISceneClassName</key> <key>NSExceptionAllowsInsecureHTTPLoads</key>
<string>UIWindowScene</string> <true/>
<key>UISceneConfigurationName</key> <key>NSIncludesSubdomains</key>
<string>flutter</string> <true/>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict> </dict>
</array> <key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>192.168.31.243</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>39.162.50.99</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict> </dict>
<key>NSLocalNetworkUsageDescription</key>
<string>开发阶段需要访问同一局域网内的短剧内容服务。</string>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneClassName</key>
<string>UIWindowScene</string>
<key>UISceneConfigurationName</key>
<string>flutter</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIStatusBarHidden</key>
<false/>
</dict> </dict>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist> </plist>
+6 -1
View File
@@ -1,6 +1,11 @@
// Author: fruit.com.cn
import Flutter import Flutter
import UIKit import UIKit
class SceneDelegate: FlutterSceneDelegate { class SceneDelegate: FlutterSceneDelegate {
override func sceneDidBecomeActive(_ scene: UIScene) {
super.sceneDidBecomeActive(scene)
(UIApplication.shared.delegate as? AppDelegate)?.requestWirelessDataPrompt()
}
} }
+68
View File
@@ -0,0 +1,68 @@
// Author: fruit.com.cn
import CoreTelephony
import Flutter
import Foundation
/// 监听系统无线数据选择,并用 URLSession 唤起系统选择框。
final class WirelessDataPrompt {
static let channelName = "com.stormg.lumadrama/wireless-data"
static let awaitDecisionMethod = "awaitDecision"
/// 系统选择框由 URLSession 触发,Dart 的 Socket 请求不会弹出。
private static let promptURL = URL(string: "https://captive.apple.com/hotspot-detect.html")
private let cellularData = CTCellularData()
private let lock = NSLock()
private var pending: [FlutterResult] = []
private var decided = false
private var didRequestPrompt = false
init() {
cellularData.cellularDataRestrictionDidUpdateNotifier = { [weak self] state in
DispatchQueue.main.async {
self?.completeIfDecided(state)
}
}
}
/// 应用进入前台后请求一次,促使系统弹出无线数据选择。
func requestSystemPrompt() {
guard !didRequestPrompt, let promptURL = Self.promptURL else {
return
}
didRequestPrompt = true
_ = cellularData.restrictedState
URLSession.shared.dataTask(with: promptURL) { _, _, _ in }.resume()
}
/// 未允许前先挂起;用户允许无线数据后再放行。
func awaitDecision(_ result: @escaping FlutterResult) {
lock.lock()
if decided {
lock.unlock()
DispatchQueue.main.async {
result(nil)
}
return
}
pending.append(result)
lock.unlock()
}
private func completeIfDecided(_ state: CTCellularDataRestrictedState) {
if state != .notRestricted {
return
}
lock.lock()
if decided {
lock.unlock()
return
}
decided = true
let waiters = pending
pending.removeAll()
lock.unlock()
waiters.forEach { $0(nil) }
}
}
+58 -23
View File
@@ -14,6 +14,7 @@ import 'core/data/remote/catalog_api.dart';
import 'core/data/remote/category_api.dart'; import 'core/data/remote/category_api.dart';
import 'core/data/remote/comment_api.dart'; import 'core/data/remote/comment_api.dart';
import 'core/data/remote/commerce_api.dart'; import 'core/data/remote/commerce_api.dart';
import 'core/data/remote/device_profile.dart';
import 'core/data/remote/download_api.dart'; import 'core/data/remote/download_api.dart';
import 'core/data/remote/interaction_api.dart'; import 'core/data/remote/interaction_api.dart';
import 'core/data/remote/library_api.dart'; import 'core/data/remote/library_api.dart';
@@ -30,6 +31,7 @@ import 'core/data/repositories/favorite_repository.dart';
import 'core/data/repositories/interaction_repository.dart'; import 'core/data/repositories/interaction_repository.dart';
import 'core/data/repositories/notice_repository.dart'; import 'core/data/repositories/notice_repository.dart';
import 'core/data/repositories/playback_repository.dart'; import 'core/data/repositories/playback_repository.dart';
import 'core/data/repositories/playlist_repository.dart';
import 'core/data/repositories/search_repository.dart'; import 'core/data/repositories/search_repository.dart';
import 'core/data/repositories/store_repository.dart'; import 'core/data/repositories/store_repository.dart';
import 'core/data/repositories/watch_history_repository.dart'; import 'core/data/repositories/watch_history_repository.dart';
@@ -41,7 +43,9 @@ import 'core/data/services/download_controller.dart';
import 'core/data/services/favorite_controller.dart'; import 'core/data/services/favorite_controller.dart';
import 'core/data/services/interaction_controller.dart'; import 'core/data/services/interaction_controller.dart';
import 'core/data/services/locale_controller.dart'; import 'core/data/services/locale_controller.dart';
import 'core/data/services/playlist_controller.dart';
import 'core/data/services/event_tracker.dart'; import 'core/data/services/event_tracker.dart';
import 'core/data/services/playback_position_cache.dart';
import 'core/data/services/playback_session.dart'; import 'core/data/services/playback_session.dart';
import 'core/data/services/video_player_port.dart'; import 'core/data/services/video_player_port.dart';
import 'core/data/services/wallet_controller.dart'; import 'core/data/services/wallet_controller.dart';
@@ -52,13 +56,15 @@ import 'core/theme/app_colors.dart';
import 'l10n/app_localizations.dart'; import 'l10n/app_localizations.dart';
import 'pages/home/home_view.dart'; import 'pages/home/home_view.dart';
/// 全局系统栏样式:浅暖导航栏、关闭 Android 对比遮罩。 /// 全局系统栏样式:深色底 + 浅色图标,关闭 Android 对比遮罩。
final SystemUiOverlayStyle appSystemOverlayStyle = SystemUiOverlayStyle.dark final SystemUiOverlayStyle appSystemOverlayStyle = SystemUiOverlayStyle.light
.copyWith( .copyWith(
statusBarColor: Colors.transparent, statusBarColor: AppColors.transparent,
statusBarIconBrightness: Brightness.light,
statusBarBrightness: Brightness.dark,
systemNavigationBarColor: AppColors.ink, systemNavigationBarColor: AppColors.ink,
systemNavigationBarDividerColor: Colors.transparent, systemNavigationBarDividerColor: AppColors.transparent,
systemNavigationBarIconBrightness: Brightness.dark, systemNavigationBarIconBrightness: Brightness.light,
systemNavigationBarContrastEnforced: false, systemNavigationBarContrastEnforced: false,
); );
@@ -72,6 +78,7 @@ class LumaDramaApp extends StatefulWidget {
this.watchHistoryRepository, this.watchHistoryRepository,
this.favoriteRepository, this.favoriteRepository,
this.playbackRepository, this.playbackRepository,
this.playbackPositionCache,
this.commentRepository, this.commentRepository,
this.interactionRepository, this.interactionRepository,
this.noticeRepository, this.noticeRepository,
@@ -79,6 +86,7 @@ class LumaDramaApp extends StatefulWidget {
this.commerceRepository, this.commerceRepository,
this.storeRepository, this.storeRepository,
this.searchRepository, this.searchRepository,
this.playlistRepository,
this.haptics = const FlutterHaptics(), this.haptics = const FlutterHaptics(),
}); });
@@ -91,6 +99,7 @@ class LumaDramaApp extends StatefulWidget {
final WatchHistoryRepository? watchHistoryRepository; final WatchHistoryRepository? watchHistoryRepository;
final FavoriteRepository? favoriteRepository; final FavoriteRepository? favoriteRepository;
final PlaybackRepository? playbackRepository; final PlaybackRepository? playbackRepository;
final PlaybackPositionCache? playbackPositionCache;
final CommentRepository? commentRepository; final CommentRepository? commentRepository;
final InteractionRepository? interactionRepository; final InteractionRepository? interactionRepository;
final NoticeRepository? noticeRepository; final NoticeRepository? noticeRepository;
@@ -98,6 +107,7 @@ class LumaDramaApp extends StatefulWidget {
final CommerceRepository? commerceRepository; final CommerceRepository? commerceRepository;
final StoreRepository? storeRepository; final StoreRepository? storeRepository;
final SearchRepository? searchRepository; final SearchRepository? searchRepository;
final PlaylistRepository? playlistRepository;
final Haptics haptics; final Haptics haptics;
@override @override
@@ -108,12 +118,13 @@ class _LumaDramaAppState extends State<LumaDramaApp> {
late final AuthSessionStore _sessionStore = AuthSessionStore(); late final AuthSessionStore _sessionStore = AuthSessionStore();
/// 全 App 共用一个 ApiClient:这样目录、账号、后续的互动/进度请求 /// 全 App 共用一个 ApiClient:这样目录、账号、后续的互动/进度请求
/// 都自动带 `Authorization` 与 `X-Device-Id`,401 的刷新重试也只有一处实现。 /// 都自动带 `Authorization`、`X-Device-Id` 与平台头,401 的刷新重试也只有一处实现。
late final ApiClient _apiClient = ApiClient( late final ApiClient _apiClient = ApiClient(
accessTokenReader: () => _auth.accessToken, accessTokenReader: () => _auth.accessToken,
tokenRefresher: () => _auth.refresh(), tokenRefresher: () => _auth.refresh(),
onUnauthorized: () => _auth.clear(), onUnauthorized: () => _auth.clear(),
deviceIdReader: _sessionStore.deviceId, deviceIdReader: _sessionStore.deviceId,
platformReader: clientPlatform,
); );
late final AuthController _auth = AuthController( late final AuthController _auth = AuthController(
@@ -121,8 +132,10 @@ class _LumaDramaAppState extends State<LumaDramaApp> {
_sessionStore, _sessionStore,
); );
late final CatalogApi _catalogApi = CatalogApi(_apiClient);
late final CatalogRepository _catalogRepository = late final CatalogRepository _catalogRepository =
widget.catalogRepository ?? HttpCatalogRepository(CatalogApi(_apiClient)); widget.catalogRepository ?? HttpCatalogRepository(_catalogApi);
late final CategoryRepository _categoryRepository = late final CategoryRepository _categoryRepository =
widget.categoryRepository ?? widget.categoryRepository ??
@@ -130,22 +143,19 @@ class _LumaDramaAppState extends State<LumaDramaApp> {
late final WatchHistoryRepository _watchHistory = late final WatchHistoryRepository _watchHistory =
widget.watchHistoryRepository ?? widget.watchHistoryRepository ??
HttpWatchHistoryRepository( HttpWatchHistoryRepository(WatchApi(_apiClient));
WatchApi(_apiClient),
isSignedIn: () => _auth.isSignedIn,
);
late final FavoriteRepository _favorites = late final FavoriteRepository _favorites =
widget.favoriteRepository ?? widget.favoriteRepository ??
HttpFavoriteRepository( HttpFavoriteRepository(LibraryApi(_apiClient));
LibraryApi(_apiClient),
isSignedIn: () => _auth.isSignedIn,
);
late final PlaybackRepository _playback = late final PlaybackRepository _playback =
widget.playbackRepository ?? widget.playbackRepository ??
HttpPlaybackRepository(PlaybackApi(_apiClient)); HttpPlaybackRepository(PlaybackApi(_apiClient));
late final PlaybackPositionCache _playbackPositionCache =
widget.playbackPositionCache ?? PlaybackPositionCache();
late final FavoriteController _favoriteController = FavoriteController( late final FavoriteController _favoriteController = FavoriteController(
_favorites, _favorites,
); );
@@ -169,6 +179,13 @@ class _LumaDramaAppState extends State<LumaDramaApp> {
late final SearchRepository _searchRepository = late final SearchRepository _searchRepository =
widget.searchRepository ?? HttpSearchRepository(CatalogApi(_apiClient)); widget.searchRepository ?? HttpSearchRepository(CatalogApi(_apiClient));
/// 测试注入了目录仓库时不打剧单接口,剧单页继续用本地分区。
late final PlaylistRepository? _playlistRepository =
widget.playlistRepository ??
(widget.catalogRepository == null
? HttpPlaylistRepository(CatalogApi(_apiClient))
: null);
late final StoreRepository _storeRepository = late final StoreRepository _storeRepository =
widget.storeRepository ?? HttpStoreRepository(CommerceApi(_apiClient)); widget.storeRepository ?? HttpStoreRepository(CommerceApi(_apiClient));
@@ -198,7 +215,7 @@ class _LumaDramaAppState extends State<LumaDramaApp> {
unawaited(_localeController.load()); unawaited(_localeController.load());
// 登录/登出时同步收藏状态:收藏属于账号,不能跨账号串联 // 登录/登出时同步收藏状态:收藏属于账号,不能跨账号串联
_auth.addListener(_onAuthChanged); _auth.addListener(_onAuthChanged);
if (_auth.isSignedIn) unawaited(_favoriteController.load()); unawaited(_favoriteController.load());
if (_auth.isSignedIn) unawaited(_walletController.load()); if (_auth.isSignedIn) unawaited(_walletController.load());
unawaited(_downloadController.restore()); unawaited(_downloadController.restore());
} }
@@ -214,6 +231,7 @@ class _LumaDramaAppState extends State<LumaDramaApp> {
unawaited(_walletController.load()); unawaited(_walletController.load());
} else { } else {
_favoriteController.clear(); _favoriteController.clear();
unawaited(_favoriteController.load());
_downloadController.reset(); _downloadController.reset();
_walletController.reset(); _walletController.reset();
} }
@@ -231,15 +249,28 @@ class _LumaDramaAppState extends State<LumaDramaApp> {
super.dispose(); super.dispose();
} }
CategoryController _createCategories() {
final controller = CategoryController(_categoryRepository);
if (widget.catalogRepository == null) {
controller.dramaPageLoader = CategoryApi(_apiClient).dramas;
}
controller.load();
return controller;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final playlists = _playlistRepository;
return MultiProvider( return MultiProvider(
providers: [ providers: [
Provider(create: (_) => PlaybackCoordinator()), Provider(create: (_) => PlaybackCoordinator()),
Provider<EventTracker>(create: (_) => EventTracker(_apiClient)), Provider<EventTracker>(create: (_) => EventTracker(_apiClient)),
Provider<PlayerFactory>(create: (_) => widget.playerFactory), Provider<PlayerFactory>(create: (_) => widget.playerFactory),
Provider<CatalogRepository>.value(value: _catalogRepository), Provider<CatalogRepository>.value(value: _catalogRepository),
if (widget.catalogRepository == null)
Provider<CatalogApi>.value(value: _catalogApi),
Provider<PlaybackRepository>.value(value: _playback), Provider<PlaybackRepository>.value(value: _playback),
Provider<PlaybackPositionCache>.value(value: _playbackPositionCache),
Provider<WatchHistoryRepository>.value(value: _watchHistory), Provider<WatchHistoryRepository>.value(value: _watchHistory),
Provider<FavoriteRepository>.value(value: _favorites), Provider<FavoriteRepository>.value(value: _favorites),
Provider<CommentRepository>.value(value: _commentRepository), Provider<CommentRepository>.value(value: _commentRepository),
@@ -251,11 +282,15 @@ class _LumaDramaAppState extends State<LumaDramaApp> {
Provider<SearchRepository>.value(value: _searchRepository), Provider<SearchRepository>.value(value: _searchRepository),
Provider<Haptics>.value(value: widget.haptics), Provider<Haptics>.value(value: widget.haptics),
ChangeNotifierProvider( ChangeNotifierProvider(
create: (_) => CatalogController(_catalogRepository)..load(), create: (_) {
), final catalog = CatalogController(_catalogRepository);
ChangeNotifierProvider( if (widget.catalogRepository != null) catalog.load();
create: (_) => CategoryController(_categoryRepository)..load(), return catalog;
},
), ),
ChangeNotifierProvider(create: (_) => _createCategories()),
if (playlists != null)
ChangeNotifierProvider(create: (_) => PlaylistController(playlists)),
ChangeNotifierProvider.value(value: _favoriteController), ChangeNotifierProvider.value(value: _favoriteController),
ChangeNotifierProvider.value(value: _downloadController), ChangeNotifierProvider.value(value: _downloadController),
ChangeNotifierProvider.value(value: _walletController), ChangeNotifierProvider.value(value: _walletController),
@@ -273,9 +308,9 @@ class _LumaDramaAppState extends State<LumaDramaApp> {
localeResolutionCallback: (deviceLocale, _) => localeResolutionCallback: (deviceLocale, _) =>
resolveAppLocale(deviceLocale), resolveAppLocale(deviceLocale),
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
themeMode: ThemeMode.light, themeMode: ThemeMode.dark,
theme: AppTheme.light(), theme: AppTheme.dark(),
darkTheme: AppTheme.light(), darkTheme: AppTheme.dark(),
builder: (context, child) => AnnotatedRegion<SystemUiOverlayStyle>( builder: (context, child) => AnnotatedRegion<SystemUiOverlayStyle>(
value: appSystemOverlayStyle, value: appSystemOverlayStyle,
child: child ?? const SizedBox.shrink(), child: child ?? const SizedBox.shrink(),
+1 -1
View File
@@ -14,7 +14,7 @@ class AppConfig {
/// 开发调试默认服务地址,当前指向本机局域网 IP。 /// 开发调试默认服务地址,当前指向本机局域网 IP。
/// ///
/// 换网络时只改这一行,地址不要带结尾斜杠。 /// 换网络时只改这一行,地址不要带结尾斜杠。
static const String devHostBaseUrl = 'http://192.168.31.187:8081'; static const String devHostBaseUrl = 'http://192.168.31.243:8081';
/// 本机后端地址:通过 `adb reverse tcp:8081 tcp:8081` 映射到开发机, /// 本机后端地址:通过 `adb reverse tcp:8081 tcp:8081` 映射到开发机,
/// 探测可达时 App 直连本机服务;不可达时回落到公网地址。 /// 探测可达时 App 直连本机服务;不可达时回落到公网地址。
+18 -5
View File
@@ -1,17 +1,30 @@
// Author: fruit.com.cn // Author: fruit.com.cn
import 'locale_text.dart';
/// 服务端内容分类。id 按契约保持字符串,避免雪花 ID 精度丢失。 /// 服务端内容分类。id 按契约保持字符串,避免雪花 ID 精度丢失。
class ContentCategory { class ContentCategory {
const ContentCategory({required this.id, required this.name}); const ContentCategory({
required this.id,
required this.name,
this.locales = const {},
});
final String id; final String id;
/// 中文名称,与 locales 里的 zh 相同。
final String name; final String name;
final Map<String, String> locales;
/// 解析 `GET /app/categories` 的单项。 /// 解析 `GET /app/categories` 的单项。
factory ContentCategory.fromJson(Map<String, dynamic> json) { factory ContentCategory.fromJson(Map<String, dynamic> json) {
return ContentCategory( final locales = localeMap(json['locales']);
id: (json['id'] ?? '').toString(), final name = json['name'] as String? ?? locales['zh'] ?? '';
name: json['name'] as String? ?? '', return ContentCategory(id: (json['id'] ?? '').toString(), name: name, locales: locales);
); }
/// 按界面语言取名称。缺对应语言时回落到中文。
String localizedName(String languageCode) {
return localizedText(languageCode, name, locales);
} }
} }
+206 -21
View File
@@ -1,6 +1,9 @@
// Author: fruit.com.cn // Author: fruit.com.cn
import 'dart:ui';
import 'json_numbers.dart'; import 'json_numbers.dart';
import 'locale_text.dart';
/// 短剧与剧集,字段与后端 `/app/**` 的下发结构对应。 /// 短剧与剧集,字段与后端 `/app/**` 的下发结构对应。
/// ///
@@ -17,6 +20,8 @@ class Episode {
this.locked = false, this.locked = false,
this.likeCount, this.likeCount,
this.commentCount, this.commentCount,
this.thumbnailsUrl,
this.posterUrl,
}); });
final String id; final String id;
@@ -32,19 +37,42 @@ class Episode {
final bool locked; final bool locked;
final int? likeCount; final int? likeCount;
final int? commentCount; final int? commentCount;
final String? thumbnailsUrl;
final String? posterUrl;
Episode withVideoUrl(String url, {int? likeCount, int? commentCount}) => Episode withVideoUrl(
Episode( String url, {
id: id, int? likeCount,
number: number, int? commentCount,
title: title, String? thumbnailsUrl,
isFree: isFree, String? posterUrl,
videoUrl: url, }) => Episode(
durationSec: durationSec, id: id,
locked: locked, number: number,
likeCount: likeCount ?? this.likeCount, title: title,
commentCount: commentCount ?? this.commentCount, isFree: isFree,
); videoUrl: url,
durationSec: durationSec,
locked: locked,
likeCount: likeCount ?? this.likeCount,
commentCount: commentCount ?? this.commentCount,
thumbnailsUrl: thumbnailsUrl ?? this.thumbnailsUrl,
posterUrl: posterUrl ?? this.posterUrl,
);
Episode withStats({int? likeCount, int? commentCount}) => Episode(
id: id,
number: number,
title: title,
isFree: isFree,
videoUrl: videoUrl,
durationSec: durationSec,
locked: locked,
likeCount: likeCount ?? this.likeCount,
commentCount: commentCount ?? this.commentCount,
thumbnailsUrl: thumbnailsUrl,
posterUrl: posterUrl,
);
factory Episode.fromJson(Map<String, dynamic> json) { factory Episode.fromJson(Map<String, dynamic> json) {
return Episode( return Episode(
@@ -57,6 +85,8 @@ class Episode {
videoUrl: json['playUrl'] as String? ?? '', videoUrl: json['playUrl'] as String? ?? '',
likeCount: _optionalInt(json['likeCount']), likeCount: _optionalInt(json['likeCount']),
commentCount: _optionalInt(json['commentCount']), commentCount: _optionalInt(json['commentCount']),
thumbnailsUrl: _optionalString(json['thumbnailsUrl']),
posterUrl: _optionalString(json['posterUrl']),
); );
} }
} }
@@ -68,7 +98,14 @@ class Drama {
required this.synopsis, required this.synopsis,
required this.posterUrl, required this.posterUrl,
this.episodes = const [], this.episodes = const [],
this.titleLocales = const {},
this.synopsisLocales = const {},
this.tag = '',
this.tagLocales = const {},
this.tagColor = '',
this.category = '', this.category = '',
this.categoryLocales = const {},
this.types = const [],
this.genre = '', this.genre = '',
this.totalEpisodes = 0, this.totalEpisodes = 0,
this.freeEpisodes = 0, this.freeEpisodes = 0,
@@ -78,15 +115,24 @@ class Drama {
this.favoriteCount, this.favoriteCount,
this.commentCount, this.commentCount,
this.language = '', this.language = '',
this.dramaType = '',
this.createdAt,
this.detailLoaded = false, this.detailLoaded = false,
}); });
final String id; final String id;
final String title; final String title;
final String synopsis; final String synopsis;
final Map<String, String> titleLocales;
final Map<String, String> synopsisLocales;
final String tag;
final Map<String, String> tagLocales;
final String tagColor;
final String posterUrl; final String posterUrl;
final List<Episode> episodes; final List<Episode> episodes;
final String category; final String category;
final Map<String, String> categoryLocales;
final List<Map<String, String>> types;
final String genre; final String genre;
final int totalEpisodes; final int totalEpisodes;
final int freeEpisodes; final int freeEpisodes;
@@ -101,6 +147,12 @@ class Drama {
/// 卡片语种(如 zh-CN / id),用于剧场语言筛选。 /// 卡片语种(如 zh-CN / id),用于剧场语言筛选。
final String language; final String language;
/// 内容类型:ANIME 漫剧,LIVE 真人剧。
final String dramaType;
/// 上架时间;卡片接口未直接下发时可由 Snowflake id 估算。
final DateTime? createdAt;
/// 详情接口是否已经取过完整剧集列表。 /// 详情接口是否已经取过完整剧集列表。
/// 列表卡片只带一集可播预览,需要完整剧集时再进详情。 /// 列表卡片只带一集可播预览,需要完整剧集时再进详情。
final bool detailLoaded; final bool detailLoaded;
@@ -111,36 +163,53 @@ class Drama {
/// 列表卡片:带一集可播预览(首页直接起播),完整剧集进详情再取。 /// 列表卡片:带一集可播预览(首页直接起播),完整剧集进详情再取。
factory Drama.fromCardJson(Map<String, dynamic> json) { factory Drama.fromCardJson(Map<String, dynamic> json) {
final preview = json['preview']; final preview = json['preview'];
final text = _DramaText.fromJson(json);
return Drama( return Drama(
id: (json['id'] ?? '').toString(), id: (json['id'] ?? '').toString(),
title: json['title'] as String? ?? '', title: text.title,
synopsis: json['synopsis'] as String? ?? '', synopsis: text.synopsis,
titleLocales: text.titleLocales,
synopsisLocales: text.synopsisLocales,
tag: text.tag,
tagLocales: text.tagLocales,
tagColor: json['tagColor'] as String? ?? '',
posterUrl: json['cover'] as String? ?? '', posterUrl: json['cover'] as String? ?? '',
episodes: preview is Map<String, dynamic> episodes: preview is Map<String, dynamic>
? [Episode.fromJson(preview)] ? [Episode.fromJson(preview)]
: const [], : const [],
category: json['category'] as String? ?? '', category: text.category,
genre: json['genre'] as String? ?? '', categoryLocales: text.categoryLocales,
types: text.types,
genre: text.genre,
totalEpisodes: (json['totalEpisodes'] as num?)?.toInt() ?? 0, totalEpisodes: (json['totalEpisodes'] as num?)?.toInt() ?? 0,
isHot: json['isHot'] == true, isHot: json['isHot'] == true,
// viewCount 后端是 Long,按字符串下发(见 json_numbers.dart)
viewCount: jsonToInt(json['viewCount']), viewCount: jsonToInt(json['viewCount']),
likeCount: _optionalInt(json['likeCount']), likeCount: _optionalInt(json['likeCount']),
favoriteCount: _optionalInt(json['favoriteCount']), favoriteCount: _optionalInt(json['favoriteCount']),
commentCount: _optionalInt(json['commentCount']), commentCount: _optionalInt(json['commentCount']),
language: json['language'] as String? ?? '', language: json['language'] as String? ?? '',
dramaType: json['dramaType'] as String? ?? '',
createdAt: DateTime.tryParse(json['createdAt']?.toString() ?? ''),
); );
} }
/// 详情:带剧集列表。 /// 详情:带剧集列表。
factory Drama.fromDetailJson(Map<String, dynamic> json) { factory Drama.fromDetailJson(Map<String, dynamic> json) {
final text = _DramaText.fromJson(json);
return Drama( return Drama(
id: (json['id'] ?? '').toString(), id: (json['id'] ?? '').toString(),
title: json['title'] as String? ?? '', title: text.title,
synopsis: json['synopsis'] as String? ?? '', synopsis: text.synopsis,
titleLocales: text.titleLocales,
synopsisLocales: text.synopsisLocales,
tag: text.tag,
tagLocales: text.tagLocales,
tagColor: json['tagColor'] as String? ?? '',
posterUrl: json['cover'] as String? ?? '', posterUrl: json['cover'] as String? ?? '',
category: json['category'] as String? ?? '', category: text.category,
genre: json['genre'] as String? ?? '', categoryLocales: text.categoryLocales,
types: text.types,
genre: text.genre,
totalEpisodes: (json['totalEpisodes'] as num?)?.toInt() ?? 0, totalEpisodes: (json['totalEpisodes'] as num?)?.toInt() ?? 0,
freeEpisodes: (json['freeEpisodes'] as num?)?.toInt() ?? 0, freeEpisodes: (json['freeEpisodes'] as num?)?.toInt() ?? 0,
isHot: json['isHot'] == true, isHot: json['isHot'] == true,
@@ -149,6 +218,8 @@ class Drama {
favoriteCount: _optionalInt(json['favoriteCount']), favoriteCount: _optionalInt(json['favoriteCount']),
commentCount: _optionalInt(json['commentCount']), commentCount: _optionalInt(json['commentCount']),
language: json['language'] as String? ?? '', language: json['language'] as String? ?? '',
dramaType: json['dramaType'] as String? ?? '',
createdAt: DateTime.tryParse(json['createdAt']?.toString() ?? ''),
detailLoaded: true, detailLoaded: true,
episodes: (json['episodes'] as List? ?? const []) episodes: (json['episodes'] as List? ?? const [])
.whereType<Map<String, dynamic>>() .whereType<Map<String, dynamic>>()
@@ -156,6 +227,120 @@ class Drama {
.toList(), .toList(),
); );
} }
String localizedTitle(String languageCode) {
return localizedText(languageCode, title, titleLocales);
}
String localizedSynopsis(String languageCode) {
return localizedText(languageCode, synopsis, synopsisLocales);
}
String localizedTag(String languageCode) {
return localizedText(languageCode, tag, tagLocales);
}
/// 标签角标背景色。接口没给合法色值时用 fallback。
Color tagRibbonColor(Color fallback) {
final parsed = _colorFromHex(tagColor);
return parsed ?? fallback;
}
/// 按当前语言取类型名称。接口没带语言表时返回空,调用方继续用中文 genre。
List<String> localizedTypeLabels(String languageCode) {
final labels = <String>[];
for (final item in types) {
final label = localizedText(languageCode, item['zh'] ?? '', item);
if (label.isNotEmpty && !labels.contains(label)) labels.add(label);
}
if (labels.isNotEmpty) return labels;
final primary = localizedText(languageCode, '', categoryLocales);
if (primary.isNotEmpty) return [primary];
return const [];
}
} }
int? _optionalInt(dynamic value) => value == null ? null : jsonToInt(value); int? _optionalInt(dynamic value) => value == null ? null : jsonToInt(value);
String? _optionalString(dynamic value) {
final text = value is String ? value.trim() : '';
return text.isEmpty ? null : text;
}
Color? _colorFromHex(String raw) {
final text = raw.trim();
if (text.length != 7 || !text.startsWith('#')) return null;
final value = int.tryParse(text.substring(1), radix: 16);
if (value == null) return null;
return Color(0xFF000000 | value);
}
List<Map<String, String>> _typeLocales(Object? raw) {
if (raw is! List) return const [];
return raw.whereType<Map>().map(localeMap).toList(growable: false);
}
/// 从语言表还原中文展示字段。列表接口不再单独下发 title / synopsis / tag。
class _DramaText {
const _DramaText({
required this.title,
required this.synopsis,
required this.titleLocales,
required this.synopsisLocales,
required this.tag,
required this.tagLocales,
required this.category,
required this.categoryLocales,
required this.types,
required this.genre,
});
final String title;
final String synopsis;
final Map<String, String> titleLocales;
final Map<String, String> synopsisLocales;
final String tag;
final Map<String, String> tagLocales;
final String category;
final Map<String, String> categoryLocales;
final List<Map<String, String>> types;
final String genre;
factory _DramaText.fromJson(Map<String, dynamic> json) {
final titleLocales = localeMap(json['titleLocales']);
final synopsisLocales = localeMap(json['synopsisLocales']);
final tagLocales = localeMap(json['tagLocales']);
final categoryLocales = localeMap(json['categoryLocales']);
final types = _typeLocales(json['types']);
final category = _firstText(categoryLocales, json['category'], types);
return _DramaText(
title: _firstText(titleLocales, json['title']),
synopsis: _firstText(synopsisLocales, json['synopsis'] ?? json['description']),
titleLocales: titleLocales,
synopsisLocales: synopsisLocales,
tag: _firstText(tagLocales, json['tag']),
tagLocales: tagLocales,
category: category,
categoryLocales: categoryLocales,
types: types,
genre: _genreText(types, json['genre']),
);
}
}
String _firstText(Map<String, String> locales, Object? fallback, [List<Map<String, String>>? types]) {
final chinese = locales['zh'] ?? '';
if (chinese.isNotEmpty) return chinese;
if (types != null && types.isNotEmpty) {
final label = types.first['zh'] ?? '';
if (label.isNotEmpty) return label;
}
return fallback is String ? fallback : '';
}
String _genreText(List<Map<String, String>> types, Object? fallback) {
final names = types.map((item) => item['zh'] ?? '').where((value) => value.isNotEmpty);
final joined = names.join(' / ');
if (joined.isNotEmpty) return joined;
return fallback is String ? fallback : '';
}
+55
View File
@@ -0,0 +1,55 @@
// Author: fruit.com.cn
import 'json_numbers.dart';
/// 播放页轻量互动计数快照,不包含播放地址或票据信息。
class EpisodeStats {
const EpisodeStats({
required this.episodeId,
required this.dramaId,
required this.likeCount,
required this.commentCount,
required this.favoriteCount,
required this.liked,
required this.favorited,
});
final String episodeId;
final String dramaId;
final int likeCount;
final int commentCount;
final int favoriteCount;
final bool liked;
final bool favorited;
EpisodeStats copyWith({
String? dramaId,
int? likeCount,
int? commentCount,
int? favoriteCount,
bool? liked,
bool? favorited,
}) {
return EpisodeStats(
episodeId: episodeId,
dramaId: dramaId ?? this.dramaId,
likeCount: likeCount ?? this.likeCount,
commentCount: commentCount ?? this.commentCount,
favoriteCount: favoriteCount ?? this.favoriteCount,
liked: liked ?? this.liked,
favorited: favorited ?? this.favorited,
);
}
factory EpisodeStats.fromJson(Map<String, dynamic> json) {
return EpisodeStats(
episodeId: jsonToId(json['episodeId']),
dramaId: jsonToId(json['dramaId']),
likeCount: jsonToInt(json['likeCount']),
commentCount: jsonToInt(json['commentCount']),
favoriteCount: jsonToInt(json['favoriteCount']),
liked: json['liked'] == true,
favorited: json['favorited'] == true,
);
}
}
+10 -1
View File
@@ -48,7 +48,7 @@ class FeedSection {
factory FeedSection.fromJson(Map<String, dynamic> json) { factory FeedSection.fromJson(Map<String, dynamic> json) {
return FeedSection( return FeedSection(
code: json['code'] as String? ?? '', code: json['code'] as String? ?? '',
title: json['title'] as String? ?? '', title: _sectionTitle(json),
dramas: (json['dramas'] as List? ?? const []) dramas: (json['dramas'] as List? ?? const [])
.whereType<Map<String, dynamic>>() .whereType<Map<String, dynamic>>()
.map(Drama.fromCardJson) .map(Drama.fromCardJson)
@@ -84,3 +84,12 @@ class FeedBanner {
); );
} }
} }
String _sectionTitle(Map<String, dynamic> json) {
final locales = json['titleLocales'];
if (locales is Map) {
final chinese = locales['zh']?.toString() ?? '';
if (chinese.isNotEmpty) return chinese;
}
return json['title'] as String? ?? '';
}
Loaded 100 of 387 files, more files were not shown because too many files have changed in this diff. Show more