Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cloud_firestore] Firestore ConnectionState is in Waiting state forever in flutter app. #73

Closed
pratiksanglikar opened this issue Sep 1, 2019 · 2 comments

Comments

@pratiksanglikar
Copy link

I am trying to fetch records from the Firestore database and show it in the Flutter app.

@override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
          title: Text('Hello'),
          actions: <Widget>[
            IconButton(icon: Icon(Icons.list), onPressed: _pushSaved)
          ]),
      drawer: _buildDrawer(),
      body: _buildCarpoolsList(),
    );
  }

Widget _buildCarpoolsList() {
    return StreamBuilder<QuerySnapshot>(
        stream: Firestore.instance.collection("carpools").snapshots(),
        builder: (context, snapshot) {
          if (!snapshot.hasData) {
            return CircularProgressIndicator();
          } else {
            var _carpools = snapshot.data.documents;
            return ListView(
                padding: const EdgeInsets.all(16.0),
                children: _deserializeCarpools(_carpools));
          }
        });
  }

In the _buildCarpoolsList() function the snapshot.ConnectionState is always ConnectionState.waiting, and the function returns CircularProgressBar().
Connection State

I have got a collection carpools in the FireStore database with a few records in it.
I have set the firestore database rules to allow all.

rules_version = '2';
service cloud.firestore {
  match /** {
      allow read, write: if true;
  }
}

My Firebase authentication works. (If that helps)

What could be missing here?

@shrutikateiosys
Copy link

Same issue i am facing . please help

@iapicca
Copy link

iapicca commented Oct 23, 2019

Hi @pratiksanglikar
I suggest you to post questions specific to your code on Stack Overflow
You may also check our guides.
Closing, as this isn't an issue with FlutterFire itself,
if you disagree please write in the comments and I will reopen it
Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants