diff --git a/.gitignore b/.gitignore index 48f4ca9..928dd44 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ .pub/ /build/ ios/Flutter/flutter_export_environment.sh +analysis_options.yaml # Web related lib/generated_plugin_registrant.dart @@ -45,3 +46,6 @@ app.*.map.json /android/app/debug /android/app/profile /android/app/release + +# VS Code +.vscode/settings.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..1b2ba13 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,10 @@ +{ + "configurations": [ + { + "name": "Flutter", + "request": "launch", + "type": "dart", + "flutterMode": "debug" + } + ] +} diff --git a/lib/api/client.dart b/lib/api/client.dart index 1fc7158..f2d1f9f 100644 --- a/lib/api/client.dart +++ b/lib/api/client.dart @@ -42,28 +42,36 @@ class Client { queryParameters: queryParameters, // Because dart takes a Map here, it is only possible to sort by one parameter while the api supports n parameters. fragment: uri.fragment); - return http.get(newUri, headers: _headers) - .then(_handleResponse); + return http.get(newUri, headers: _headers).then(_handleResponse); } Future delete(String url) { - return http.delete('${this.base}$url'.toUri(), - headers: _headers, - ).then(_handleResponse); + return http + .delete( + '${this.base}$url'.toUri(), + headers: _headers, + ) + .then(_handleResponse); } Future post(String url, {dynamic body}) { - return http.post('${this.base}$url'.toUri(), - headers: _headers, - body: _encoder.convert(body), - ).then(_handleResponse); + return http + .post( + '${this.base}$url'.toUri(), + headers: _headers, + body: _encoder.convert(body), + ) + .then(_handleResponse); } Future put(String url, {dynamic body}) { - return http.put('${this.base}$url'.toUri(), - headers: _headers, - body: _encoder.convert(body), - ).then(_handleResponse); + return http + .put( + '${this.base}$url'.toUri(), + headers: _headers, + body: _encoder.convert(body), + ) + .then(_handleResponse); } Response _handleResponse(http.Response response) { @@ -81,10 +89,7 @@ class Client { response.statusCode, response.request.url.toString()); } return Response( - _decoder.convert(response.body), - response.statusCode, - response.headers - ); + _decoder.convert(response.body), response.statusCode, response.headers); } } diff --git a/lib/api/label_task.dart b/lib/api/label_task.dart index e29011f..c9b1b77 100644 --- a/lib/api/label_task.dart +++ b/lib/api/label_task.dart @@ -9,14 +9,16 @@ class LabelTaskAPIService extends APIService implements LabelTaskService { @override Future