You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
1.3 KiB
78 lines
1.3 KiB
class Course {
|
|
int id;
|
|
String name;
|
|
double credit;
|
|
String teacher;
|
|
String location;
|
|
String remark;
|
|
DateTime start;
|
|
DateTime end;
|
|
|
|
Course({
|
|
required this.id,
|
|
required this.name,
|
|
required this.credit,
|
|
required this.teacher,
|
|
required this.location,
|
|
required this.remark,
|
|
required this.start,
|
|
required this.end,
|
|
});
|
|
|
|
// Getter methods
|
|
int get getId => id;
|
|
|
|
String get getName => name;
|
|
|
|
double get getCredit => credit;
|
|
|
|
String get getTeacher => teacher;
|
|
|
|
String get getLocation => location;
|
|
|
|
String get getRemark => remark;
|
|
|
|
DateTime get getStart => start;
|
|
|
|
DateTime get getEnd => end;
|
|
|
|
// Setter methods
|
|
set setId(int newId) {
|
|
id = newId;
|
|
}
|
|
|
|
set setName(String newName) {
|
|
name = newName;
|
|
}
|
|
|
|
set setCredit(double newCredit) {
|
|
credit = newCredit;
|
|
}
|
|
|
|
set setTeacher(String newTeacher) {
|
|
teacher = newTeacher;
|
|
}
|
|
|
|
set setLocation(String newLocation) {
|
|
location = newLocation;
|
|
}
|
|
|
|
set setRemark(String newRemark) {
|
|
remark = newRemark;
|
|
}
|
|
|
|
set setStart(DateTime newStart) {
|
|
start = newStart;
|
|
}
|
|
|
|
set setEnd(DateTime newEnd) {
|
|
end = newEnd;
|
|
}
|
|
|
|
// toString method
|
|
@override
|
|
String toString() {
|
|
return 'Course(id: $id, name: $name, credit: $credit, teacher: $teacher, location: $location, remark: $remark, start: $start, end: $end)';
|
|
}
|
|
}
|