Animating changes in a SliverList

后端 未结 3 1420
心在旅途
心在旅途 2021-02-12 18:24

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

3条回答
  •  孤城傲影
    2021-02-12 19:13

    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.

提交回复
热议问题