I wanna fetch recent inserted data in firebase real-time database, it can be on a top or bottom. basically I have created a card in flutter, instead of list of data I wanna replace the recent inserted database in a app with old data.
Query dbref = FirebaseDatabase.instance.ref().child("post");
Container(
height: 200,
width: 400,
child: FirebaseAnimatedList(
query: dbref,
itemBuilder: (BuildContext context,DataSnapshot snapshot,Animation<double> animation,int index)
{
Map data = snapshot.value as Map;
data['key'] = snapshot.key;
// return ListTile(
// title: Text(data[0]["title"].toString()),
// );
return li(data:data);
}
)
)