Fix test input api

This commit is contained in:
hanie.khodkari
2025-06-12 02:07:06 +03:30
parent c7e68e73f0
commit 1a60d80840
4 changed files with 13 additions and 1 deletions
+4
View File
@@ -139,6 +139,10 @@ class _TestResultAddScreenState extends State<TestResultAddScreen> {
context,
listen: false,
).testTypeId = result;
Provider.of<TestResultsProvider>(
context,
listen: false,
).isFromTestID = false;
Navigator.pushNamed(
context,
Routes.formTestResultScreen,
+2
View File
@@ -81,11 +81,13 @@ class _FormPageState extends State<FormPage> {
});
var providerObject = Provider.of<TestResultsProvider>(context);
String testTypeId = Provider.of<TestResultsProvider>(context).testTypeId;
bool isFromTestID = Provider.of<TestResultsProvider>(context).isFromTestID;
providerObject.catchImages.clear();
Provider.of<Inputs>(context, listen: false)
.getInputs(
testResultId: '',
testTypeId: testTypeId,
isId: isFromTestID,
)
.then((_) {
setState(() {
+5 -1
View File
@@ -12,9 +12,13 @@ class Inputs with ChangeNotifier {
Future<bool> getInputs({
required String testResultId,
required String testTypeId,
required bool isId,
}) async {
var url = isId == true
? "${Url.getInputs}/$testTypeId"
: "${Url.getInputs}/$testTypeId?by=code";
var response = await http.get(
Uri.parse("${Url.getInputs}/$testTypeId"),
Uri.parse(url),
headers: {
'Authorization': User.token,
'X-Requested-With': 'XMLHttpRequest',
+2
View File
@@ -16,12 +16,14 @@ class TestResultsProvider with ChangeNotifier {
List<PlatformFile> catchImages = [];
List<Uint8List> images = [];
String testTypeId = '';
bool isFromTestID = true;
String testCode = '';
List<Map<String, String>> testTypeMap = [];
resetTests() {
testCode = '';
testTypeId = '';
isFromTestID = true;
}
setImages() async {