mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 12:38:54 +03:30
Other Changes
This commit is contained in:
@@ -30,7 +30,7 @@ class PackageProvider extends ChangeNotifier {
|
|||||||
addItemVal() {
|
addItemVal() {
|
||||||
curItemVal += 1;
|
curItemVal += 1;
|
||||||
TextEditingController lbl = new TextEditingController();
|
TextEditingController lbl = new TextEditingController();
|
||||||
lbl.text = initialItemValue;
|
lbl.text = '';
|
||||||
itemValues.add(lbl);
|
itemValues.add(lbl);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
@@ -43,11 +43,18 @@ class PackageProvider extends ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// var isDuplicateItem = false;
|
||||||
changeItemVal(String value, int index) {
|
changeItemVal(String value, int index) {
|
||||||
for (var item in filteredItems!) {
|
for (var item in filteredItems!) {
|
||||||
|
// if(itemValues.length > 1 && value != itemValues[index-1].text){
|
||||||
if (item.udi_name == value) {
|
if (item.udi_name == value) {
|
||||||
itemValues[index].text = item.id;
|
itemValues[index].text = item.id;
|
||||||
}
|
}
|
||||||
|
// }else {
|
||||||
|
// // isDuplicateItem = true;
|
||||||
|
// print("it is a problem!!!!!!!!!!");
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
@@ -174,7 +181,7 @@ class PackageProvider extends ChangeNotifier {
|
|||||||
itemVals = result;
|
itemVals = result;
|
||||||
initialItemValue = itemVals[0];
|
initialItemValue = itemVals[0];
|
||||||
TextEditingController newLbl = new TextEditingController();
|
TextEditingController newLbl = new TextEditingController();
|
||||||
newLbl.text = initialItemValue;
|
newLbl.text = "";
|
||||||
itemValues.add(newLbl);
|
itemValues.add(newLbl);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -102,6 +102,39 @@ class TestResultsProvider with ChangeNotifier {
|
|||||||
// notifyListeners();
|
// notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// bool isChangeVerify = false;
|
||||||
|
// List<String> newVal = [];
|
||||||
|
// Future<void> setChangeVerify (String id, String value) async {
|
||||||
|
// // if(await changeVerification(id , value) == true){
|
||||||
|
// // isChangeVerify = true;
|
||||||
|
// //
|
||||||
|
// // // for(var testStatus in testResultData['data']['verified']){
|
||||||
|
// // // var iii = 0;
|
||||||
|
// // // newVal.add(testStatus.toString());
|
||||||
|
// // // print("i is : $iii $testStatus.");
|
||||||
|
// // // iii +1;
|
||||||
|
// // // }
|
||||||
|
// // getTestResults();
|
||||||
|
// // for(var item in items!)
|
||||||
|
// // newVal.add(item.verified);
|
||||||
|
// // notifyListeners();
|
||||||
|
// // }
|
||||||
|
// }
|
||||||
|
// void reSetChangeVerify (){
|
||||||
|
// isChangeVerify = false;
|
||||||
|
// }
|
||||||
|
|
||||||
|
bool isloadingButton = false;
|
||||||
|
void resetLoadingButton() {
|
||||||
|
isloadingButton = false;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
void setLoadingButton() {
|
||||||
|
isloadingButton = true;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
TestResultFilterObject get filters {
|
TestResultFilterObject get filters {
|
||||||
return _filters;
|
return _filters;
|
||||||
}
|
}
|
||||||
@@ -217,7 +250,7 @@ class TestResultsProvider with ChangeNotifier {
|
|||||||
'Authorization': User.token,
|
'Authorization': User.token,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
print(response.body);
|
||||||
var testResultData = json.decode(response.body);
|
var testResultData = json.decode(response.body);
|
||||||
if (pageNumber == 1) {
|
if (pageNumber == 1) {
|
||||||
originalItems = [];
|
originalItems = [];
|
||||||
@@ -228,7 +261,7 @@ class TestResultsProvider with ChangeNotifier {
|
|||||||
TestResultObject(
|
TestResultObject(
|
||||||
id: item['id'].toString(),
|
id: item['id'].toString(),
|
||||||
name: item['test_type'] != null ? item['test_type']['name'] : '',
|
name: item['test_type'] != null ? item['test_type']['name'] : '',
|
||||||
deviceId: item['device_id'].toString(),
|
deviceId: item['device_id'] != null ? item['device_id'].toString() : '',
|
||||||
result: item['result'] == 'Accept' ? 'Accepted' : 'Not Accepted',
|
result: item['result'] == 'Accept' ? 'Accepted' : 'Not Accepted',
|
||||||
date: item['created_at'].toString().substring(0, 10),
|
date: item['created_at'].toString().substring(0, 10),
|
||||||
hospital: item['user']['medical_center']['name'],
|
hospital: item['user']['medical_center']['name'],
|
||||||
|
|||||||
@@ -117,8 +117,15 @@ class AddItemBox extends StatelessWidget {
|
|||||||
height: 70,
|
height: 70,
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(horizontal: 0),
|
const EdgeInsets.symmetric(horizontal: 0),
|
||||||
child: TextFormField(
|
child: Consumer<PackageProvider>(builder: (context, packageProvider, _) {
|
||||||
|
return TextFormField(
|
||||||
controller: values,
|
controller: values,
|
||||||
|
validator: (val) {
|
||||||
|
if (val!.isEmpty) {
|
||||||
|
return 'Item required!';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
contentPadding: EdgeInsets.only(
|
contentPadding: EdgeInsets.only(
|
||||||
bottom: 12,
|
bottom: 12,
|
||||||
@@ -130,7 +137,8 @@ class AddItemBox extends StatelessWidget {
|
|||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
fontSize: 4 * _deviceBlockSize,
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
|
},),
|
||||||
),
|
),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
items: vals.map((val) {
|
items: vals.map((val) {
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ class PackageAddSaveButton extends StatelessWidget {
|
|||||||
for (TextEditingController item in itemValues) {
|
for (TextEditingController item in itemValues) {
|
||||||
items.add(item.text);
|
items.add(item.text);
|
||||||
}
|
}
|
||||||
|
items = items.toSet().toList();
|
||||||
await Provider.of<PackageProvider>(context, listen: false)
|
await Provider.of<PackageProvider>(context, listen: false)
|
||||||
.createPackageResult(
|
.createPackageResult(
|
||||||
nameCTRL.text,
|
nameCTRL.text,
|
||||||
|
|||||||
@@ -281,10 +281,16 @@ class PackageDetailsDataBox extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
width: 45 * _deviceBlockSize,
|
width: 45 * _deviceBlockSize,
|
||||||
child: Text(
|
child: Text(
|
||||||
datas.status == 'approved' ? 'Confirmed' : 'Rejected',
|
datas.status == 'approved'
|
||||||
|
? 'Confirmed'
|
||||||
|
: datas.status == 'rejected'
|
||||||
|
? 'Rejected'
|
||||||
|
: 'Pending..',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
color: datas.status == 'approved' ? kBlue : kPink,
|
color: datas.status == 'approved' ? kBlue : datas
|
||||||
|
.status == 'rejected'
|
||||||
|
? kPink : Colors.grey,
|
||||||
),
|
),
|
||||||
overflow: TextOverflow.clip,
|
overflow: TextOverflow.clip,
|
||||||
),
|
),
|
||||||
@@ -314,7 +320,8 @@ class PackageDetailsDataBox extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemBuilder: (ctx, index) => RichText(
|
itemBuilder: (ctx, index) =>
|
||||||
|
RichText(
|
||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
text: '${index + 1}. ',
|
text: '${index + 1}. ',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -357,7 +364,8 @@ class PackageDetailsDataBox extends StatelessWidget {
|
|||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async => await launch(
|
onTap: () async =>
|
||||||
|
await launch(
|
||||||
'https://cssd-doc.com/Show/Package/${datas.id.toString()}',
|
'https://cssd-doc.com/Show/Package/${datas.id.toString()}',
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|||||||
Reference in New Issue
Block a user