Skip to content

Instantly share code, notes, and snippets.

@Levi-Lesches
Created February 4, 2020 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Levi-Lesches/5d98139641ebdd38552ba599666b53d3 to your computer and use it in GitHub Desktop.
Save Levi-Lesches/5d98139641ebdd38552ba599666b53d3 to your computer and use it in GitHub Desktop.
RamLife Tutoring data types
enum Subject {history, english} // ...
enum Reviewer {teacher, student}
class User {
String first, last;
int rating;
}
class Tutor extends User {
int yearGraduated;
List<Subject> subjects;
Map<Subject, int> reportCard;
List<Review> reviews;
String phoneNumber;
}
class Student extends User {
int grade;
}
class Session {
List<DateTime> availableMeetings;
int price;
Tutor tutor;
Student student;
}
class Review {
Reviewer reviewer;
String teacherName;
DateTime date;
// make a getter to decide whether a student wrote the review or not
}
List<Tutor> tutors = [];
class TutoringModel {
// filters...
// print(tutors.where((Tutor tutor) => tutor.subjects.contains(Subject.english)));
}
void main() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment