Flutter Firestore can't find provider in the widget tree? - firebase

Hello I am trying to firebase in my app and I keep running into problems. I've tried the suggestions in this screen shot, but I think perhaps I am not understanding properly.
Its saying cannot find correct Provider, I am guessing it can't find it in the tree. But it looks to me as if it is there
Here is my main where I call provider

So it turns out this is what works. Now i just need to figure out how to present the data.

Related

How to clear firebase cache?

I'm facing an issue where when I sign out a user (using FirebaseAuth.signOut() method) and sign in with another user, information of the previous user are loaded instead of the new one.
I believe this is caused by this information still being accessible in firebase's cache.
Is there a way to force firebase to clear its local cache?
Cheers!
For Android, there is FirebaseFirestore.clearPersistence().
For JavaScript/web, there is Firebase.clearPersistence().
For iOS, there is Firebase.clearPersistence().
Flutter does not seem to have this API yet.
Bear in mind that the clearPersistence API is not meant for the specific case you're talking about. If you read the API docs carefully, you can see they're meant for testing.
You might want to do a little more debugging to figure out what exactly it is that's not working the way you expect. Since you're not showing any code, it's hard to tell if you might be doing something wrong.
You can use the async call FirebaseFirestore.instance.clearPersistence(); for flutter projects.
Check this answer.
If clearPersistence() doesn't work, Programmatically restart your app
you can restart your app like this: https://stackoverflow.com/a/50116077/10041654
in addition, while restarting init your firebase: https://github.com/The-ring-io/flutter_phoenix/issues/27#issue-1490150037

How to make Firebase Storage urls shorter?

I'm using Firebase Storage to store images for my app project. The image urls are stored in Firestore. The problem is that all those urls are huge. Sometimes in the Firebase Console it get double scroll bars because of that. Is there any way we can make them shorter? Thanks!
Actually Firebase Dynamic Links would be a nice one solution for your situation.
You can make it runs following these instructions in this article from Medium, I have just implemented it in one of my Apps and it worked as expected.
I hope it helps you and everyone having the same issue.

How to send notification on data changes in databases

How to send notification to user on data changes in database using firebase ?
I am newbie and searched everywhere no such help.. please help me.
I got to know that it's possible using firebase cloud function but I did not got any example code to understand it. So please help by giving any example code.
Have a look at the first use-case mentioned in the Firebase documentation and the sample code for that use-case. They quite literally describe what you're asking for.
Note that this code is non-trivial, since the entire use-case is quite involved. You will have to make sure you understand all parts well, before you try to make any changes to the sample code. To get this understanding, you might be better served by following the more basic documentation for the Realtime Database and Cloud Messaging, and the codelab for iOS, Android, and/or Web.

Why is Google AppMaker is not allowing me to add database connections?

If I attempt to add a new SQL data model, a popup shows up explaining that the feature is locked and I must contact my administrator (myself). However, there is no further explanation found in the documentation on how to unlock this feature.
This is how AppMaker used to look back when it allowed me to add database connections:
This is how AppMaker looks now when starting a new app:
The App Maker engineers are doing crazy changes now and then. I believe their point of view is to make the platform better but this kind of things really annoys me and makes life harder, honestly.
I ran across this problem and find out that they are forcing admins to set up a default instance in the G Suite Admin console. You can read more about that here. You haven't completed that step and that is why you see what you are seeing. Although, it's crazy! What if I don't wanna do that?! But they are the product owners and they establish the rules so we have to suck it up and do what they want! Unless a bunch of people complain about it, they are not changing the behavior.
Fortunately, I was able to find a work around. So what we (you and me) are trying to do, is set up a custom sql database. Right now, that will only be available if you've already done what I described above. So the work around is to import an app that already has a custom sql database set up and then modify the Google Cloud SQL address. Look at the example below:
Here is the demo workaround app that I use. Download it to your machine, then import it as in the image above. I hope this helps!

Simulate updates inside Firebase Database Simulator

My question is pretty simple, I don´t know how to simulate multiple updates inside Firebase Simulator. Since I don´t know how to even start I can´t provide any code. Any guidance will be very helpful.
There is currently no way to execute multi-location updates in the Firebase Database security rules simulator.
It would be great to have that functionality, so can you file a feature request for it here?

Resources