to get the child key you need to take a DataSnapshot then you can order the key
snapshot.key.toString()
It will return all keys of the Realtime Database in the current level.
If you need to get an specific key you should link it with index of the user choice.
FirebaseAnimatedList(
shrinkWrap: true,
query: FirebaseDatabase.instance.ref().child('journeys'),
itemBuilder: (BuildContext context, DataSnapshot snapshot,
Animation animation, int index) {
try {
return Text(snapshot.key.toString());
} catch (e) {
customSnackBar(context, e.toString(), 3, Colors.white24, Colors.brown, 17);
}
}),
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.