StudySubject class

Inheritance
Annotations
  • @JsonSerializable()

Constructors

StudySubject(String id, String studyId, String userId, List<String> selectedInterventionIds)
StudySubject.fromJson(Map<String, dynamic> json)
factory
StudySubject.fromStudy(Study study, String userId, List<String> selectedInterventionIds, String? inviteCode)

Properties

completedStudy bool
no setter
daysPerIntervention int
no setter
hashCode int
The hash code for this object.
no setteroverride
id String
getter/setter pair
interventionOrder List<String>
no setter
inviteCode String?
getter/setter pair
isDeleted bool
getter/setter pair
minimumStudyLengthCompleted bool
no setter
onSave Stream<StudySubject>
no setter
primaryKeys Map<String, Object>
no setteroverride
progress List<SubjectProgress>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedInterventionIds List<String>
getter/setter pair
selectedInterventions List<Intervention>
no setter
startedAt DateTime?
getter/setter pair
study Study
getter/setter pair
studyId String
getter/setter pair
userId String
getter/setter pair

Methods

allTasksCompletedFor(DateTime dateTime) bool
Check if all tasks are fully completed on a given day returns true if all of of the tasks (interventions & observations) have been completed on a given day
completedForPhase(int index) int
completedTaskForDay(String taskId, DateTime dateTime) bool
Check if a task is fully completed for all task instances returns true if a given task has been completed for all of its completionPeriods on a given day
completedTaskInstanceForDay(String taskId, CompletionPeriod completionPeriod, DateTime dateTime) bool
Check if a task instance is completed returns true if a given task has been completed for a specific completionPeriod on a given day
completedTasksFor(Task task) int
dayAfterEndOfPhase(int index) DateTime
daysLeftForPhase(int index) int
delete() Future<StudySubject>
override
deleteProgress() Future<void>
endDate(DateTime dt) DateTime
getDayOfStudyFor(DateTime date) int
getInterventionForDate(DateTime date) Intervention?
getInterventionIndexForDate(DateTime date) int
getInterventionsInOrder() List<Intervention>
getResultsByDate({required String interventionId}) Map<DateTime, List<SubjectProgress>>
getTaskProgressForDay(String taskId, DateTime dateTime) List<SubjectProgress>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
percentCompletedForPhase(int index) double
percentMissedForPhase(int index, DateTime date) double
resultsFor(String taskId) List<SubjectProgress>
save({bool onlyUpdate = false}) Future<StudySubject>
Save the object to the database. By default, this will upsert the object, i.e. insert it if it does not exist, or update it if it does. If onlyUpdate is set to true, the object has to exist in the database, otherwise the result will be empty.
override
scheduleFor(DateTime dateTime) List<TaskInstance>
setStartDateBackBy({required int days}) Future<void>
softDelete() Future<StudySubject>
startOfPhase(int index) DateTime
toFullJson({Map<String, dynamic>? partialJson}) Map<String, dynamic>
toJson() Map<String, dynamic>
override
toString() String
A string representation of this object.
override
totalTaskCountFor(Task task) int

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

getStudyHistory(String userId) Future<List<StudySubject>>

Constants

tableName → const String