CustomScrollView(
SliverToBoxAdapter(), // firstBox
SliverPersistentHeader(pinned:true),
SliverToBoxAdapter(), // secondBox
)
I have a button on this page, when I click this button, how let SliverPersistentHeader scroll to top programmatically?
Addition: firstBox's height is uncertain.
Initalize a GlobalKey in that widget.
Then pass it to the widget you want to scroll to:
Then the button onPressed should be like this: