sliver_stretch_header 0.1.0 copy "sliver_stretch_header: ^0.1.0" to clipboard
sliver_stretch_header: ^0.1.0 copied to clipboard

outdated

Flutter implementation of stretchable header with a background as a sliver. Use it in a CustomScrollView.

sliver_stretch_header #

Flutter implementation of stretchable header with a background as a sliver.

             /--------------/  --
            /              /   /
           /  background  /   /  
          /              /   /
       /-------------/  /   /  stretchable 
      /    child    /  /   /
     /             /  /   /
    /-------------/  /   /
     /--------------/  --

Features #

  • Accepts one widget as child.
  • Accepts one widget as a background.
  • No other arguments required besides minStretchExtent.
  • Can stretch to fill the over-scroll area when the user over-scrolls.

Getting started #

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  sliver_stretch_header:

In your library add the following import:

import 'package:sliver_stretch_header/sliver_stretch_header.dart';

For help getting started with Flutter, view the online documentation.

Usage #

You can place your SliverStretchHeader inside a CustomScrollView(normally at 1st or 2nd place).

SliverStretchHeader(
  minStretchExtent: 100,    
  background: Container(
                color: Colors.red,
              ),
  child: Container(
          color: Colors.green,
          height: 60,
          child: Center(child: Text("Child Widget")),
         ),
),

You can find more details in the Example project.

Thanks #

👏 Thanks to flutter_sticky_header for giving me inspiration and encouragement to work in this project.

4
likes
30
pub points
0%
popularity

Publisher

unverified uploader

Flutter implementation of stretchable header with a background as a sliver. Use it in a CustomScrollView.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on sliver_stretch_header