sliver_passthrough 0.1.0 copy "sliver_passthrough: ^0.1.0" to clipboard
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 #

  1. Two widgets: SliverPassthrough and BoxToSliverPassthrough. First one turns sliver layout protocol to a box one, and the second one continues sliver layout where the first left off.
  2. SliverPassthrough also provides boxScrollOffset in the form of ValueListenable<double>, which can be useful for CustomPaint, 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.

0
likes
160
points
500
downloads

Publisher

verified publishernikolaynik.com

Weekly Downloads

2024.09.22 - 2025.04.06

Utility package that provides a seamless way to use box widgets sandwiched between slivers

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on sliver_passthrough