14 lines
300 B
Dart
14 lines
300 B
Dart
import 'domain/models/Student.dart';
|
|
|
|
class University {
|
|
List<Student> students = [];
|
|
|
|
void addStudent(Student student) {
|
|
students.add(student);
|
|
}
|
|
|
|
List<Student> getStudentsByCourse(String course) {
|
|
return students.where((student) => student.courses.contains(course)).toList();
|
|
}
|
|
}
|