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
|
@override
|
||||||
Future<List<Task>> getAll(int listId) {
|
Future<List<Task>> getAll(int listId) {
|
||||||
return client.get('/lists/$listId/tasks').then(
|
return client
|
||||||
(list) => convertList(list, (result) => Task.fromJson(result)));
|
.get('/lists/$listId/tasks')
|
||||||
|
.then((list) => convertList(list, (result) => Task.fromJson(result)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,10 @@ class Task {
|
||||||
description = json['description'],
|
description = json['description'],
|
||||||
text = json['text'],
|
text = json['text'],
|
||||||
done = json['done'],
|
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() => {
|
toJSON() => {
|
||||||
'id': id,
|
'id': id,
|
||||||
|
|
|
@ -25,8 +25,7 @@ class _ListPageState extends State<ListPage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
_list = TaskList(
|
_list = TaskList(id: widget.taskList.id, title: widget.taskList.title);
|
||||||
id: widget.taskList.id, title: widget.taskList.title);
|
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,10 +96,7 @@ class _ListPageState extends State<ListPage> {
|
||||||
_loading = false;
|
_loading = false;
|
||||||
_list = list;
|
_list = list;
|
||||||
// Load tasks
|
// Load tasks
|
||||||
VikunjaGlobal.of(context)
|
VikunjaGlobal.of(context).taskService.getAll(list.id).then((tasks) {
|
||||||
.taskService
|
|
||||||
.getAll(list.id)
|
|
||||||
.then((tasks) {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_tasks = tasks;
|
_tasks = tasks;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user