fix bugs!

This commit is contained in:
fhkhd
2024-01-02 21:15:50 +03:30
parent d0eb9cd185
commit ec905fa4b7
5 changed files with 125 additions and 50 deletions
+19 -2
View File
@@ -239,7 +239,24 @@ class ItemProvider extends ChangeNotifier {
items = [];
searchBoxValue = value;
originalItems!.forEach((result) {
if (result.udi.toString().contains(searchBoxValue)) {
if (
result.udi
.toString()
.toLowerCase()
.contains(searchBoxValue.toLowerCase()) ||
result.udi
.toString()
.toUpperCase()
.contains(searchBoxValue.toUpperCase()) ||
result.udi
.toString()
.toLowerCase()
.contains(searchBoxValue.toUpperCase()) ||
result.udi
.toString()
.toUpperCase()
.contains(searchBoxValue.toLowerCase())
) {
items!.add(result);
}
});
@@ -289,7 +306,7 @@ class ItemProvider extends ChangeNotifier {
userName: item['user'] != null ? item['user']['name'] : '',
status: item['status'],
udi: item['udi'],
packageId: item['package_id'],
packageId: item['package_id'].toString(),
),
);
}
+18 -1
View File
@@ -247,7 +247,24 @@ class PackageProvider extends ChangeNotifier {
items = [];
searchBoxValue = value;
originalItems!.forEach((result) {
if (result.id.toString().contains(searchBoxValue)) {
if (
result.id
.toString()
.toLowerCase()
.contains(searchBoxValue.toLowerCase()) ||
result.id
.toString()
.toUpperCase()
.contains(searchBoxValue.toUpperCase()) ||
result.id
.toString()
.toLowerCase()
.contains(searchBoxValue.toUpperCase()) ||
result.id
.toString()
.toUpperCase()
.contains(searchBoxValue.toLowerCase())
) {
items!.add(result);
}
});
+22 -3
View File
@@ -88,8 +88,10 @@ class TestResultsProvider with ChangeNotifier {
}
int pageNumber = 1;
void resetPageNumber() => pageNumber = 1;
bool isloading = false;
void resetLoading() {
isloading = false;
notifyListeners();
@@ -109,7 +111,24 @@ class TestResultsProvider with ChangeNotifier {
items = [];
searchBoxValue = value;
originalItems!.forEach((result) {
if (result.name.toString().contains(searchBoxValue)) {
if (
result.name
.toString()
.toLowerCase()
.contains(searchBoxValue.toLowerCase()) ||
result.name
.toString()
.toUpperCase()
.contains(searchBoxValue.toUpperCase()) ||
result.name
.toString()
.toLowerCase()
.contains(searchBoxValue.toUpperCase()) ||
result.name
.toString()
.toUpperCase()
.contains(searchBoxValue.toLowerCase())
) {
items!.add(result);
}
});
@@ -333,9 +352,9 @@ class TestResultsProvider with ChangeNotifier {
.firstWhere((element) => element.id == data['id'].toString())
.result, //az api safheye asli estefade mishavad
'description':
data['inputs']['Note'] != null ? data['inputs']['Note'] : '',
data['inputs']['Note'] != null ? data['inputs']['Note'] : '',
'test_type_name':
data['test_type']['name'] != null ? data['test_type']['name'] : '',
data['test_type']['name'] != null ? data['test_type']['name'] : '',
'hospital': originalItems!
.firstWhere((element) => element.id == data['id'].toString())
.hospital, // az api safheye asli estefade mi shavad