ExpandableSliverList<T> constructor

ExpandableSliverList<T>({
  1. Key? key,
  2. required Iterable<T> initialItems,
  3. required ExpandableItemBuilder<T> builder,
  4. required ExpandableSliverListController<T> controller,
  5. @Deprecated("Use 'initialState' argument in the constructor of ExpandableSliverListController instead. This argument will be removed on Jan 3, 2022. If using the non-deprecated form, make sure to remove this argument as well, as this will overwrite the value set in the controller") bool? startCollapsed,
  6. Duration duration = kDefaultDuration,
  7. bool expandOnInitialInsertion = false,
})

items, build, and controller must be provided

Implementation

ExpandableSliverList({
  Key? key,
  required Iterable<T> initialItems,
  required this.builder,
  required this.controller,
  @Deprecated("Use 'initialState' argument in the constructor of ExpandableSliverListController instead. This argument will be removed on Jan 3, 2022. If using the non-deprecated form, make sure to remove this argument as well, as this will overwrite the value set in the controller")
      bool? startCollapsed,
  this.duration = kDefaultDuration,
  this.expandOnInitialInsertion = false,
})  : initialItems = List<T>.from(initialItems),
      super(key: key) {
  if (startCollapsed != null) {
    this.startCollapsed = startCollapsed;
    usedDeprecatedArg = true;
  } else {
    this.startCollapsed = false;
    usedDeprecatedArg = false;
  }
}