mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 06:18:54 +03:30
Fix test input api
This commit is contained in:
@@ -139,6 +139,10 @@ class _TestResultAddScreenState extends State<TestResultAddScreen> {
|
|||||||
context,
|
context,
|
||||||
listen: false,
|
listen: false,
|
||||||
).testTypeId = result;
|
).testTypeId = result;
|
||||||
|
Provider.of<TestResultsProvider>(
|
||||||
|
context,
|
||||||
|
listen: false,
|
||||||
|
).isFromTestID = false;
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
context,
|
context,
|
||||||
Routes.formTestResultScreen,
|
Routes.formTestResultScreen,
|
||||||
|
|||||||
@@ -81,11 +81,13 @@ class _FormPageState extends State<FormPage> {
|
|||||||
});
|
});
|
||||||
var providerObject = Provider.of<TestResultsProvider>(context);
|
var providerObject = Provider.of<TestResultsProvider>(context);
|
||||||
String testTypeId = Provider.of<TestResultsProvider>(context).testTypeId;
|
String testTypeId = Provider.of<TestResultsProvider>(context).testTypeId;
|
||||||
|
bool isFromTestID = Provider.of<TestResultsProvider>(context).isFromTestID;
|
||||||
providerObject.catchImages.clear();
|
providerObject.catchImages.clear();
|
||||||
Provider.of<Inputs>(context, listen: false)
|
Provider.of<Inputs>(context, listen: false)
|
||||||
.getInputs(
|
.getInputs(
|
||||||
testResultId: '',
|
testResultId: '',
|
||||||
testTypeId: testTypeId,
|
testTypeId: testTypeId,
|
||||||
|
isId: isFromTestID,
|
||||||
)
|
)
|
||||||
.then((_) {
|
.then((_) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|||||||
@@ -12,9 +12,13 @@ class Inputs with ChangeNotifier {
|
|||||||
Future<bool> getInputs({
|
Future<bool> getInputs({
|
||||||
required String testResultId,
|
required String testResultId,
|
||||||
required String testTypeId,
|
required String testTypeId,
|
||||||
|
required bool isId,
|
||||||
}) async {
|
}) async {
|
||||||
|
var url = isId == true
|
||||||
|
? "${Url.getInputs}/$testTypeId"
|
||||||
|
: "${Url.getInputs}/$testTypeId?by=code";
|
||||||
var response = await http.get(
|
var response = await http.get(
|
||||||
Uri.parse("${Url.getInputs}/$testTypeId"),
|
Uri.parse(url),
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': User.token,
|
'Authorization': User.token,
|
||||||
'X-Requested-With': 'XMLHttpRequest',
|
'X-Requested-With': 'XMLHttpRequest',
|
||||||
|
|||||||
@@ -16,12 +16,14 @@ class TestResultsProvider with ChangeNotifier {
|
|||||||
List<PlatformFile> catchImages = [];
|
List<PlatformFile> catchImages = [];
|
||||||
List<Uint8List> images = [];
|
List<Uint8List> images = [];
|
||||||
String testTypeId = '';
|
String testTypeId = '';
|
||||||
|
bool isFromTestID = true;
|
||||||
String testCode = '';
|
String testCode = '';
|
||||||
List<Map<String, String>> testTypeMap = [];
|
List<Map<String, String>> testTypeMap = [];
|
||||||
|
|
||||||
resetTests() {
|
resetTests() {
|
||||||
testCode = '';
|
testCode = '';
|
||||||
testTypeId = '';
|
testTypeId = '';
|
||||||
|
isFromTestID = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
setImages() async {
|
setImages() async {
|
||||||
|
|||||||
Reference in New Issue
Block a user