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:
parent
1d7d3def04
commit
56dd22c656
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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(),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user