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

ConnectionState is stuck in waiting status if coming from a page which used the same QuerySnapshot #16

Open
Badane opened this issue Mar 19, 2024 · 0 comments

Comments

@Badane
Copy link

Badane commented Mar 19, 2024

Expected Behavior

Hello,
I connect to a same collection in different pages in my application. I use the FiresoreBuilder as so, in each page which need data from this "cellars" collection :

     FirestoreBuilder(
          ref: cellarsRef, 
          builder: (BuildContext context, AsyncSnapshot<CellarQuerySnapshot>snapshot, Widget? child) {
            if (snapshot.hasError) {
              print(snapshot.error.toString());
              return Center(child: Text('An error has occured!'));
            }
            if (snapshot.connectionState == ConnectionState.waiting) {
              return Center(
                child: CircularProgressIndicator(),
              );
            }

            CellarQuerySnapshot cellarSnapshot = snapshot.requireData;
            return Wrap(
              children: [
                for(int i=0;i<cellarSnapshot.docs.length;i++) ...{
 ...

My ""cellarsRef"" is declared in the model file and imported with the model in each page.

Actual Behavior

If I navigate to another page wich use the same FirestoreBuilder, the connectionState will be stuck with the waiting status.
I have to navigate to a "clean" page, and come back to see my data correctly displayed.
Do you have an idea how I can be sure that each connection is closed before I create another one ?
Thank you

Specifications

  • Version: 1.0.0-dev.84
  • Platform: Web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant