Search code examples
fluttergoogle-mapsfirebase-realtime-databasefirebase-storage

Why am I not able to see other user's markers which are stored on RTDB Firebase on Google Map Flutter


The issue is that I can only see my own marker on Google Maps while not of other users even tho the other users data (i.e. Latitude & Longitude) are stored on Realtime Database.

Below you can see the code:

Deleted Code

I was trying to get all other users marker (i.e. That every user can see each other location through map).


Solution

  • Your _locationRef points to the data for a specific user, and that seems to be the only path you read from the database.

    If you want to read data from all UID values, read from one level higher and loop over the results, as shown in the documentation on listening for a list of values.