2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-13 10:45:29 +00:00

Package updates (#365)

* Update dart version

* Update flutter version in workflow

* Update packages

* Updates to android workflow

* Specify dart verrsion in CI

* Run flutter upgrade

* Helps to check which workflow is actually running I guess

* Disable linting check

* linting fixes

* linting

* Bug fix for paginator
This commit is contained in:
Oliver
2023-06-12 22:52:07 +10:00
committed by GitHub
parent b051aeccda
commit 21ace1ae02
12 changed files with 106 additions and 84 deletions

View File

@ -80,6 +80,26 @@ class APIResponse {
return [];
}
}
/*
* Helper function to interpret response, and return a list.
* Handles case where the response is paginated, or a complete set of results
*/
List<dynamic> resultsList() {
if (isList()) {
return asList();
} else if (isMap()) {
var response = asMap();
if (response.containsKey("results")) {
return response["results"] as List<dynamic>;
} else {
return [];
}
} else {
return [];
}
}
}