This happens because, when you created your project at that time the Realtime Database was not enabled, that's why the google-services.json
file don't contain the url
to our Realtime Database.
I was also faced with a same problem, here's what I did.
We can also download an updated google-services.json
file. But I manually added the url.
from this:
{
"project_info": {
"project_number": "xxx4071207xxx",
"project_id": "xxxantonixxx",
"storage_bucket": "xxxantonixxx.appspot.com"
},
to this:
{
"project_info": {
"project_number": "xxx4071207xxx",
"firebase_url": " https://multiapp-f0e1e-default-rtdb.europe-west1.firebasedatabase.app",
"project_id": "xxxantonixxx",
"storage_bucket": "xxxantonixxx.appspot.com"
},
You'll get your database Url from here:

But wait... it still might not work.
If you make changes to the google-services.json
file. And recompile the app from start, still the changes DONOT take place immediately.
In my case, even if I deleted the google-services.json
file and recompile the app again, it was working similar to before deleting.
Solution:##
So, in that case, we'll have to delete the build
and .dart_tool
folder in our project folder,
Or run flutter clean
in terminal
and then recompile the app again from start.
I came to know about this after I wasted my 2 whole days, working in some other direction. That's why I had to share it, so that it doesn't happen to anybody else.