I am getting data in this way from firebase real time database
{
-NCPZuwqiuMwtaKfW-g9: {
latitude: -122.083922,
longitude: 37.4214938
},
-NCPntX1RFEyzvxYsgBe: {
latitude: -122.083922,
longitude: 37.4214938
},
-NCPoSmW2MxMnySLDCYg: {
latitude: -122.07730409759519,
longitude: 37.41749643309451
},
-NCPbS50dJZ_gtlUEK82: {
latitude: -122.07730527365285,
longitude: 37.417498330741125
},
now i want to access the latitude and longitude of the database but i am unable to get it what i tried is this
_dbReference
?.child("LiveTracker")
.child("$passedId")
.onValue
.listen((event) {
print("asasdasdasdsaddsadsadsadsadsad${event.snapshot.value}");
/* _markers.add(Marker(
markerId: MarkerId(DateTime.now().toIso8601String()),
position: LatLng(double.parse(event.snapshot.value.toString()),
double.parse(event.snapshot.value.toString()))));*/
});
i want to listen to the real time data and add that latitude and longitude inside my marker but i am unable to access the latitude and longitude need some guidance