58 lines
1.3 KiB
Dart
58 lines
1.3 KiB
Dart
import 'location.dart';
|
|
|
|
class Task {
|
|
final String id;
|
|
final String title;
|
|
final String description;
|
|
final DateTime? start;
|
|
final DateTime? due;
|
|
final bool isCompleted;
|
|
final String category;
|
|
final List<Task> subtasks;
|
|
final List<DateTime> alarms;
|
|
final Location? location;
|
|
final String url;
|
|
|
|
Task({
|
|
required this.id,
|
|
required this.title,
|
|
this.description = '',
|
|
this.start,
|
|
this.due,
|
|
this.isCompleted = false,
|
|
this.category = '',
|
|
this.subtasks = const [],
|
|
this.alarms = const [],
|
|
this.location,
|
|
this.url = '',
|
|
});
|
|
|
|
Task copyWith({
|
|
String? id,
|
|
String? title,
|
|
String? description,
|
|
DateTime? start,
|
|
DateTime? due,
|
|
bool? isCompleted,
|
|
String? category,
|
|
List<Task>? subtasks,
|
|
List<DateTime>? alarms,
|
|
Location? location,
|
|
String? url,
|
|
}) {
|
|
return Task(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
description: description ?? this.description,
|
|
start: start ?? this.start,
|
|
due: due ?? this.due,
|
|
isCompleted: isCompleted ?? this.isCompleted,
|
|
category: category ?? this.category,
|
|
subtasks: subtasks ?? this.subtasks,
|
|
alarms: alarms ?? this.alarms,
|
|
location: location ?? this.location,
|
|
url: url ?? this.url,
|
|
);
|
|
}
|
|
}
|