PIbd-32_Stroev_V_M_PMD/lib/University.dart

16 lines
318 B
Dart
Raw Normal View History

2024-10-22 08:55:54 +04:00
import 'domain/models/Student.dart';
2024-10-01 20:53:17 +04:00
class University {
List<Student> students = [];
void addStudent(Student student) {
students.add(student);
}
List<Student> getStudentsByCourse(String course) {
2024-10-22 08:55:54 +04:00
return students
.where((student) => student.courses.contains(course))
.toList();
2024-10-01 20:53:17 +04:00
}
2024-10-22 08:55:54 +04:00
}