MoodleTask constructor

const MoodleTask({
  1. @JsonKey(name: 'moduleid') required int id,
  2. required String name,
  3. @JsonKey(name: 'courseid') required int courseId,
  4. required MoodleTaskStatus status,
  5. required MoodleTaskType type,
  6. @UnixTimestampConverter() required DateTime? deadline,
  7. required String url,
})

A task that is part of a MoodleCourse.

Implementation

const factory MoodleTask({
  /// The ID of this task.
  @JsonKey(name: 'moduleid') required int id,

  /// The name of this task.
  required String name,

  /// The ID of the [MoodleCourse] this task is part of.
  @JsonKey(name: 'courseid') required int courseId,

  /// The status of this task.
  required MoodleTaskStatus status,

  /// The type of this task.
  required MoodleTaskType type,

  /// The timestamp of when this task is due in seconds since the Unix epoch.
  @UnixTimestampConverter() required DateTime? deadline,

  /// The URL to this task on the Moodle website.
  required String url,
}) = _MoodleTask;