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

Add skeleton page for showing test results for a stock item

This commit is contained in:
Oliver Walters
2020-05-23 20:27:27 +10:00
parent 868e1d20dc
commit 1d7d3def04
3 changed files with 68 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import 'dart:convert';
import 'package:InvenTree/inventree/part.dart';
import 'package:flutter/cupertino.dart';
import 'package:http/http.dart' as http;
import 'model.dart';
@ -67,6 +68,29 @@ class InvenTreeStockItem extends InvenTreeModel {
// TODO
}
List<InvenTreePartTestTemplate> testTemplates = List<InvenTreePartTestTemplate>();
int get testTemplateCount => testTemplates.length;
// Get all the test templates associated with this StockItem
Future<void> getTestTemplates(BuildContext context, {bool showDialog=false}) async {
InvenTreePartTestTemplate().list(
context,
filters: {
"part": "${partId}",
},
dialog: showDialog,
).then((var templates) {
testTemplates.clear();
for (var t in templates) {
if (t is InvenTreePartTestTemplate) {
testTemplates.add(t);
}
}
});
}
List<InvenTreeStockItemTestResult> testResults = List<InvenTreeStockItemTestResult>();
int get testResultCount => testResults.length;