How to Disable the Blur Effect When Collapsing a `SliverAppBar` in a `CustomScrollView`

强颜欢笑 提交于 2020-01-11 13:07:48

问题


1. The Context

I'm trying to make a ListView that has some empty space at the top so the user can bring top cards to the bottom of the screen, where she can easily access them with her thumb. As discussed in this other StackOverflow question, I couldn't make this happen with a regular ListView, so I switched to its parent, a CustomScrollView.

However, after adding a top SliverAppBar, when I get close to collapsing it, the space blurs into darker shades of grey, as seen in the image below. How can I disable this effect?

2. The Code

The `SliverAppBar I'm using so far is:

SliverAppBar(
  automaticallyImplyLeading: false, // gets rid of the back arrow
  expandedHeight: 250, // the collapsible space you want to use 
  flexibleSpace: FlexibleSpaceBar(
    background: Container(
      color: Colors.transparent
    ),
  ),
),

I've also tried to modify my flexibleSpace: FlexibleSpaceBar, but it didn't seem to work:

flexibleSpace: FlexibleSpaceBar(
  title: AnimatedOpacity(
    opacity: 0.0,
    duration: Duration(seconds: 1),
  ),
  collapseMode: CollapseMode.none,
  stretchModes: [
    StretchMode.fadeTitle,
  ],
  background: Container(color: Colors.grey[850]),
),

来源:https://stackoverflow.com/questions/58884360/how-to-disable-the-blur-effect-when-collapsing-a-sliverappbar-in-a-customscro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!