Flutter可折叠SliverAppBar,但没有TabBar的背景



中的示例代码https://api.flutter.dev/flutter/widgets/NestedScrollView-class.html显示了如何使用bottom:TabBar显示可折叠的SliverAppBar

问题是,当我添加flexibleSpace: FlexibleSpaceBar为应用程序栏设置背景图片时,图片会流血到选项卡上。我不希望选项卡有任何背景图片。

我可以把标签条包在一个容器里,给它一个背景色,但这样照片的底部看起来会被裁剪掉。

或者,https://medium.com/@diegoveloper/floft-collapsing-toool-bar-liver-app-bar-14b858e87abe建议我使用SliverPersistentHeader作为选项卡。

问题是,由于顶部有2个固定的薄片,我无法使用SliverOverlapAbsorber。我需要根据顶部薄片是否展开/折叠来显示不同的状态。

建议?

这个问题有一个悬而未决的问题:https://github.com/flutter/flutter/issues/25723

最新更新