1
0
mirror of https://github.com/go-vikunja/app synced 2024-06-05 03:59:48 +00:00

fixed old method call for getting labels

fixed wrong datetime stamp for labels
This commit is contained in:
benimautner 2022-05-24 00:02:39 +02:00
parent 7449b97367
commit 6a2e41bc86
3 changed files with 9 additions and 9 deletions

View File

@ -32,7 +32,7 @@ class LabelAPIService extends APIService implements LabelService {
String params =
query == '' ? null : '?s=' + Uri.encodeQueryComponent(query);
return client.get('/labels$params').then(
(label) => convertList(label, (result) => Label.fromJson(result)));
(response) => convertList(response.body, (result) => Label.fromJson(result)));
}
@override

View File

@ -36,7 +36,7 @@ class Label {
'hex_color':
color?.value?.toRadixString(16)?.padLeft(8, '0')?.substring(2),
'created_by': createdBy?.toJSON(),
'updated': updated?.millisecondsSinceEpoch,
'created': created?.millisecondsSinceEpoch,
'updated': updated?.toUtc()?.toIso8601String(),
'created': created?.toUtc()?.toIso8601String(),
};
}

View File

@ -1,3 +1,5 @@
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:flutter_typeahead/flutter_typeahead.dart';
import 'package:vikunja_app/components/datetimePicker.dart';
@ -258,13 +260,9 @@ class _TaskEditPageState extends State<TaskEditPage> {
controller: _labelTypeAheadController,
decoration:
InputDecoration(labelText: 'Add a new label')),
suggestionsCallback: (pattern) {
return _searchLabel(pattern);
},
suggestionsCallback: (pattern) => _searchLabel(pattern),
itemBuilder: (context, suggestion) {
return ListTile(
title: Text(suggestion),
);
return Text(suggestion);
},
transitionBuilder: (context, suggestionsBox, controller) {
return suggestionsBox;
@ -366,6 +364,7 @@ class _TaskEditPageState extends State<TaskEditPage> {
.labelService
.getAll(query: query)
.then((labels) {
log("searched");
// Only show those labels which aren't already added to the task
labels.removeWhere((labelToRemove) => _labels.contains(labelToRemove));
_suggestedLabels = labels;
@ -386,6 +385,7 @@ class _TaskEditPageState extends State<TaskEditPage> {
if (found) {
_labelTypeAheadController.clear();
}
setState(() {});
}
_createAndAddLabel(String labelTitle) {