受三星新的启发One UI
,我想SliverAppBar
在 Flutter 中实现类似的东西。但我无法弄清楚...
根据 One UI 实现,SliverAppBartitle
应该出现在展开的 App Bar 的中心(垂直和水平)。同时,折叠时应贴在左侧。
注意:在我的情况下,App Bar 还包含背景图像......因此,尝试FlexibleSpaceBar
用Column
小部件包装似乎会使背景看起来很奇怪。
我还想在折叠时摆脱左侧的额外填充(即使没有放置“前导”小部件,默认情况下也可用)。另外,如果actions出现在SliverAppBar
展开时的底部会更好,这样用户就可以单枪匹马地到达它们......
一个用户界面:
Left ⇒ Expanded: Right ⇒ Collapsed:
- Actions on bottom - Actions as usual
- title is centered - title is on the left
(no unwanted padding on the left of title)