flutter_sticky_headers icon indicating copy to clipboard operation
flutter_sticky_headers copied to clipboard

Sparse header setup not working currently

Open ened opened this issue 7 years ago • 1 comments

Given code like this:

ListView.builder(
  itemCount: 35,
  itemBuilder: (context, i) {
    final tile = ListTile(title: Text("My Tile"));

    if (i % 5 == 0) {
      return StickyHeader(
        content: tile,
        header: Container(
          padding: EdgeInsets.symmetric(
            horizontal: 16.0,
            vertical: 8.0,
          ),
          alignment: Alignment.centerLeft,
          decoration: BoxDecoration(color: Colors.lightGreen),
          child: Text("Section"),
        ),
      );
    }

    return tile;
  }
);

Then I would expect the header stay on top of the list until the next header replaces it. Currently, it will only stay for as long as the current item stays on screen.

ened avatar Oct 05 '18 09:10 ened

+1 to this as a big use case for sticky headers is sticky section headers

tamoyal avatar Jan 05 '19 03:01 tamoyal