PIbd-32_Stroev_V_M_PMD/lib/University.dart
2024-10-22 08:55:54 +04:00

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();
}
}