2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 05:26:47 +00:00

Add some getters

This commit is contained in:
Oliver Walters 2020-05-23 21:15:02 +10:00
parent 1d7d3def04
commit 56dd22c656
3 changed files with 39 additions and 1 deletions

View File

@ -72,6 +72,18 @@ class InvenTreePartTestTemplate extends InvenTreeModel {
@override
String URL = "part/test-template/";
String get key => jsondata['key'] ?? '';
String get testName => jsondata['test_name'] ?? '';
String get description => jsondata['description'] ?? '';
bool get required => jsondata['required'] ?? false;
bool get requiresValue => jsondata['requires_value'] ?? false;
bool get requiresAttachment => jsondata['requires_attachment'] ?? false;
InvenTreePartTestTemplate() : super();
InvenTreePartTestTemplate.fromJson(Map<String, dynamic> json) : super.fromJson(json) {

View File

@ -16,6 +16,20 @@ class InvenTreeStockItemTestResult extends InvenTreeModel {
@override
String URL = "stock/test/";
String get key => jsondata['key'] ?? '';
String get test_name => jsondata['test'] ?? '';
bool get result => jsondata['result'] ?? false;
String get value => jsondata['value'] ?? '';
String get notes => jsondata['notes'] ?? '';
String get attachment => jsondata['attachment'] ?? '';
String get date => jsondata['date'] ?? '';
InvenTreeStockItemTestResult() : super();
InvenTreeStockItemTestResult.fromJson(Map<String, dynamic> json) : super.fromJson(json) {

View File

@ -31,10 +31,22 @@ class _StockItemTestResultDisplayState extends RefreshableState<StockItemTestRes
_StockItemTestResultDisplayState(this.item);
// Squish together templates and results
List<Widget> resultsList() {
List<Widget> items = [];
items.add(ListTile(
title: Text("Test results"),
));
return items;
}
@override
Widget getBody(BuildContext context) {
return ListView(
children: resultsList(),
);
}
}