2.6 KiB
2.6 KiB
INBOX
[已处理] K71-A 首页深色底部导航补齐安全区底色
现象
首页 feed(深色)下,底部导航下方的系统安全区(iOS Home Indicator 条 / Android 手势条区域) 颜色与首页背景不一致:会透出窗口底色或模糊内容,看上去有一条浅色/发灰的边。
根因
lib/core/widgets/app_bottom_nav.dart:
ClipRect(
child: BackdropFilter(
filter: ImageFilter.blur(...),
child: SafeArea(
top: false,
child: Container(height: navHeight, color: 0xE6000000, ...),
),
),
)
SafeArea 的底部内边距在 Container 之外,没有任何填充色;深色模式下导航条本身也是
0xE6000000 半透明叠在窗口底色上,所以「导航条 + 下方安全区」都跟首页的纯黑背景不一致。
目标
- 首页 feed(
dark: true):底部导航条与下方安全区整体为纯黑Colors.black, 与首页背景一致,不再透出模糊/白底。 - 浅色模式(剧场/创作/我的、其它页面):保持现有玻璃模糊 + 0.95 透明观感不变。
实现
lib/core/widgets/app_bottom_nav.dart 的 build:
- 深色分支:
ColoredBox(color: Colors.black)包住SafeArea(top: false, child: 导航条 Container)- 导航条
Container的底色改为Colors.black(不再0xE6000000),保留顶部Colors.white12分隔线 - 不再使用
BackdropFilter(背后是窗口底色,模糊没有意义)
- 浅色分支:原样保留
ClipRect + BackdropFilter + SafeArea + backgroundColor.withValues(alpha: 0.95) barKey仍挂在navHeight的导航条Container上,总高度在无安全区时为AppDimens.navHeight
测试
- 现有
test/home/app_bottom_nav_test.dart的高度断言(无安全区 = navHeight)必须继续通过 - 新增用例:
dark: true且MediaQuery底部安全区为 34 时,AppBottomNav总高度 =navHeight + 34- 最外层
ColoredBox(或等价背景)颜色为Colors.black
验收
- 门禁:
dart analyze lib test零告警、flutter test全过、flutter build apk --debug成功。 - 真机自查:首页底部导航与其下方手势条区域为同一种纯黑,无浅色边。
Git
- 从
develop拉fix/home-nav-safe-area-color。 - 提交:
fix(home): 首页深色底部导航补齐安全区底色,作者Zhou Weidong <502333560@qq.com>。 --no-ff合回develop并 push;FruitServer/docs/plans/PROGRESS.md追加 K71-A 留痕。
约束
- 全程中文;禁止
git add -A;不改浅色模式观感与其它页面;完成后停住等待验收。