I have a function that gets the results of a google places search for stores and searches Firestore to see if the store is already in the database.

Whenever I run it thought the Stream Builder is doing nothing.

I think the problem is that the function is not within a widget and does not have a build method. Here is the code:

```
  void searchStores() async {
    Prediction newStore = await PlacesAutocomplete.show(
        context: context,
        apiKey: kGoogleApiKey,
        mode: Mode.overlay,
        language: "en",
        components: [new Component(Component.country, "au")]);

    await places.getDetailsByPlaceId(newStore.placeId).then((detailStoreInfo) {

      print('running 1');

      StreamBuilder (
          stream: Firestore.instance.collection('stores').document(detailStoreInfo.result.id).snapshots(),
          builder: (BuildContext context, AsyncSnapshot snapshot){

            print('running 2');

            setState(() {
              if (snapshot.connectionState == ConnectionState.active &&
                  snapshot.hasData){

                print('running 3');

                if (snapshot.data['veganOnly'] == null || snapshot.data['veganOnly'] == false){

                  print('running 4');

                  setState(() {
                    firstStore = true;
                  });

                }
              }
            });

            return null;

          }
      );

    });
  }

```

As you can see I added print statements to work out where my code is failing. 'running 1' is show so the places is returning a response.

But none of the other statements (2,3 or 4) are printing so it seems the stream builder is not working, not even coming back with null values.

I also tried putting a return before the stream builder but that had no effect either.

Am I correct in thinking this because it is not in the build method of a widget or is it something else entirely.

Thanks