mirror of
https://github.com/go-vikunja/app
synced 2024-10-12 08:55:33 +00:00
chore: dart format
This commit is contained in:
parent
5f808565f2
commit
459171d41a
@ -101,8 +101,12 @@ class TaskAPIService extends APIService implements TaskService {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<Task>?> getByFilterString(String filterString, [Map<String, List<String>>? queryParameters]) {
|
||||
Map<String, List<String>> parameters = {"filter": [filterString], ...?queryParameters};
|
||||
Future<List<Task>?> getByFilterString(String filterString,
|
||||
[Map<String, List<String>>? queryParameters]) {
|
||||
Map<String, List<String>> parameters = {
|
||||
"filter": [filterString],
|
||||
...?queryParameters
|
||||
};
|
||||
print(parameters);
|
||||
return client.get('/tasks/all', parameters).then((response) {
|
||||
if (response == null) return null;
|
||||
|
@ -252,27 +252,22 @@ class LandingPageState extends State<LandingPage> {
|
||||
return global.taskService.getAllByProject(filterId, {
|
||||
"sort_by": ["due_date", "id"],
|
||||
"order_by": ["asc", "desc"],
|
||||
}).then<Future<void>?>((response) =>
|
||||
_handleTaskList(response?.body));
|
||||
}).then<Future<void>?>((response) => _handleTaskList(response?.body));
|
||||
;
|
||||
}
|
||||
List<String> filterStrings = ["done = false"];
|
||||
if(showOnlyDueDateTasks) {
|
||||
if (showOnlyDueDateTasks) {
|
||||
filterStrings.add("due_date > 0001-01-01 00:00");
|
||||
}
|
||||
return global.taskService.getByFilterString(filterStrings.join(" && "), {
|
||||
"sort_by": ["due_date", "id"],
|
||||
"order_by": ["asc", "desc"],
|
||||
"filter_include_nulls": ["false"],
|
||||
})
|
||||
.then<Future<void>?>(
|
||||
(taskList) => _handleTaskList(taskList));
|
||||
}).then<Future<void>?>((taskList) => _handleTaskList(taskList));
|
||||
}); //.onError((error, stackTrace) {print("error");});
|
||||
}
|
||||
|
||||
Future<void> _handleTaskList(
|
||||
List<Task>? taskList ) {
|
||||
|
||||
Future<void> _handleTaskList(List<Task>? taskList) {
|
||||
if (taskList != null && taskList.isEmpty) {
|
||||
setState(() {
|
||||
landingPageStatus = PageStatus.empty;
|
||||
|
@ -173,7 +173,8 @@ abstract class TaskService {
|
||||
|
||||
@deprecated
|
||||
Future<List<Task>?> getByOptions(TaskServiceOptions options);
|
||||
Future<List<Task>?> getByFilterString(String filterString, [Map<String, List<String>> queryParameters]);
|
||||
Future<List<Task>?> getByFilterString(String filterString,
|
||||
[Map<String, List<String>> queryParameters]);
|
||||
|
||||
int get maxPages;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user