Skip to content

Commit 043ae10

Browse files
committed
sticky_header [nfc]: Doc overflow behavior and paint-order constraints
1 parent dc2c9f0 commit 043ae10

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

lib/widgets/sticky_header.dart

+21
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,27 @@ enum _HeaderGrowthPlacement {
312312
///
313313
/// This widget takes most of its behavior from [SliverList],
314314
/// but adds sticky headers as described at [StickyHeaderListView].
315+
///
316+
/// ## Overflow across slivers
317+
///
318+
/// When the list item that controls the sticky header has
319+
/// [StickyHeaderItem.allowOverflow] true, the header will be permitted
320+
/// to overflow not only the item but this whole sliver.
321+
///
322+
/// The caller is responsible for arranging the paint order between slivers
323+
/// so that this works correctly: a sliver that might overflow must be painted
324+
/// after any sliver it might overflow onto.
325+
/// For example if [headerPlacement] puts headers at the left of the viewport
326+
/// (and any items with [StickyHeaderItem.allowOverflow] true are present),
327+
/// then this [SliverStickyHeaderList] must paint after any slivers that appear
328+
/// to the right of this sliver.
329+
///
330+
/// At present there's no off-the-shelf way to fully control the paint order
331+
/// between slivers.
332+
/// See the implementation of [RenderViewport.childrenInPaintOrder] for the
333+
/// paint order provided by [CustomScrollView]; it meets the above needs
334+
/// for some arrangements of slivers and values of [headerPlacement],
335+
/// but not others.
315336
class SliverStickyHeaderList extends RenderObjectWidget {
316337
SliverStickyHeaderList({
317338
super.key,

0 commit comments

Comments
 (0)