I am trying to fetch some data from firebase which is in this order :
+73bbm2guOygsfqddvqwTTOLRC3w1
+-LY2t4PuMhDBPO0jAZ3f
brand:
id:
model:
year:
I want the dropdown button to hold ids for all cars of that user
I have managed to retrieve the data as Map with this code :
static getUserCars() async {
final response = await FirebaseDatabase.instance
.reference()
.child("cars")
.child(uid)
.once();
print(response.value);
Map map = json.decode(response.value);
return map;
}
How can I show these values from the database in a DropDownButton?