我想将数据从Firebase获取到List,我的意思是将所有自定义对象从数据库获取到我的列表。我知道在Android Java中是
DocumentReference docRef = db.collection("cities").document("BJ");
docRef.get().addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
@Override
public void onSuccess(DocumentSnapshot documentSnapshot) {
City city = documentSnapshot.toObject(City.class);
}
});
如何用Flutter做到这一点?