SunnyList<T>.ofList constructor

  1. @protected
SunnyList<T>.ofList({
  1. required String id,
  2. ListTileBuilder<T>? itemBuilder,
  3. SunnyListDelegate<T?>? type,
  4. required SunnyObservableList<T> list,
  5. bool? primary,
  6. bool showDividers = false,
  7. DiffEquality diffEquality = const DiffEquality(),
  8. KeyGenerator<T>? keyGenerator,
  9. Consumer<Iterable<T>>? onChange,
  10. bool useStateTracker = true,
  11. bool reverse = false,
  12. bool? refreshWithPage,
  13. ScrollController? scrollController,
  14. EdgeInsets? padding,
  15. AnimationType animationType = AnimationType.size,
  16. AnimationType dismissAnimationType = AnimationType.slide,
  17. bool? shrinkWrap,
  18. SunnyListWidgetBuilder<T>? emptyState,
  19. List<SwipeActionBuilder<T>> primarySwipeActions = const [],
  20. List<SwipeActionBuilder<T>> secondarySwipeActions = const [],
  21. SunnyListWidgetBuilder<T>? header,
})

Implementation

@protected
SunnyList.ofList({
  required this.id,
  this.itemBuilder,
  SunnyListDelegate<T?>? type,
  required SunnyObservableList<T> list,
  this.primary,
  this.showDividers = false,
  this.diffEquality = const DiffEquality(),
  this.keyGenerator,
  this.onChange,
  this.useStateTracker = true,
  this.reverse = false,
  this.refreshWithPage,
  this.scrollController,
  this.padding,
  this.animationType = AnimationType.size,
  this.dismissAnimationType = AnimationType.slide,
  this.shrinkWrap,
  this.emptyState,
  this.primarySwipeActions = const [],
  this.secondarySwipeActions = const [],
  this.header,
})  : state = type ?? (() => SunnyListState()),
      _start = [...list],
      vstream = (() => list.changeStream.replacements()),
      super(key: Key(id));