16 lines
318 B
Dart
16 lines
318 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();
|
|
}
|
|
}
|