StackedListView constructor Null safety

const StackedListView(
  1. {Key? key,
  2. required int itemCount,
  3. required IndexedWidgetBuilder builder,
  4. bool reverse = false,
  5. Axis scrollDirection = Axis.vertical,
  6. EdgeInsetsGeometry? padding,
  7. ScrollController? controller,
  8. ScrollPhysics? physics,
  9. required double itemExtent,
  10. double fadeOutFrom = 0.7,
  11. double heightFactor = 1,
  12. double widthFactor = 1,
  13. StackedItemOnRemove? onRemove,
  14. StackedItemBeforeRemove? beforeRemove,
  15. Duration animateDuration = kThemeAnimationDuration}
)

Implementation

const StackedListView({
  Key? key,
  required this.itemCount,
  required this.builder,
  this.reverse = false,
  this.scrollDirection = Axis.vertical,
  this.padding,
  this.controller,
  this.physics,
  required this.itemExtent,
  this.fadeOutFrom = 0.7,
  this.heightFactor = 1,
  this.widthFactor = 1,
  this.onRemove,
  this.beforeRemove,
  this.animateDuration = kThemeAnimationDuration,
})  : assert(fadeOutFrom >= 0 && fadeOutFrom <= 1,
          'The range of "fadeOutFrom" must be 0.0 ~ 1.0'),
      assert(widthFactor >= 0 && widthFactor <= 1,
          'The range of "widthFactor" must be 0.0 ~ 1.0'),
      assert(heightFactor >= 0 && heightFactor <= 1,
          'The range of "heightFactor" must be 0.0 ~ 1.0'),
      assert(widthFactor == 1 || heightFactor == 1,
          'One of "widthFactor" or "heightFactor" must equal 1'),
      super(key: key);