Added label search
This commit is contained in:
parent
f1f3be6d36
commit
24ffef1aef
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_typeahead/flutter_typeahead.dart';
|
||||
|
||||
import 'package:vikunja_app/components/datetimePicker.dart';
|
||||
import 'package:vikunja_app/components/label.dart';
|
||||
import 'package:vikunja_app/global.dart';
|
||||
|
@ -240,13 +239,10 @@ class _TaskEditPageState extends State<TaskEditPage> {
|
|||
}).toList()),
|
||||
TypeAheadFormField(
|
||||
textFieldConfiguration: TextFieldConfiguration(
|
||||
controller: _typeAheadController,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'City'
|
||||
)
|
||||
),
|
||||
//controller: _typeAheadController,
|
||||
decoration: InputDecoration(labelText: 'City')),
|
||||
suggestionsCallback: (pattern) {
|
||||
return CitiesService.getSuggestions(pattern);
|
||||
return _searchLabel(pattern);
|
||||
},
|
||||
itemBuilder: (context, suggestion) {
|
||||
return ListTile(
|
||||
|
@ -322,12 +318,13 @@ class _TaskEditPageState extends State<TaskEditPage> {
|
|||
});
|
||||
}
|
||||
|
||||
_removeLabel(Label label) {
|
||||
|
||||
}
|
||||
_removeLabel(Label label) {}
|
||||
|
||||
_searchLabel(String query) {
|
||||
VikunjaGlobal.of(context)
|
||||
return VikunjaGlobal.of(context)
|
||||
.labelService
|
||||
.getAll(query: query)
|
||||
.then((labels) => labels.map((label) => label.title).toList());
|
||||
}
|
||||
|
||||
// FIXME: Move the following two functions to an extra class or type.
|
||||
|
|
Reference in New Issue
Block a user