小编Cod*_*LeX的帖子

颤动-应用栏滚动,在灵活空间中重叠内容

我正在尝试使用Flutter重新创建在弹性空间中具有重叠内容的应用栏滚动。

该行为在此处演示:

http://karthikraj.net/2016/12/24/scrolling-behavior-for-appbars-in-android/

我已经使用SliverAppBar创建了折叠的AppBar,使用我在此处粘贴的代码,我正在尝试创建

我无法使用Stack,因为我找不到任何onScroll回调,到目前为止,我已使用flexibleSpace创建了应用栏,该应用栏在滚动时折叠:

Scaffold(
    body: NestedScrollView(
      headerSliverBuilder:
          (BuildContext context, bool innerBoxIsScrolled) => <Widget>[
                SliverAppBar(
                  forceElevated: innerBoxIsScrolled,
                  pinned: true,
                  expandedHeight: 180.0,
                ),
              ],
      body: ListView.builder(
        itemCount: 30,
        itemBuilder: (context, index) => Text(
              "Item $index",
              style: Theme.of(context).textTheme.display1,
            ),
      ),
    ),
  );
Run Code Online (Sandbox Code Playgroud)

我到目前为止所创造的

编辑:我要创建的示例

flutter flutter-sliver flutter-layout flutter-animation

6
推荐指数
1
解决办法
4894
查看次数