Checklist constructor

const Checklist({
  1. @JsonKey.new(name: 'title') required String title,
  2. @JsonKey.new(name: 'title_entities') List<MessageEntity>? titleEntities,
  3. @JsonKey.new(name: 'tasks') required List<ChecklistTask> tasks,
  4. @JsonKey.new(name: 'others_can_add_tasks') bool? othersCanAddTasks,
  5. @JsonKey.new(name: 'others_can_mark_tasks_as_done') bool? othersCanMarkTasksAsDone,
})

Creates a new Checklist object.

Implementation

const factory Checklist({
  /// Title of the checklist
  @JsonKey(name: 'title') required String title,

  /// Optional. Special entities that appear in the checklist title
  @JsonKey(name: 'title_entities') List<MessageEntity>? titleEntities,

  /// List of tasks in the checklist
  @JsonKey(name: 'tasks') required List<ChecklistTask> tasks,

  /// Optional. True, if users other than the creator of the list can add
  /// tasks to the list
  @JsonKey(name: 'others_can_add_tasks') bool? othersCanAddTasks,

  /// Optional. True, if users other than the creator of the list can mark
  /// tasks as done or not done
  @JsonKey(name: 'others_can_mark_tasks_as_done')
  bool? othersCanMarkTasksAsDone,
}) = _Checklist;