title: Flutter Firestore getDocuments() not working on initState
body: <p>I'm having an issue trying to call a document from Firestore in initState. I can pull data from a StreamBuilder just fine, but I just want to call the data once on initState.</p>
  
  <p>Here is what I'm doing:</p>
  
  <pre><code>class _PainLevelState extends State&lt;PainLevel&gt; {
    final FirebaseAuth _auth = FirebaseAuth.instance;
    final CollectionReference userCollection =
        Firestore.instance.collection('users');
    static final now = DateTime.now();
    String _uid;
    double myPainLevel = 0;
  
    Future&lt;void&gt; getCurrentUser() async {
      final FirebaseUser user = await _auth.currentUser();
      if (mounted) {
        setState(() {
          _uid = user.uid;
        });
      }
    }
  
    Future&lt;void&gt; getCurrentPainLevel() async {
      await userCollection
          .document(_uid)
          .collection('pain')
          .where('time',
              isGreaterThanOrEqualTo: DateTime(now.year, now.month, now.day))
          .getDocuments()
          .then((QuerySnapshot docs) {
        if (docs.documents.isNotEmpty) {
          print('yes');
        } else {
          print('no'); 
        }
      });
    }
  
    @override
    void initState() {
      super.initState();
      getCurrentUser();
      getCurrentPainLevel();
    }
  
  ...
  </code></pre>
  
  <p>I just get a "no" every time I print to console. It's not get any documents when there is one. If I take the same code inside the future and put it somewhere else, like in the build method, it works, but it constantly builds and I don't want that. Any suggestion as to why it is not working? Thanks in advance.</p>