added position field and copyWith constructor
This commit is contained in:
@@ -12,6 +12,7 @@ class Task {
|
||||
final List<DateTime> alarms;
|
||||
final Location? location;
|
||||
final String url;
|
||||
final int position;
|
||||
|
||||
Task({
|
||||
required this.id,
|
||||
@@ -25,5 +26,36 @@ class Task {
|
||||
this.alarms = const [],
|
||||
this.location,
|
||||
this.url = '',
|
||||
required this.position,
|
||||
});
|
||||
|
||||
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,
|
||||
int? position,
|
||||
}) {
|
||||
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,
|
||||
position: position ?? this.position,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user