Files
FruitServer/docs/plans/INBOX.md
T

68 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# INBOX
## [已处理] K66-A 启动页停留到首页就绪再进首页
### 背景
K65-A 已把首页预取提前到启动阶段。产品要求再简化观感:
> 「等首页加载完就进入首页就行了」
即:别再出现「深底 + 转圈」这种中间页,启动期间保持与原生开屏一致的品牌画面,
目录数据就绪后直接进首页。
### 现状
`lib/pages/home/home_view.dart` 的 `_buildHome`:
- `catalog.loading` 为 true 时返回 `AnnotatedRegion(light) + Scaffold(splashInk, 居中主题色转圈)`
- 数据就绪后才渲染 `_HomeTabs`
### 目标
- `catalog.loading` 且**首次启动尚未 settled** 时,显示与原生开屏一致的品牌画面:
深底 `AppColors.splashInk` + 居中的开屏图,不再显示转圈。
- 目录数据就绪后同帧切到首页。
- 非首次(`settled == true`,例如失败重试)仍保留原来的转圈 loading,避免重复播品牌画面。
### 实现
1. `pubspec.yaml`:`flutter.assets` 增加
- `assets/icon/splash_logo.png`
- `assets/icon/splash_logo_android12.png`
2. `lib/pages/home/home_view.dart`
- 新增私有 `_startupSplash()`:
- `AnnotatedRegion<SystemUiOverlayStyle>(value: SystemUiOverlayStyle.light)`
- `ColoredBox(color: AppColors.splashInk)`
- 居中 `Image.asset(..., key: Key('startup-splash'))`
- Android 用 `splash_logo_android12.png`、其它平台用 `splash_logo.png`
(与各自原生开屏的取图一致,避免切换时跳变)
- 尺寸:Android 288 逻辑像素见方,其它平台 384
- `_buildHome`:
```dart
if (catalog.loading) {
return catalog.settled ? _retryLoading() : _startupSplash();
}
```
`_retryLoading()` 即现有的深底 + 主题色转圈。
3. 测试(`test/home/` 下)
- `settled == false` 且 loading:出现 `startup-splash`,不出现 `CircularProgressIndicator`
- `settled == true` 且 loading:出现转圈,不出现 `startup-splash`
- 数据就绪:出现首页 feed,`startup-splash` 消失
4. 真机自查建议:冷启动录屏,确认原生开屏 → 品牌画面(无转圈)→ 首页,无闪白。
### 验收
- 冷启动不再出现单独的转圈页。
- 门禁:`dart analyze lib test` 零告警、`flutter test` 全过、`flutter build apk --debug` 成功。
### Git
- 从 `develop` 拉 `feat/startup-splash-hold`。
- 提交:`feat(home): 启动页停留至首页就绪`,作者 `Zhou Weidong <502333560@qq.com>`。
- `--no-ff` 合回 `develop` 并 push;`FruitServer/docs/plans/PROGRESS.md` 追加 K66-A 留痕。
### 约束
- 全程中文;禁止 `git add -A`;不改原生开屏资源与其它页面;完成后停住等待验收。