如何从firebase中的不同集合获取文档,并将它们添加到单个列表中以流形式返回?

如何从firebase中的不同集合获取文档,并将它们添加到单个列表中以流形式返回?,firebase,flutter,dart,google-cloud-firestore,Firebase,Flutter,Dart,Google Cloud Firestore,我正在尝试创建一个考勤应用程序,因此我想获取学生注册的课程。学生的班级看起来像这样: class Student { final String name; final String email; final String number; final String regNo; List<CourseIDAndInstructorID> courses; Student({this.name, this.email, this.number, this.reg

我正在尝试创建一个考勤应用程序,因此我想获取学生注册的课程。学生的班级看起来像这样:

class Student {
  final String name;
  final String email;
  final String number;
  final String regNo;
  List<CourseIDAndInstructorID> courses;

  Student({this.name, this.email, this.number, this.regNo});
}
有人能告诉我,我做错了什么,或者我怎么做?
如果问题上下文中缺少某些内容,请告诉我,以便我可以添加。

您可能需要创建列表对象,而不仅仅是指针

List<Course> courseList = new List();
List courseList=newlist();

非常感谢您指出这一点,这是一个非常愚蠢的错误。我花了很多时间想弄明白,所以我真的很感激。
List<Course> courseList = new List();