-
列表动画即AnimatedList动画,是展示列表数据时组件动画
-
当列表的数据发生变化(添加或删除时),用动画的形式展示这种变化过程
2.1 构造函数
class AnimatedList extends StatefulWidget
const AnimatedList({
Key? key,
required this.itemBuilder,
this.initialItemCount = 0,
this.scrollDirection = Axis.vertical,
this.reverse = false,
this.controller,
this.primary,
this.physics,
this.shrinkWrap = false,
this.padding,
})
2.2 常用属性
| 属性 | 说明 | 取值 |
| :-: | :-: | :-: |
| key | 组件的标识符 | Key |
| itemBuilder | 生成每个列表的回调函数 | Widget Function(BuildContext context, int index, Animation animation) |
| initialItemCount | 创建时的item个数 | int |
| scrollDirection |