48 lines
1.0 KiB
Dart
48 lines
1.0 KiB
Dart
import '../task.dart';
|
|
|
|
class CreateTaskRequest {
|
|
final String title;
|
|
final String description;
|
|
final DateTime? start;
|
|
final DateTime? due;
|
|
final bool isCompleted;
|
|
final String category;
|
|
final List<Task> subtasks;
|
|
final String url;
|
|
|
|
CreateTaskRequest({
|
|
required this.title,
|
|
required this.description,
|
|
required this.start,
|
|
required this.due,
|
|
required this.isCompleted,
|
|
required this.category,
|
|
required this.subtasks,
|
|
required this.url,
|
|
});
|
|
|
|
CreateTaskRequest.fromTask(Task task)
|
|
: title = task.title,
|
|
description = task.description,
|
|
start = task.start,
|
|
due = task.due,
|
|
isCompleted = task.isCompleted,
|
|
category = task.category,
|
|
subtasks = task.subtasks,
|
|
url = task.url;
|
|
|
|
Task toTask({required String id}) {
|
|
return Task(
|
|
id: id,
|
|
title: title,
|
|
description: description,
|
|
start: start,
|
|
due: due,
|
|
isCompleted: isCompleted,
|
|
category: category,
|
|
subtasks: subtasks,
|
|
url: url,
|
|
);
|
|
}
|
|
}
|