feat(home): 底栏切换改为水平滑动 - #145
Conversation
The bottom navigation tabs used StatefulShellRoute.indexedStack, which swaps the branch instantly. Host the branches in a PageView (AnimatedBranchPageView) instead so the switch slides horizontally; every branch keeps its own navigator and page state because the pages stay mounted.
Three-branch shell, like the app: the switch animates the PageView, and a branch switched away from (even to the far one) keeps its page state instead of being rebuilt.
|
感謝貢獻, 本機驗證過了: analyze 跟基線一樣, test_145 加上 test_171/test_174 共 55 項通過, 切分頁後狀態也確實有保留. 合併前麻煩修兩點:
另外測試檔名 補完後請在測試各加一個案例, 我這邊再跑一次就合併, 謝謝! |
- Every branch stays mounted in the PageView, so the ones that are off screen have to be muted by hand; the indexedStack container this replaced wrapped them in an Offstage with a disabled TickerMode. - The shell reports the new branch before the slide starts, so the branch being slid to is the current one and keeps animating while it moves into view.
- The slide test file collided with test_145_poll_create_parser_test.dart, so it is numbered after the latest test now. - One case counts the frames of an endless animation in every branch: the one left off screen must stop, the slide target must keep running while it moves in. - One case asserts the reduced motion setting switches within a single frame, while the default still slides.
|
两点都改了,测试文件名也顺手换了,已推到 1. 隐藏分页停止动画
2. 减少动态效果
3. 测试文件名
本机验证: |
|
感謝, 已合併. 本機完整測試 1769 通過, analyze 跟基線一樣, 會隨下一個正式版發布. |
把底栏分支的切换从「瞬间替换」改成「水平滑动」。
实现:
每个分支仍各自持有自己的 Navigator 与页面状态(页面始终挂载、不重建、状态不丢)。
说明:
避免和各分支内部的列表 / 横向滑动控件抢手势。