小编gat*_*tti的帖子

颤动:ListView中的动画项目删除

我正在从Stream构建ListView.我需要为该列表添加删除和插入动画,但不知道如何.

我已经看过Flutter的这个示例,但它与流无关:https://flutter.io/catalog/samples/animated-list/

任何帮助非常感谢:)

new StreamBuilder(

    stream: feed.stream, // this is a Stream<List<Product>>

    builder: (context, snapshot) {
      if (!snapshot.hasData)
        return const Text('Loading products');
      return new ListView.builder(
          itemCount: snapshot.data.length,
          itemBuilder: (context, index) {
            Product product = snapshot.data[index];
            return new ProductWidget(product);
          });
    });
Run Code Online (Sandbox Code Playgroud)

listview dart flutter

9
推荐指数
1
解决办法
2270
查看次数

标签 统计

dart ×1

flutter ×1

listview ×1