Having trouble retrieving data from Firebase
This is my attempted solution :
DatabaseReference databaseRef = FirebaseDatabase.instance.reference();
await databaseRef.child('...').once().then((DataSnapshot snapshot) {
print(snapshot.value);
});
Outcome (SUCCESSFUL) :
https://i.sstatic.net/HguUT.png
The data structure looks like this:
id1
key1 = val1
id2
key2 = val2
I want to retrieve each value (e.g. val1, val2, etc.)
I attempted the following:
snapshot.value.forEach((d) {
//print(d);
});
However, I encountered this issue:
https://i.sstatic.net/UOsBE.png Any suggestions?