Change some ui in item filter

This commit is contained in:
hanie.khodkari
2025-05-24 16:55:59 +03:30
parent ffd4d36ac2
commit 35d468f008
2 changed files with 380 additions and 380 deletions
+276 -276
View File
@@ -113,290 +113,290 @@ class _ItemFilterScreenState extends State<ItemFilterScreen> {
builder: (ct, connection, _) { builder: (ct, connection, _) {
return connection.conStatus != 'offline' return connection.conStatus != 'offline'
? isInit ? isInit
? Center( ? Center(
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: Colors.black, color: Colors.black,
),
)
: Padding(
padding: EdgeInsets.all(20),
child: ListView(
children: <Widget>[
Text(
'Filter Items',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Item ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemNameFocusNode);
},
), ),
), )
// Spacer(), : Padding(
Flexible( padding: EdgeInsets.all(20),
flex: 1, child: ListView(
child: InkWell( children: <Widget>[
onTap: () { Text(
scan().then( 'Filter Items',
(String result) { style: TextStyle(
if (result == 'cancel') { fontWeight: FontWeight.w700,
print('cancel'); fontSize: 5 * _deviceBlockSize,
} else if (result == 'error') { ),
print('error'); ),
} else if (result == 'access') { SizedBox(
print('access'); height: 20,
} else { ),
print(result); // Row(
idCTRL.text = result; // children: [
} // Flexible(
// flex: 8,
// child: TextFormField(
// controller: idCTRL,
// decoration: InputDecoration(
// icon: Icon(
// FontAwesomeIcons.sortNumericDown,
// size: 6 * _deviceBlockSize,
// ),
// labelStyle: TextStyle(
// fontWeight: FontWeight.w100,
// fontSize: 4 * _deviceBlockSize,
// ),
// labelText: 'Item ID',
// isDense: true,
// contentPadding: EdgeInsets.symmetric(
// vertical: 2,
// horizontal: 3,
// ),
// ),
// style: TextStyle(
// fontWeight: FontWeight.w700,
// fontSize: 5 * _deviceBlockSize,
// ),
// keyboardType: TextInputType.number,
// textInputAction: TextInputAction.next,
// onFieldSubmitted: (_) {
// FocusScope.of(context)
// .requestFocus(_itemNameFocusNode);
// },
// ),
// ),
// // Spacer(),
// Flexible(
// flex: 1,
// child: InkWell(
// onTap: () {
// scan().then(
// (String result) {
// if (result == 'cancel') {
// print('cancel');
// } else if (result == 'error') {
// print('error');
// } else if (result == 'access') {
// print('access');
// } else {
// print(result);
// idCTRL.text = result;
// }
// },
// );
// },
// child: Container(
// padding: EdgeInsets.all(8),
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// color: Colors.black,
// ),
// child: Icon(
// Icons.qr_code_scanner,
// size: 5 * _deviceBlockSize,
// color: Colors.white,
// ),
// ),
// ),
// ),
// ],
// ),
// SizedBox(
// height: 30,
// ),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: udiCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'UDI',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemUdiFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemSizeFocusNode);
},
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
udiCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 30.0,
),
TextFormField(
controller: nameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Item Name',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemNameFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemUdiFocusNode);
}, },
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
), ),
child: Icon( SizedBox(
Icons.qr_code_scanner, height: 30,
size: 5 * _deviceBlockSize,
color: Colors.white,
), ),
), TextFormField(
), controller: sizeCTRL,
), decoration: InputDecoration(
], icon: Icon(
), FontAwesomeIcons.sortNumericDown,
SizedBox( size: 6 * _deviceBlockSize,
height: 30, ),
), labelStyle: TextStyle(
TextFormField( fontWeight: FontWeight.w100,
controller: nameCTRL, fontSize: 4 * _deviceBlockSize,
decoration: InputDecoration( ),
icon: Icon( labelText: 'Size',
FontAwesomeIcons.alignLeft, isDense: true,
size: 6 * _deviceBlockSize, contentPadding: EdgeInsets.symmetric(
), vertical: 2, horizontal: 3),
labelStyle: TextStyle( ),
fontWeight: FontWeight.w100, style: TextStyle(
fontSize: 4 * _deviceBlockSize, fontWeight: FontWeight.w700,
), fontSize: 5 * _deviceBlockSize,
labelText: 'Item Name', ),
isDense: true, focusNode: _itemSizeFocusNode,
contentPadding: EdgeInsets.symmetric( keyboardType: TextInputType.number,
vertical: 2, horizontal: 3), textInputAction: TextInputAction.next,
), onFieldSubmitted: (_) {
style: TextStyle( FocusScope.of(context)
fontWeight: FontWeight.w700, .requestFocus(_itemSpecificFocusNode);
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemNameFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemUdiFocusNode);
},
),
SizedBox(
height: 30,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: udiCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'UDI',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemUdiFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemSizeFocusNode);
},
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
udiCTRL.text = result;
}
}, },
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
), ),
child: Icon( SizedBox(
Icons.qr_code_scanner, height: 30,
size: 5 * _deviceBlockSize,
color: Colors.white,
), ),
), TextFormField(
controller: specificCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Specific',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemSpecificFocusNode,
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
),
SizedBox(
height: 30,
),
FilterHospitalBox(
deviceBlockSize: _deviceBlockSize,
hospitalCTRL: hospitalCTRL,
hospitalVals: hospitalVals,
label: 'Hospital',
),
SizedBox(
height: 90,
),
ItemFilterSaveButton(
hospitalVals: hospitalVals,
hospitalCTRL: hospitalCTRL,
idCTRL: idCTRL,
nameCTRL: nameCTRL,
udiCTRL: udiCTRL,
sizeCTRL: sizeCTRL,
specificCTRL: specificCTRL,
deviceBlockSize: _deviceBlockSize,
firstColor: kBlue,
secondColor: kBlueSub,
push: Routes.itemResultScreen,
),
SizedBox(
height: 100,
),
],
), ),
), )
],
),
SizedBox(
height: 30.0,
),
TextFormField(
controller: sizeCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Size',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemSizeFocusNode,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemSpecificFocusNode);
},
),
SizedBox(
height: 30,
),
TextFormField(
controller: specificCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Specific',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemSpecificFocusNode,
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
),
SizedBox(
height: 30,
),
FilterHospitalBox(
deviceBlockSize: _deviceBlockSize,
hospitalCTRL: hospitalCTRL,
hospitalVals: hospitalVals,
label: 'Hospital',
),
SizedBox(
height: 90,
),
ItemFilterSaveButton(
hospitalVals: hospitalVals,
hospitalCTRL: hospitalCTRL,
idCTRL: idCTRL,
nameCTRL: nameCTRL,
udiCTRL: udiCTRL,
sizeCTRL: sizeCTRL,
specificCTRL: specificCTRL,
deviceBlockSize: _deviceBlockSize,
firstColor: kBlue,
secondColor: kBlueSub,
push: Routes.itemResultScreen,
),
SizedBox(
height: 100,
),
],
),
)
: ConnectionErrorBox(); : ConnectionErrorBox();
}, },
), ),
+104 -104
View File
@@ -101,110 +101,6 @@ class _MyItemsFilterScreenState extends State<MyItemsFilterScreen> {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Item ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemNameFocusNode);
},
),
),
// Spacer(),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
idCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 30,
),
TextFormField(
controller: nameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Item Name',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemNameFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemUdiFocusNode);
},
),
SizedBox(
height: 30,
),
Row( Row(
children: [ children: [
Flexible( Flexible(
@@ -278,6 +174,110 @@ class _MyItemsFilterScreenState extends State<MyItemsFilterScreen> {
SizedBox( SizedBox(
height: 30.0, height: 30.0,
), ),
// Row(
// children: [
// Flexible(
// flex: 8,
// child: TextFormField(
// controller: idCTRL,
// decoration: InputDecoration(
// icon: Icon(
// FontAwesomeIcons.sortNumericDown,
// size: 6 * _deviceBlockSize,
// ),
// labelStyle: TextStyle(
// fontWeight: FontWeight.w100,
// fontSize: 4 * _deviceBlockSize,
// ),
// labelText: 'Item ID',
// isDense: true,
// contentPadding: EdgeInsets.symmetric(
// vertical: 2,
// horizontal: 3,
// ),
// ),
// style: TextStyle(
// fontWeight: FontWeight.w700,
// fontSize: 5 * _deviceBlockSize,
// ),
// keyboardType: TextInputType.number,
// textInputAction: TextInputAction.next,
// onFieldSubmitted: (_) {
// FocusScope.of(context)
// .requestFocus(_itemNameFocusNode);
// },
// ),
// ),
// // Spacer(),
// Flexible(
// flex: 1,
// child: InkWell(
// onTap: () {
// scan().then(
// (String result) {
// if (result == 'cancel') {
// print('cancel');
// } else if (result == 'error') {
// print('error');
// } else if (result == 'access') {
// print('access');
// } else {
// print(result);
// idCTRL.text = result;
// }
// },
// );
// },
// child: Container(
// padding: EdgeInsets.all(8),
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// color: Colors.black,
// ),
// child: Icon(
// Icons.qr_code_scanner,
// size: 5 * _deviceBlockSize,
// color: Colors.white,
// ),
// ),
// ),
// ),
// ],
// ),
// SizedBox(
// height: 30,
// ),
TextFormField(
controller: nameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Item Name',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemNameFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemUdiFocusNode);
},
),
SizedBox(
height: 30,
),
TextFormField( TextFormField(
controller: sizeCTRL, controller: sizeCTRL,
decoration: InputDecoration( decoration: InputDecoration(