flutter_sticky_headers
flutter_sticky_headers copied to clipboard
Sparse header setup not working currently
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.
+1 to this as a big use case for sticky headers is sticky section headers