forked from vikunja/app
Format
This commit is contained in:
parent
cf9c9b4cb4
commit
187337c580
|
@ -29,7 +29,8 @@ class TaskAPIService extends APIService implements TaskService {
|
|||
|
||||
@override
|
||||
Future<List<Task>> getAll(int listId) {
|
||||
return client.get('/lists/$listId/tasks').then(
|
||||
(list) => convertList(list, (result) => Task.fromJson(result)));
|
||||
return client
|
||||
.get('/lists/$listId/tasks')
|
||||
.then((list) => convertList(list, (result) => Task.fromJson(result)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,10 @@ class Task {
|
|||
description = json['description'],
|
||||
text = json['text'],
|
||||
done = json['done'],
|
||||
owner = json['createdBy'].toString() == "null" ? null : User.fromJson(json['createdBy']); // There has to be a better way of doing this...
|
||||
owner = json['createdBy'].toString() == "null"
|
||||
? null
|
||||
: User.fromJson(json[
|
||||
'createdBy']); // There has to be a better way of doing this...
|
||||
|
||||
toJSON() => {
|
||||
'id': id,
|
||||
|
|
|
@ -25,8 +25,7 @@ class _ListPageState extends State<ListPage> {
|
|||
|
||||
@override
|
||||
void initState() {
|
||||
_list = TaskList(
|
||||
id: widget.taskList.id, title: widget.taskList.title);
|
||||
_list = TaskList(id: widget.taskList.id, title: widget.taskList.title);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
@ -97,10 +96,7 @@ class _ListPageState extends State<ListPage> {
|
|||
_loading = false;
|
||||
_list = list;
|
||||
// Load tasks
|
||||
VikunjaGlobal.of(context)
|
||||
.taskService
|
||||
.getAll(list.id)
|
||||
.then((tasks) {
|
||||
VikunjaGlobal.of(context).taskService.getAll(list.id).then((tasks) {
|
||||
setState(() {
|
||||
_tasks = tasks;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user