Closed fleeser closed 10 months ago
I was able to resolve this by wrapping both header widgets inside MultiSliver from the sliver_tools package like so:
OverlapAbsorberPlus(
sliver: MultiSliver(
children: [
SCSliverAppBar(...),
SCSliverTabBar(...)
]
)
)
Would love to see this as a feature instead of using multiple different packages.
Thank you for your feedback. This is a common requirement, and I recommend continuing to use MultiSliver
to wrap multiple header slivers, as it is a suitable approach.
Additionally, based on the implementation of OverlapInjector
, it is not possible to have multiple OverlapInjector
instances coexist within the headerSliverBuilder
. This would disrupt the operation of the NestedScrollView
. Therefore, using MultiSliver
to group your header slivers is a suitable approach.
Thank you for understanding, and feel free to reach out if you have any further questions or concerns. ;)
The problem is as follows:
When there are multiple slivers inside the
headerSliverBuilder
and you try to inject both of those widget'sOverlapAbsorberPlus
, the following exception is thrown:I tried to wrap SliverMainAxisGroup around both header slivers, but the
pinned
effect won't work anymore. Therefore I thought the solution would be to pass different keys and use them by putting both of them into theCustomScrollView
.This is the code atm:
What I try to achieve: One of the Tabs should contain another pinned sliver. Currently, when removing the second
OverlapAbsorberPlus
andOverlapInjectorPlus
again, this Widget moves under the TabBar and pins itself directly under the AppBar, because this is the only Widget inside aOverlapAbsorberPlus
.Would love to hear from you!