SliverAnimatedList constructor Null safety

const SliverAnimatedList(
  1. {Key? key,
  2. required AnimatedListItemBuilder itemBuilder,
  3. ChildIndexGetter? findChildIndexCallback,
  4. int initialItemCount = 0}
)

Creates a sliver that animates items when they are inserted or removed.

Implementation

const SliverAnimatedList({
  super.key,
  required this.itemBuilder,
  this.findChildIndexCallback,
  this.initialItemCount = 0,
}) : assert(itemBuilder != null),
     assert(initialItemCount != null && initialItemCount >= 0);