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

A sliver that contains a bottom-aligned box child and a stretchy box background. Use it in a CustomScrollView.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:sliver_stretch_header/sliver_stretch_header.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("SliverStretchHeader Example"),
        ),
        body: CustomScrollView(
          slivers: [
            SliverStretchHeader(
              minBlankExtent: 100,
              background: Container(
                color: Colors.red,
              ),
              child: Container(
                color: Colors.green,
                height: 60,
                child: Center(child: Text("Child Widget")),
              ),
            ),
            SliverList(
                delegate: SliverChildBuilderDelegate(
                        (context, index) {
                          return Container(
                              height: 50,
                              child: Center(child: Text("$index"))
                          );
                        },
                  childCount: 50
                )
            )
          ],
        ),
      )
    );
  }
}
4
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A sliver that contains a bottom-aligned box child and a stretchy box background. Use it in a CustomScrollView.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on sliver_stretch_header