sliver_passthrough
1.0.0, released 2 years ago by nikolaynik.com
Widget to place box widgets between slivers in a CustomScrollView
What it does
Provides two widgets, SliverPassthrough and BoxToSliverPassthrough, that convert between sliver and box layout protocols and expose the box scroll offset via a ValueListenable.
AI-written summary of version 1.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Embedding a box widget inside a sliver list or grid
- Needing the scroll offset of a box for CustomPaint or other effects
- Simplifying CustomScrollView construction when mixing slivers and boxes
Skip it when
- Using only slivers or only boxes
- Needing advanced layout features beyond simple box-to-sliver conversion
Strengths
- Simple API, no external dependencies
- Works across all Flutter platforms
- Exposes scroll offset for custom painting
Weaknesses
- Limited to sliver/box conversion, no advanced layout options
- Documentation is minimal
- No examples for complex use cases
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
CustomScrollView(
slivers: [
SliverPassthrough(
minBoxExtent: 0.0,
child: ColoredBox(
color: Colors.red,
child: BoxToSliverPassthrough(
sliver: SliverList(
delegate: SliverChildBuilderDelegate(
(context, index) => SizedBox(),
),
),
),
),
),
],
)Alternatives
Packages that do the same job and could replace sliver_passthrough.
- paging_view
Flutter widgets for infinite‑scroll, paginated lists, grids and slivers with data‑source control.
71Compare - flutter_box_transform
Flutter widget for programmatic box resizing and dragging with constraints.
68Compare - nested_scroll_view_plus
An enhanced NestedScrollView providing overscroll support for parent and nested scroll views.
64Compare - sliver_sticky_collapsable_panel
A Sliver implementation of a sticky collapsible panel with a box header and sliver child.
57Compare
Works with
Packages commonly used together with sliver_passthrough: ones it builds on, ones built on it, and its own family.