Skip to content
pubscout

flutter_sticky_header

0.11.0, released 2 weeks ago by romainrastel.com

Flutter sliver implementation of sticky headers for CustomScrollView.

WASM-ready
$ flutter pub add flutter_sticky_header
Source repository

What it does

Provides SliverStickyHeader and SliverStickyHeader.builder widgets that allow you to place sticky headers inside a CustomScrollView. The header can stay pinned to the viewport, overlap its content, or stick to the end of its sliver.

AI-written summary of version 0.11.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a header that overlaps its content (like sticky side headers).
  • You want to build a header based on its current scroll state using a builder.
  • You need a sticky footer or a header that sticks to the end in a reversed list.

Skip it when

  • You are using Flutter 3.13 or newer and only need simple pinned headers that work natively with SliverMainAxisGroup.

Strengths

  • Supports header overlap and sticky footers via stickToEnd.
  • Provides scroll state notifications and builder pattern for dynamic layout changes.
  • Works with both reversed and standard CustomScrollViews.

Weaknesses

  • Some basic sticky header use cases can now be implemented directly via Flutter's core framework without extra packages.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1

not documented

CustomScrollView(
  slivers: [
    SliverStickyHeader(
      header: Container(
        height: 60.0,
        color: Colors.lightBlue,
        padding: EdgeInsets.symmetric(horizontal: 16.0),
        alignment: Alignment.centerLeft,
        child: Text('Header #0', style: TextStyle(color: Colors.white)),
      ),
      sliver: SliverList(
        delegate: SliverChildBuilderDelegate(
          (context, i) => ListTile(title: Text('List tile #$i')),
          childCount: 4,
        ),
      ),
    ),
  ],
)

Alternatives

Packages that do the same job and could replace flutter_sticky_header.

Works with

Packages commonly used together with flutter_sticky_header: ones it builds on, ones built on it, and its own family.