From cee5af0f84e0058629e760f505cac14a33a15b03 Mon Sep 17 00:00:00 2001 From: marco Date: Thu, 18 Jun 2026 23:02:20 +0200 Subject: [PATCH] removed alarms and location from task model --- .../callback_models/create_task_request.dart | 8 -------- lib/model/task.dart | 16 ---------------- lib/pages/task_edit_page.dart | 2 -- 3 files changed, 26 deletions(-) diff --git a/lib/model/callback_models/create_task_request.dart b/lib/model/callback_models/create_task_request.dart index 549a4ba..4af9e22 100644 --- a/lib/model/callback_models/create_task_request.dart +++ b/lib/model/callback_models/create_task_request.dart @@ -9,8 +9,6 @@ class CreateTaskRequest { final bool isCompleted; final String category; final List subtasks; - final List 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, ); } diff --git a/lib/model/task.dart b/lib/model/task.dart index f4554f9..cecddd7 100644 --- a/lib/model/task.dart +++ b/lib/model/task.dart @@ -9,8 +9,6 @@ class Task { final bool isCompleted; final String category; final List subtasks; - final List 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)) .toList() ?? [], - alarms: - (json['alarms'] as List?) - ?.map((e) => DateTime.parse(e as String)) - .toList() ?? - [], - location: json['location'] != null - ? Location.fromJson(json['location'] as Map) - : 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, }; } diff --git a/lib/pages/task_edit_page.dart b/lib/pages/task_edit_page.dart index e31fade..dc51e03 100644 --- a/lib/pages/task_edit_page.dart +++ b/lib/pages/task_edit_page.dart @@ -139,8 +139,6 @@ class _TaskEditPageState extends State { isCompleted: false, category: categoryController.text, subtasks: [], - alarms: [], - location: null, url: urlController.text, ), );