StickyListItem<I> constructor

StickyListItem<I>({
  1. required Widget header,
  2. required Widget content,
  3. required I itemIndex,
  4. MinOffsetProvider<I>? minOffsetProvider,
  5. StreamSink<StickyState<I>>? streamSink,
  6. HeaderMainAxisAlignment mainAxisAlignment = HeaderMainAxisAlignment.start,
  7. HeaderCrossAxisAlignment crossAxisAlignment = HeaderCrossAxisAlignment.start,
  8. HeaderPositionAxis positionAxis = HeaderPositionAxis.mainAxis,
  9. Clip clipBehavior = Clip.hardEdge,
  10. Key? key,
})

Default sticky item constructor with relative header positioning

Implementation

StickyListItem({
  required Widget header,
  required Widget content,
  required this.itemIndex,
  this.minOffsetProvider,
  this.streamSink,
  this.mainAxisAlignment = HeaderMainAxisAlignment.start,
  this.crossAxisAlignment = HeaderCrossAxisAlignment.start,
  this.positionAxis = HeaderPositionAxis.mainAxis,
  Clip clipBehavior: Clip.hardEdge,
  Key? key,
})  : overlayContent = false,
      assert(
          positionAxis == HeaderPositionAxis.mainAxis ||
              crossAxisAlignment != HeaderCrossAxisAlignment.center,
          'Center cross axis alignment can\'t be used with Cross axis positioning'),
      super(
        key: key,
        children: [content, header],
        clipBehavior: clipBehavior,
      );