2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-17 04:35:26 +00:00

Add "Category display" view

- Select "parts" from the app drawer
- Allow traversal of sub-categories
This commit is contained in:
Oliver Walters
2020-04-03 10:37:28 +11:00
parent f9dddfe3a2
commit 01faed03ee
4 changed files with 221 additions and 0 deletions

View File

@ -69,6 +69,24 @@ class InvenTreeModel {
}
*/
// Return the detail view for the associated pk
Future<InvenTreeModel> get(int pk) async {
// TODO - Add "timeout"
// TODO - Add error catching
var response = await InvenTreeAPI().get(path.join(URL, pk.toString()));
if (response.statusCode != 200) {
print("Error retrieving data");
return null;
}
final data = json.decode(response.body);
return createFromJson(data);
}
// Return list of objects from the database, with optional filters
Future<List<InvenTreeModel>> list({Map<String, String> filters}) async {