StickyListItem<I> constructor
StickyListItem<I> ({
- required Widget header,
- required Widget content,
- required I itemIndex,
- MinOffsetProvider<
I> ? minOffsetProvider, - StreamSink<
StickyState< ? streamSink,I> > - HeaderMainAxisAlignment mainAxisAlignment = HeaderMainAxisAlignment.start,
- HeaderCrossAxisAlignment crossAxisAlignment = HeaderCrossAxisAlignment.start,
- HeaderPositionAxis positionAxis = HeaderPositionAxis.mainAxis,
- Clip clipBehavior = Clip.hardEdge,
- 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,
);