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

Query data once #6

Open
aliakkawi opened this issue Oct 16, 2021 · 5 comments
Open

Query data once #6

aliakkawi opened this issue Oct 16, 2021 · 5 comments

Comments

@aliakkawi
Copy link

aliakkawi commented Oct 16, 2021

In my case i need get user Documents on a specific radius and i need that only 'Once', which means i need a way to do that without using Stream. The use of stream causes 'Background concurrent copying GC freed' that leads to memory leaks and freezes the app,
I tried to use Stream Subscription and cancel it as soon i receive data for the first time, but i guess the Stream is not getting stopped.
I need a way to do it like this
QuerySnapshot querySnapshot = await query.get();

Thanks for your suggestions

@FloLecoeuche
Copy link

This is what you're looking for ?
DarshanGowda0/GeoFlutterFire#193

@kamami
Copy link

kamami commented Dec 21, 2022

Is this eventually available?

@pawlowskim
Copy link
Contributor

I have described root cause of not disposing the underlaying stream in here: #26

when this is merged (or you can play around with the fork), you can use new method and then just call first on the stream, which will close the the stream right away, as it says in the the doc: https://api.flutter.dev/flutter/dart-async/Stream/first.html

@giorgio79
Copy link

Duplicate of DarshanGowda0/GeoFlutterFire#27 just cancel the stream

@pawlowskim
Copy link
Contributor

It won't cancel the stream @giorgio79, it will only cancel the subscription for broadcast stream which was outcome of merged 9 streams under the hood. Original stream will still be active, but you don't have access to it without any code changes.

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

5 participants