title: Refresh a listview outside of a widget in Flutter?
body: <p>I have a Flutter application which comprises of a scaffold with a slider and a tabview.</p>
  
  <p>The tabview comprises of a List which is show on each tab as seen in the picture below.</p>
  
  <pre><code>  List&lt;Widget&gt; widgetList = &lt;Widget&gt;[
      Post(),
      Feed(),
      Location(),
      HomePage(),
      Feed(),
    ];
  </code></pre>
  
  <p>Now I would like to refresh the current tab on screen when the slider is moved. However, since the classes are private i.e. <code>_HomePageState</code>, I do not know how to access the <code>refreshList()</code> method as shown in the snippet below.</p>
  
  <p><strong>homepage.dart:</strong></p>
  
  <pre><code>class HomePage extends StatefulWidget {
    @override
    _HomePageState createState() =&gt; new _HomePageState();
  }
  
  class _HomePageState extends State&lt;HomePage&gt; {
    var list;
    var random;
  
    var refreshKey = GlobalKey&lt;RefreshIndicatorState&gt;();
  
    @override
    void initState() {
      super.initState();
      random = Random();
      refreshList();
    }
  
    Future&lt;Null&gt; refreshList() async {
      refreshKey.currentState?.show(atTop: false);
      await Future.delayed(Duration(seconds: 2));
  
      setState(() {
        list = List.generate(random.nextInt(10), (i) =&gt; "Item $i");
      });
  
      return null;
    }
  }
  </code></pre>
  
  <p>The slider is not baked into each listview Widget i.e. <code>homepage.dart</code> as the slider values is applicable to each individual tab. How can I refresh the inner listview widget when the outer widget with the slider is moved?</p>
  
  <p><a href="https://i.stack.imgur.com/tUsr9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/tUsr9.png" alt="enter image description here"></a></p>