removed position from the model
This commit is contained in:
@@ -2,8 +2,10 @@ import 'model/task.dart';
|
||||
import 'service/tools.dart' show generateId;
|
||||
|
||||
List<Task> tasks = [
|
||||
Task(id: generateId(), title: 'Hund föhnen', position: 0),
|
||||
Task(id: '${generateId()}1', title: 'Fuchs streicheln', position: 1),
|
||||
Task(id: '${generateId()}2', title: 'Katze füttern', position: 2),
|
||||
Task(id: '${generateId()}3', title: 'Bär kraulen', position: 3),
|
||||
Task(id: generateId(), title: 'Hund föhnen'),
|
||||
Task(id: '${generateId()}1', title: 'Fuchs streicheln'),
|
||||
Task(id: '${generateId()}2', title: 'Katze füttern'),
|
||||
Task(id: '${generateId()}3', title: 'Bär kraulen'),
|
||||
];
|
||||
|
||||
Iterable<String> taskPositions = tasks.map<String>((e) => e.id);
|
||||
|
||||
@@ -38,7 +38,7 @@ class CreateTaskRequest {
|
||||
location = task.location,
|
||||
url = task.url;
|
||||
|
||||
Task toTask({required String id, required int position}) {
|
||||
Task toTask({required String id}) {
|
||||
return Task(
|
||||
id: id,
|
||||
title: title,
|
||||
@@ -51,7 +51,6 @@ class CreateTaskRequest {
|
||||
alarms: alarms,
|
||||
location: location,
|
||||
url: url,
|
||||
position: position,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ class Task {
|
||||
final List<DateTime> alarms;
|
||||
final Location? location;
|
||||
final String url;
|
||||
final int position;
|
||||
|
||||
Task({
|
||||
required this.id,
|
||||
@@ -26,7 +25,6 @@ class Task {
|
||||
this.alarms = const [],
|
||||
this.location,
|
||||
this.url = '',
|
||||
required this.position,
|
||||
});
|
||||
|
||||
Task copyWith({
|
||||
@@ -41,7 +39,6 @@ class Task {
|
||||
List<DateTime>? alarms,
|
||||
Location? location,
|
||||
String? url,
|
||||
int? position,
|
||||
}) {
|
||||
return Task(
|
||||
id: id ?? this.id,
|
||||
@@ -55,7 +52,6 @@ class Task {
|
||||
alarms: alarms ?? this.alarms,
|
||||
location: location ?? this.location,
|
||||
url: url ?? this.url,
|
||||
position: position ?? this.position,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user