title: Reading data from Firebase - Flutter
body: <p>I would like to change <code>String</code> to something else in order to read data from firebase.</p>
  
  <p>I have the following code:</p>
  
  <pre><code>enum Answers{GS,FB}
  
  String _value = ''; //Probably, String should be changed. 
  
  void _setValue(String value) =&gt; setState(() =&gt; _value = value); ////Probably, String should be changed.
  
  Future kaleciSec(BuildContext context) async {
      switch(
      await showDialog(
  ...
  ...
                             StreamBuilder(
        stream: Firestore.instance.collection('GS').snapshots(),
        builder: (context, snapshot){
          if(!snapshot.hasData) return Center (child: CircularProgressIndicator());
          return Column(
  
                  crossAxisAlignment: CrossAxisAlignment.start,
            children: &lt;Widget&gt;[
                        ListTile(
              onTap: (){Navigator.pop(context, Answers.GS);}, //selecting GS.
              title: Text(snapshot.data.documents[0]['kaleci1'], //showing data from DB
  
               ),
            ),
             Divider(
                      color: Colors.grey,),
  
                        ListTile(
              onTap: (){Navigator.pop(context, Answers.FB);},
              title: Text(snapshot.data.documents[0]['kaleci2'],
               ),
  
            ],
          );
  
  
        },
      ),      
                       ],
                       ),
      )
      )    
  
  
                 {
        case Answers.GS:
        _setValue('GS'); //I would like connect database here.
        break;
        case Answers.FB:
        _setValue('FB'); //I would like connect database here.
        break;
  
      } 
  </code></pre>
  
  <p>My code works without an error. But, I need to show what is selected. Basically, I would like to change <code>_setValue('GS');</code> to something like <code>_setValue(snapshot.data.documents[0]['kaleci1']);</code> this. Please help me!</p>
  
  <p>I stick on this issue for a few days.</p>