mrdishant/flutter_geofire

How to use with 2 or more geofire event listeners in one app

Opened this issue · 2 comments

I am working on this geofire package and I have been trying to initialize a geofire, then stop that listener from one button. And then i have another button that initializes another geofire, then stop that listener. The problem is that it still reads the old locations and displays the markers on the map with those locations instead of the new ones. Could you explain to me the correct process how to stop a listener, delete the old markers and make them nullified before a new listener to display another set of markers on the map?

Thanks

same issue here. the listener keeps use the old location . we need this issue to be solved!

found the solutions ! add these lines in GeofirePlugin

@Override public void onCancel(Object o) { geoFire= null; geoQuery.removeAllListeners(); geoQuery = null; events = null; databaseReference = null; }