Replies: 1 comment 2 replies
-
I doubt that this is related to Provider. I'd suggest using the Flutter devtool to investigate the memory usage, to see what's taking up all the memory |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I hope this is appropriate to mention here; I believe I am running into an out of memory error with Provider when combined with Flutter Web and Go Router.
I have setup my User class as a ChangeNotifierProvider, which gets notified from a StreamListener, as shown below.
In my main.dart, I set my providers and router as such, using the Flutter go_router (v2, not 3).
I use Firestore to update the DB, as such:
Called from:
intermediate method:
This works as expected. However, on Flutter web, if I repeatedly make calls I run out of memory. Furthermore, if I leave open the page for a while I also sometimes run out of memory. I am suspect that this is caused by Provider perhaps interacting with the GoRouter, but I cannot be certain, it is very difficult to ascertain. I thought this may be caused by the location of my Provider within the tree, namely at the top ahead of the Material router, however this bug exists even if I move it down lower. I now suspect there is some issue with the User not being disposed appropriately.
Any thoughts? Is this the right place to look?
Beta Was this translation helpful? Give feedback.
All reactions