removed alarms and location from task model

This commit is contained in:
2026-06-18 23:02:20 +02:00
parent 999023e48a
commit cee5af0f84
3 changed files with 0 additions and 26 deletions
@@ -9,8 +9,6 @@ class CreateTaskRequest {
final bool isCompleted;
final String category;
final List<Task> subtasks;
final List<DateTime> alarms;
final Location? location;
final String url;
CreateTaskRequest({
@@ -21,8 +19,6 @@ class CreateTaskRequest {
required this.isCompleted,
required this.category,
required this.subtasks,
required this.alarms,
required this.location,
required this.url,
});
@@ -34,8 +30,6 @@ class CreateTaskRequest {
isCompleted = task.isCompleted,
category = task.category,
subtasks = task.subtasks,
alarms = task.alarms,
location = task.location,
url = task.url;
Task toTask({required String id}) {
@@ -48,8 +42,6 @@ class CreateTaskRequest {
isCompleted: isCompleted,
category: category,
subtasks: subtasks,
alarms: alarms,
location: location,
url: url,
);
}
-16
View File
@@ -9,8 +9,6 @@ class Task {
final bool isCompleted;
final String category;
final List<Task> subtasks;
final List<DateTime> alarms;
final Location? location;
final String url;
Task({
@@ -22,8 +20,6 @@ class Task {
this.isCompleted = false,
this.category = '',
this.subtasks = const [],
this.alarms = const [],
this.location,
this.url = '',
});
@@ -49,8 +45,6 @@ class Task {
isCompleted: isCompleted ?? this.isCompleted,
category: category ?? this.category,
subtasks: subtasks ?? this.subtasks,
alarms: alarms ?? this.alarms,
location: location ?? this.location,
url: url ?? this.url,
);
}
@@ -71,14 +65,6 @@ class Task {
?.map((e) => Task.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
alarms:
(json['alarms'] as List<dynamic>?)
?.map((e) => DateTime.parse(e as String))
.toList() ??
[],
location: json['location'] != null
? Location.fromJson(json['location'] as Map<String, dynamic>)
: null,
url: json['url'] as String? ?? '',
);
}
@@ -93,8 +79,6 @@ class Task {
'isCompleted': isCompleted,
'category': category,
'subtasks': subtasks.map((e) => e.toJson()).toList(),
'alarms': alarms.map((e) => e.toIso8601String()).toList(),
'location': location?.toJson(),
'url': url,
};
}
-2
View File
@@ -139,8 +139,6 @@ class _TaskEditPageState extends State<TaskEditPage> {
isCompleted: false,
category: categoryController.text,
subtasks: [],
alarms: [],
location: null,
url: urlController.text,
),
);