Animating changes in a SliverList

后端 未结 2 1810
梦毁少年i
梦毁少年i 2021-02-12 18:33

I currently have a SliverList whose items are loaded dynamically. The issue is that once these items are loaded, the SliverList updates without animati

2条回答
  •  一生所求
    2021-02-12 19:23

    I have a workaround for using a simple ListView with a Sliver. It's not perfect and it has limitations, but it works for the case where you just have 2 Slivers, the AppBar and a SliverList.

    NestedScrollView(
      headerSliverBuilder: (_, _a) => SliverAppBar(),
      body: MediaQuery.removePadding(
        removeTop: true, 
        context: context, 
        child: AnimatedList(
          
        )))
    

    You can tweak around with the Widget tree, but that's the basic idea. Wrap the sliver appbar in a NestedScrollView and place the List in the body.

提交回复
热议问题