1
0
mirror of https://github.com/go-vikunja/app synced 2024-06-02 18:49:47 +00:00

fixed bugs from merge with master

This commit is contained in:
Benimautner 2022-08-27 23:57:42 +02:00
parent 2a271287db
commit 416d2e0187
5 changed files with 15 additions and 7 deletions

View File

@ -14,7 +14,7 @@ enum DropLocation {above, below, none}
class TaskData {
final Task task;
final Size size;
final Size? size;
TaskData(this.task, this.size);
}
@ -214,7 +214,7 @@ class _BucketTaskCardState extends State<BucketTaskCard> with AutomaticKeepAlive
);
return LongPressDraggable<TaskData>(
data: TaskData(widget.task, _cardSize!),
data: TaskData(widget.task, _cardSize),
maxSimultaneousDrags: taskState.taskDragging ? 0 : 1, // only one task can be dragged at a time
onDragStarted: () {
taskState.taskDragging = true;

View File

@ -5,7 +5,7 @@ import 'package:vikunja_app/models/user.dart';
class TaskList {
final int id;
int namespaceId;
final String? title, description;
String? title, description;
final User? owner;
final DateTime? created, updated;
List<Task?> tasks;

View File

@ -25,7 +25,7 @@ class Task {
final List<TaskAttachment>? attachments;
// TODO: add position(?)
late final CheckboxStatistics _checkboxStatistics;
CheckboxStatistics? _checkboxStatistics;
// // TODO: use `late final` once upgraded to current dart version
Task({

View File

@ -15,7 +15,8 @@ import 'package:vikunja_app/stores/list_store.dart';
class NamespacePage extends StatefulWidget {
final Namespace namespace;
NamespacePage({required this.namespace}) : super(key: Key(namespace.id.toString()));
NamespacePage({required this.namespace})
: super(key: Key(namespace.id.toString()));
@override
_NamespacePageState createState() => new _NamespacePageState();
@ -126,7 +127,13 @@ class _NamespacePageState extends State<NamespacePage>
_addList(String name, BuildContext context) {
VikunjaGlobal.of(context)
.listService
.create(widget.namespace.id, TaskList(id: 0, title: name, tasks: []))
.create(
widget.namespace.id,
TaskList(
id: 0,
title: name,
tasks: [],
namespaceId: widget.namespace.id))
.then((_) {
setState(() {});
_loadLists();

View File

@ -33,7 +33,8 @@ var _lists = {
owner: _users[1],
description: 'A nice list',
created: DateTime.now(),
updated: DateTime.now())
updated: DateTime.now(),
namespaceId: 1)
};
var _tasks = {