mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 23:28:54 +03:30
fix bugs!
This commit is contained in:
@@ -33,6 +33,7 @@ class _ItemAddScreenState extends State<ItemAddScreen> {
|
||||
final batchId = randomString(10);
|
||||
|
||||
int curLabelVal = 1;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
descriptionCTRL.text = '';
|
||||
@@ -43,7 +44,8 @@ class _ItemAddScreenState extends State<ItemAddScreen> {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
void _saveForm(String name, String size, String specific, String udi,String description) {
|
||||
void _saveForm(String name, String size, String specific, String udi,
|
||||
String description) {
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
});
|
||||
@@ -78,8 +80,23 @@ class _ItemAddScreenState extends State<ItemAddScreen> {
|
||||
)
|
||||
],
|
||||
),
|
||||
).then((value) => Navigator.of(context)
|
||||
.popAndPushNamed(Routes.itemResultScreen));
|
||||
).then((value) =>
|
||||
Navigator.of(context).popAndPushNamed(Routes.itemResultScreen));
|
||||
} else if (result == 'error') {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
content: Text('error.'),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
},
|
||||
child: Text('Ok'),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
@@ -129,7 +146,12 @@ class _ItemAddScreenState extends State<ItemAddScreen> {
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Items', style: TextStyle(color: Colors.white,),),
|
||||
title: Text(
|
||||
'Items',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.black,
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
@@ -360,7 +382,7 @@ class _ItemAddScreenState extends State<ItemAddScreen> {
|
||||
height: 70,
|
||||
),
|
||||
ItemAddSaveButton(
|
||||
onTap: (){
|
||||
onTap: () {
|
||||
_saveForm(
|
||||
nameCTRL.text,
|
||||
sizeCTRL.text,
|
||||
|
||||
@@ -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(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -88,7 +88,7 @@ class ItemItemBox extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 33 * _deviceBlockSize,
|
||||
width: 50 * _deviceBlockSize,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
|
||||
Reference in New Issue
Block a user