title: Listview position lost while navigating between pages {flutter, streambuilder, listview}
body: <p>In my Flutter app, I am trying to implement a <code>listview</code> which gets the data as a stream from a <code>Firestore</code> collection. Most of it works as expected - I can push the <code>Firestore</code> document details to the next page (detail page) but while returning to the main page, the app does not remember the listview position - possibly because it is a stream?</p>
  
  <p>I need your help and input that could help me achieve the goal? Below is the code for reference:</p>
  
  <p>Tried with <code>AutomaticKeepAliveClientMixin</code>; still not getting the intended results.</p>
  
  <p>I am looking forward to implementing keys to manage state in Stateful widgets</p>
  
  <pre><code>Widget build(BuildContext context) {
      ListTile makeListTile(DocumentSnapshot document) =&gt; ListTile(
            contentPadding:
                EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
  
        leading: Container(
          padding: EdgeInsets.only(right: 12.0),
          decoration: new BoxDecoration(
              border: new Border(
                  right: new BorderSide(width: 1.0, color: Colors.white24))),
          child: Icon(Icons.notifications_active, color: Colors.white),
        ),
        title: Text(
          document['title'],
          style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
        ),
        subtitle: Text(document['shortDesc'].toString(),
            style: TextStyle(color: Colors.white)),
  
        trailing:
            Icon(Icons.keyboard_arrow_right, color: Colors.white, size: 30.0),
        onTap: () {
          Navigator.of(context).push(new MaterialPageRoute(
                  builder: (context) =&gt; NewsDetails(document: document)));
        },
      );
  
  final topAppBar = AppBar(
    elevation: 0.1,
    backgroundColor: Colors.teal,
    title: Text('FirestoreDemo'),
      centerTitle: true,
  );
  
  Card makeCard(DocumentSnapshot document) =&gt; Card(
        elevation: 8.0,
        margin: new EdgeInsets.symmetric(horizontal: 10.0, vertical: 6.0),
        child: Container(
          decoration: BoxDecoration(color: Colors.teal),
          child: makeListTile(document),
        ),
      );
  
  Card makeUnreadCard(DocumentSnapshot document) =&gt; Card(
        elevation: 8.0,
        margin: new EdgeInsets.symmetric(horizontal: 10.0, vertical: 6.0),
        child: Container(
          decoration: BoxDecoration(color: Colors.deepOrangeAccent),
          child: makeListTile(document),
        ),
      );
  
  return new Scaffold(
    appBar: topAppBar,
    drawer: new MainDrawer(labels: widget.labels),
    body: new StreamBuilder&lt;QuerySnapshot&gt;(
        stream: Firestore.instance
            .collection('collecton01')
            .orderBy('date', descending: true)
            .snapshots(),
        builder:
            (BuildContext context, AsyncSnapshot&lt;QuerySnapshot&gt; snapshot) {
  
              if (!snapshot.hasData)
              return Center(child: CircularProgressIndicator(),);
          if (snapshot.hasError) return Center (child:new Text('Error: ${snapshot.error}'));
          final int itemsCount = snapshot.data.documents.length;
          switch (snapshot.connectionState) {
            case ConnectionState.waiting:
              return new CircularProgressIndicator();
            default:
              return new ListView.builder(
                scrollDirection: Axis.vertical,
                controller: _scrollController,
  
                shrinkWrap: true,
                itemCount: itemsCount,
                itemBuilder: (BuildContext context, int index) {
                  final DocumentSnapshot document =
                      snapshot.data.documents[index];
  
                  if (document['color'] == true) {
                    return makeUnreadCard(snapshot.data.documents[index]);
                  }
                  return makeCard(snapshot.data.documents[index]);
                },
              );
          }
        }),
  );
  </code></pre>