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:
@ -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;
|
||||
|
Reference in New Issue
Block a user