Closed aytoku closed 2 years ago
I had the same problem, I added a stickyHeader in a list view and during the scroll there was the same transparent line above the header.
I can suggest the workaround that I used to "solve" this issue. It is a truly bad workaround, but it works.
I wrapped the content widget inside a stack where the first item inside the children list is the widget that you want to display, then I added another child that is a Positioned with a white container and I moved it during the scroll to cover that line.
Here is a snapshot of the code:
StickyHeader(
header: buildTabBar(),
content: Stack(
children: [
[WIDGET],
AnimatedBuilder(
animation: scrollOffset,
builder: (_, __) {
return Positioned(
top: scrollOffset.value >= 200 ? scrollOffset.value - 200 : -20,
left: 0,
right: 0,
child: Container(color: Colors.white, height: 20)
);
})
],
),
)
scrollOffset is a ValueNotifier connected to the list view controller
_controller.addListener(() {
scrollOffset.value = _controller.position.pixels;
});
200 is a magic number that I found during the test, it is the offset when the line starts to appear
Fixed as-of v0.3.0.
Hello, between two sticky headers is padding and i can't remove it? Can you explain me how can i fix it or this is a bug?