1

This is just a general question to get an idea. I am using Flutter with the google maps flutter plugin on an iOS device with the geolocator plugin and it works just fine. It shows my location in realtime with a nice blue circular dot and the markers I uploaded to firebase are showing and are persisted on Firestore. However, my issue is how do I show multiple users i.e multiple dots representing different users using the same App? they are subscribed to the same flutter App theoretically but how do you show all the user locations with dots on the map? say like Uber you see your nearest drivers around you.

K.chim
  • 868
  • 2
  • 14
  • 25

1 Answers1

2

First, and you already seem to have this, you would need your app to upload the geolocalization information to a server in real-time, by uploading the LatLng info (or whatever data structure you use for latitude-longitude coordinates) from the location package.

Then, you would need your app to listen to that database via a Stream or a similar subscription object, and update the UI whenever the location of other users is updated.

As you mention, one way to do that would be using Firebase to store the latitude-longitude data of every user, and to update and notify other listeners in real time. I have used Firebase to achieve a similar functionality in the past successfully.

Check out this Fireship.io video where they introduce you to the topic and describe a possible solution in more detail.

drogel
  • 2,567
  • 2
  • 13
  • 22
  • I am actually using your Geofire package and followed your tutorials, I will try it and if I fail I will add the code to my post so that you can see and advise – K.chim Feb 23 '20 at 11:55
  • Oh, those packages and videos are not mine, but they were indeed useful to me when I had to implement a similar functionality in a past project. Hope it’s helpful, and don’t hesitate adding a comment if you get stuck so I get notified. – drogel Feb 23 '20 at 12:15
  • @K.chim hey, Im trying to do the exact same thing using flutter. any updates on how you were able to achieve this, thank you – habiba Sep 29 '20 at 16:42