format
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2020-06-25 10:10:00 +02:00
parent 11e5711aab
commit 873bcef161
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
4 changed files with 14 additions and 12 deletions

View File

@ -22,19 +22,21 @@ class ListAPIService extends APIService implements ListService {
@override
Future<TaskList> get(int listId) {
return client.get('/lists/$listId').then((response) => TaskList.fromJson(response.body));
return client
.get('/lists/$listId')
.then((response) => TaskList.fromJson(response.body));
}
@override
Future<List<TaskList>> getAll() {
return client.get('/lists').then(
(response) => convertList(response.body, (result) => TaskList.fromJson(result)));
return client.get('/lists').then((response) =>
convertList(response.body, (result) => TaskList.fromJson(result)));
}
@override
Future<List<TaskList>> getByNamespace(int namespaceId) {
return client.get('/namespaces/$namespaceId/lists').then(
(response) => convertList(response.body, (result) => TaskList.fromJson(result)));
return client.get('/namespaces/$namespaceId/lists').then((response) =>
convertList(response.body, (result) => TaskList.fromJson(result)));
}
@override

View File

@ -29,8 +29,8 @@ class NamespaceAPIService extends APIService implements NamespaceService {
@override
Future<List<Namespace>> getAll() {
return client.get('/namespaces').then(
(response) => convertList(response.body, (result) => Namespace.fromJson(result)));
return client.get('/namespaces').then((response) =>
convertList(response.body, (result) => Namespace.fromJson(result)));
}
@override

View File

@ -1,5 +1,3 @@
// This is a wrapper class to be able to return the headers up to the provider
// to properly handle things like pagination with it.
class Response {
@ -8,4 +6,4 @@ class Response {
final dynamic body;
final int statusCode;
final Map<String, String> headers;
}
}

View File

@ -32,7 +32,9 @@ class TaskAPIService extends APIService implements TaskService {
Future<Response> getAll(int listId,
[Map<String, List<String>> queryParameters]) {
return client.get('/lists/$listId/tasks', queryParameters).then(
(response) =>
new Response(convertList(response.body, (result) => Task.fromJson(result)), response.statusCode, response.headers));
(response) => new Response(
convertList(response.body, (result) => Task.fromJson(result)),
response.statusCode,
response.headers));
}
}