I Can't use a NestedScrollView with a GlobalKey to store state #427
-
I've been trying to store my NestedScrollViewState in order to keep the position of my NestedScrollView, however, when I do so it complains about the key being used on multiple Widgets.
I have stripped away all the fluff in this component, for easier reading. How can I store my scroll state and reuse it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Turns out this was more of a GoRouter issue. The nested scroll keys are being re-used on navigation |
Beta Was this translation helpful? Give feedback.
Turns out this was more of a GoRouter issue. The nested scroll keys are being re-used on navigation
push
and ongo
it will replace and destroy the key. Thus, the solution was to use StatefulShellRoutes to preserve my widget state and so also the key.