title: How to save Flutter Custom Scroll View's scroll position?
body: <p>I have Material App with <code>CustomScrollView</code> and <code>BottomNavigationBar</code>, in <code>CustomScrollView</code> I have <code>SliverAppBar</code> and one page <code>Widget</code> (let say page1, page2 etc...) which represents <code>BottomNavigationBar's</code> current index, on every page <code>Widget</code> there is <code>SliverList</code> with some content</p>
  
  <p>I have tried to put Keys and <code>ScrollControllers</code> inside <code>CustomScrollView</code> but it doesn't work as I expect, when navigating between pages Scroll position is initial.</p>
  
  <pre><code>class WrapperPage extends StatefulWidget {
    @override
    _WrapperPage createState() =&gt; _WrapperPage();
  }
  
  class _WrapperPage extends State&lt;WrapperPage&gt; {
    int _curIndex = 0;
    List&lt;Widget&gt; _pages;
    List&lt;PageStorageKey&gt; _keys;
    List&lt;ScrollController&gt; _ctrls;
  
    @override
    void initState() {
      _pages = [
        // some pages pages
      ];
  
      _keys = List();
      _ctrls = List();
      for (int i = 0; i &lt; 5; ++i) {
        _keys.add(PageStorageKey('scroll$i'));
        _ctrls.add(ScrollController());
      }
      super.initState();
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: CustomScrollView(
          key: _keys[_curIndex],
          controller: _ctrls[_curIndex],
          slivers: &lt;Widget&gt;[SliverAppBar(), _pages[_curIndex]],
        ),
        bottomNavigationBar: BottomNavigationBar(
          onTap: (int i) {
            setState(() {
              _curIndex = i;
            });
          },
          currentIndex: _curIndex,
          items: [
            // some buttons
          ],
        ),
      );
    }
  }
  </code></pre>
  
  <p>My goal is to save <code>CustomScrollView's</code> scroll state while navigating pages.</p>