sliver_passthrough 0.1.0
sliver_passthrough: ^0.1.0 copied to clipboard
Utility package that provides a seamless way to use box widgets sandwiched between slivers
Utility package that provides a seamless way to use box widgets sandwiched between slivers
Features #
- Two widgets:
SliverPassthrough
andBoxToSliverPassthrough
. First one turns sliver layout protocol to a box one, and the second one continues sliver layout where the first left off. SliverPassthrough
also providesboxScrollOffset
in the form ofValueListenable<double>
, which can be useful forCustomPaint
, for example.
Usage #
CustomScrollView(
slivers: [
SliverPassthrough( // sliver
minBoxExtent: .0, // extends scroll extent and prevents the box from squishing to 0, if necessary
builder:
(context, boxScrollOffset) => ColoredBox( // box
color: Colors.red,
child: BoxToSliverPassthrough( // sliver again, scrolled by the original CustomScrollView
sliver: SliverList(
delegate: SliverChildBuilderDelegate(
(context, index) => SizedBox(),
),
),
),
),
),
],
)
copied to clipboard
Community #
Feel free to use GitHub Discussions if you want:
- to ask a question to get help;
- to influence the project;
- to share ideas;
- to share interesting things this project allowed you to make;
- or to just discuss something related.
Reporting bugs #
If you encounter any bugs, feel free to use GitHub Issue Tracker to search for an existing issue or to open up a new one.
Contribution #
If you have something to contribute to the package, feel free to send out a GitHub Pull Request.
License #
All the source code is open and distributed under the MIT license.