This commit is contained in:
erfan
2021-01-06 11:57:21 +03:30
parent 20cc775bc1
commit 2c045f43f1
12 changed files with 302 additions and 119 deletions
+15 -11
View File
@@ -13,14 +13,14 @@ class Inputs with ChangeNotifier {
String name = "",
String uniqueCode = "",
String testTypeId = ""}) async {
print(
{
'test_type_id': testTypeId,
'test_result_id': testResultId,
'name': name,
'unique_code': uniqueCode,
},
);
// print(
// {
// 'test_type_id': testTypeId,
// 'test_result_id': testResultId,
// 'name': name,
// 'unique_code': uniqueCode,
// },
// );
var response = await http.post(
Url.getInputs,
body: {
@@ -41,8 +41,10 @@ class Inputs with ChangeNotifier {
}
final responseData = json.decode(response.body);
// print(responseData);
// print(responseData['data']['inputs']);
// for (var item in responseData['data']['testType'].keys) {
// print(item);
// }
Map<String, dynamic> values;
if (testResultId.isNotEmpty) {
response = await http.get(Url.testResultFormValues(testResultId),
@@ -72,11 +74,12 @@ class Inputs with ChangeNotifier {
'value': general['id']
});
// print(responseData['data']['inputs']);
inputItems.add({
'type': 'Text',
'key': 'device_id',
'name': general['device_label'],
'value': deviceLabel
'value': deviceLabel,
});
inputItems.add(
{'type': 'Date', 'key': 'date', 'name': 'date', 'value': dateTime});
@@ -86,6 +89,7 @@ class Inputs with ChangeNotifier {
setValues(inputs, values);
for (var input in inputs) {
inputItems.add(input as Map<String, dynamic>);
// print(input);
}
inputItems.add({
'type': 'Image',